lantiq_soc.h 3.0 KB
Newer Older
1 2 3 4 5
/*
 *  This program is free software; you can redistribute it and/or modify it
 *  under the terms of the GNU General Public License version 2 as published
 *  by the Free Software Foundation.
 *
J
John Crispin 已提交
6
 *  Copyright (C) 2010 John Crispin <john@phrozen.org>
7 8 9 10 11 12 13 14 15 16 17 18 19
 */

#ifndef _LTQ_XWAY_H__
#define _LTQ_XWAY_H__

#ifdef CONFIG_SOC_TYPE_XWAY

#include <lantiq.h>

/* Chip IDs */
#define SOC_ID_DANUBE1		0x129
#define SOC_ID_DANUBE2		0x12B
#define SOC_ID_TWINPASS		0x12D
J
John Crispin 已提交
20 21
#define SOC_ID_AMAZON_SE_1	0x152 /* 50601 */
#define SOC_ID_AMAZON_SE_2	0x153 /* 50600 */
22
#define SOC_ID_ARX188		0x16C
J
John Crispin 已提交
23 24
#define SOC_ID_ARX168_1		0x16D
#define SOC_ID_ARX168_2		0x16E
25
#define SOC_ID_ARX182		0x16F
J
John Crispin 已提交
26 27
#define SOC_ID_GRX188		0x170
#define SOC_ID_GRX168		0x171
28

J
John Crispin 已提交
29 30 31 32 33 34 35 36 37
#define SOC_ID_VRX288		0x1C0 /* v1.1 */
#define SOC_ID_VRX282		0x1C1 /* v1.1 */
#define SOC_ID_VRX268		0x1C2 /* v1.1 */
#define SOC_ID_GRX268		0x1C8 /* v1.1 */
#define SOC_ID_GRX288		0x1C9 /* v1.1 */
#define SOC_ID_VRX288_2		0x00B /* v1.2 */
#define SOC_ID_VRX268_2		0x00C /* v1.2 */
#define SOC_ID_GRX288_2		0x00D /* v1.2 */
#define SOC_ID_GRX282_2		0x00E /* v1.2 */
38
#define SOC_ID_VRX220		0x000
J
John Crispin 已提交
39

40 41 42 43 44 45 46 47 48 49
#define SOC_ID_ARX362		0x004
#define SOC_ID_ARX368		0x005
#define SOC_ID_ARX382		0x007
#define SOC_ID_ARX388		0x008
#define SOC_ID_URX388		0x009
#define SOC_ID_GRX383		0x010
#define SOC_ID_GRX369		0x011
#define SOC_ID_GRX387		0x00F
#define SOC_ID_GRX389		0x012

J
John Crispin 已提交
50
 /* SoC Types */
51 52 53
#define SOC_TYPE_DANUBE		0x01
#define SOC_TYPE_TWINPASS	0x02
#define SOC_TYPE_AR9		0x03
J
John Crispin 已提交
54 55 56
#define SOC_TYPE_VR9		0x04 /* v1.1 */
#define SOC_TYPE_VR9_2		0x05 /* v1.2 */
#define SOC_TYPE_AMAZON_SE	0x06
57 58
#define SOC_TYPE_AR10		0x07
#define SOC_TYPE_GRX390		0x08
59
#define SOC_TYPE_VRX220		0x09
60

J
John Crispin 已提交
61 62 63 64 65 66 67 68 69 70
/* BOOT_SEL - find what boot media we have */
#define BS_EXT_ROM		0x0
#define BS_FLASH		0x1
#define BS_MII0			0x2
#define BS_PCI			0x3
#define BS_UART1		0x4
#define BS_SPI			0x5
#define BS_NAND			0x6
#define BS_RMII0		0x7

71 72 73 74 75
/* helpers used to access the cgu */
#define ltq_cgu_w32(x, y)	ltq_w32((x), ltq_cgu_membase + (y))
#define ltq_cgu_r32(x)		ltq_r32(ltq_cgu_membase + (x))
extern __iomem void *ltq_cgu_membase;

T
Thomas Langer 已提交
76 77
/*
 * during early_printk no ioremap is possible
R
Ralf Baechle 已提交
78
 * let's use KSEG1 instead
T
Thomas Langer 已提交
79
 */
80
#define LTQ_ASC1_BASE_ADDR	0x1E100C00
T
Thomas Langer 已提交
81 82
#define LTQ_EARLY_ASC		KSEG1ADDR(LTQ_ASC1_BASE_ADDR)

83 84 85 86 87 88 89 90 91 92
/* EBU - external bus unit */
#define LTQ_EBU_BUSCON0		0x0060
#define LTQ_EBU_PCC_CON		0x0090
#define LTQ_EBU_PCC_IEN		0x00A4
#define LTQ_EBU_PCC_ISTAT	0x00A0
#define LTQ_EBU_BUSCON1		0x0064
#define LTQ_EBU_ADDRSEL1	0x0024
#define EBU_WRDIS		0x80000000

/* WDT */
93 94
#define LTQ_RST_CAUSE_WDTRST	0x20

95 96 97 98
/* MPS - multi processor unit (voice) */
#define LTQ_MPS_BASE_ADDR	(KSEG1 + 0x1F107000)
#define LTQ_MPS_CHIPID		((u32 *)(LTQ_MPS_BASE_ADDR + 0x0344))

99 100 101
/* allow booting xrx200 phys */
int xrx200_gphy_boot(struct device *dev, unsigned int id, dma_addr_t dev_addr);

102
/* request a non-gpio and set the PIO config */
103
#define PMU_PPE			 BIT(13)
104 105 106 107 108
extern void ltq_pmu_enable(unsigned int module);
extern void ltq_pmu_disable(unsigned int module);

#endif /* CONFIG_SOC_TYPE_XWAY */
#endif /* _LTQ_XWAY_H__ */