aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPete Popov <ppopov@embeddedalley.com>2005-09-14 12:17:59 -0400
committerRalf Baechle <ralf@linux-mips.org>2005-10-29 14:32:20 -0400
commit64abf64d10b3a547becefeb26394dfbefac273fb (patch)
tree2960d858aa3490548385f77fbd460c6dc60e1e5b /arch
parent4f94afa258c3e574a8d985160e87146a5183944b (diff)
Misc au1200 updates.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/au1000/common/platform.c118
-rw-r--r--arch/mips/au1000/pb1200/board_setup.c74
2 files changed, 160 insertions, 32 deletions
diff --git a/arch/mips/au1000/common/platform.c b/arch/mips/au1000/common/platform.c
index 3ca3cb8a8a73..0c3fd726c3d6 100644
--- a/arch/mips/au1000/common/platform.c
+++ b/arch/mips/au1000/common/platform.c
@@ -14,6 +14,7 @@
14 14
15#include <asm/mach-au1x00/au1000.h> 15#include <asm/mach-au1x00/au1000.h>
16 16
17/* OHCI (USB full speed host controller) */
17static struct resource au1xxx_usb_ohci_resources[] = { 18static struct resource au1xxx_usb_ohci_resources[] = {
18 [0] = { 19 [0] = {
19 .start = USB_OHCI_BASE, 20 .start = USB_OHCI_BASE,
@@ -71,12 +72,129 @@ static struct platform_device au1100_lcd_device = {
71}; 72};
72#endif 73#endif
73 74
75#ifdef CONFIG_SOC_AU1200
76/* EHCI (USB high speed host controller) */
77static struct resource au1xxx_usb_ehci_resources[] = {
78 [0] = {
79 .start = USB_EHCI_BASE,
80 .end = USB_EHCI_BASE + USB_EHCI_LEN - 1,
81 .flags = IORESOURCE_MEM,
82 },
83 [1] = {
84 .start = AU1000_USB_HOST_INT,
85 .end = AU1000_USB_HOST_INT,
86 .flags = IORESOURCE_IRQ,
87 },
88};
89
90static u64 ehci_dmamask = ~(u32)0;
91
92static struct platform_device au1xxx_usb_ehci_device = {
93 .name = "au1xxx-ehci",
94 .id = 0,
95 .dev = {
96 .dma_mask = &ehci_dmamask,
97 .coherent_dma_mask = 0xffffffff,
98 },
99 .num_resources = ARRAY_SIZE(au1xxx_usb_ehci_resources),
100 .resource = au1xxx_usb_ehci_resources,
101};
102
103/* Au1200 UDC (USB gadget controller) */
104static struct resource au1xxx_usb_gdt_resources[] = {
105 [0] = {
106 .start = USB_UDC_BASE,
107 .end = USB_UDC_BASE + USB_UDC_LEN - 1,
108 .flags = IORESOURCE_MEM,
109 },
110 [1] = {
111 .start = AU1200_USB_INT,
112 .end = AU1200_USB_INT,
113 .flags = IORESOURCE_IRQ,
114 },
115};
116
117static u64 udc_dmamask = ~(u32)0;
118
119static struct platform_device au1xxx_usb_gdt_device = {
120 .name = "au1xxx-udc",
121 .id = 0,
122 .dev = {
123 .dma_mask = &udc_dmamask,
124 .coherent_dma_mask = 0xffffffff,
125 },
126 .num_resources = ARRAY_SIZE(au1xxx_usb_gdt_resources),
127 .resource = au1xxx_usb_gdt_resources,
128};
129
130/* Au1200 UOC (USB OTG controller) */
131static struct resource au1xxx_usb_otg_resources[] = {
132 [0] = {
133 .start = USB_UOC_BASE,
134 .end = USB_UOC_BASE + USB_UOC_LEN - 1,
135 .flags = IORESOURCE_MEM,
136 },
137 [1] = {
138 .start = AU1200_USB_INT,
139 .end = AU1200_USB_INT,
140 .flags = IORESOURCE_IRQ,
141 },
142};
143
144static u64 uoc_dmamask = ~(u32)0;
145
146static struct platform_device au1xxx_usb_otg_device = {
147 .name = "au1xxx-uoc",
148 .id = 0,
149 .dev = {
150 .dma_mask = &uoc_dmamask,
151 .coherent_dma_mask = 0xffffffff,
152 },
153 .num_resources = ARRAY_SIZE(au1xxx_usb_otg_resources),
154 .resource = au1xxx_usb_otg_resources,
155};
156
157/*** AU1200 LCD controller ***/
158static struct resource au1200_lcd_resources[] = {
159 [0] = {
160 .start = LCD_PHYS_ADDR,
161 .end = LCD_PHYS_ADDR + 0x800 - 1,
162 .flags = IORESOURCE_MEM,
163 },
164 [1] = {
165 .start = AU1200_LCD_INT,
166 .end = AU1200_LCD_INT,
167 .flags = IORESOURCE_IRQ,
168 }
169};
170
171static u64 au1200_lcd_dmamask = ~(u32)0;
172
173static struct platform_device au1200_lcd_device = {
174 .name = "au1200-lcd",
175 .id = 0,
176 .dev = {
177 .dma_mask = &au1200_lcd_dmamask,
178 .coherent_dma_mask = 0xffffffff,
179 },
180 .num_resources = ARRAY_SIZE(au1200_lcd_resources),
181 .resource = au1200_lcd_resources,
182};
183#endif
74 184
75static struct platform_device *au1xxx_platform_devices[] __initdata = { 185static struct platform_device *au1xxx_platform_devices[] __initdata = {
76 &au1xxx_usb_ohci_device, 186 &au1xxx_usb_ohci_device,
77#ifdef CONFIG_FB_AU1100 187#ifdef CONFIG_FB_AU1100
78 &au1100_lcd_device, 188 &au1100_lcd_device,
79#endif 189#endif
190#ifdef CONFIG_SOC_AU1200
191#if 0 /* fixme */
192 &au1xxx_usb_ehci_device,
193#endif
194 &au1xxx_usb_gdt_device,
195 &au1xxx_usb_otg_device,
196 &au1200_lcd_device,
197#endif
80}; 198};
81 199
82int au1xxx_platform_init(void) 200int au1xxx_platform_init(void)
diff --git a/arch/mips/au1000/pb1200/board_setup.c b/arch/mips/au1000/pb1200/board_setup.c
index 9c5d48dd7121..a45b17538ac9 100644
--- a/arch/mips/au1000/pb1200/board_setup.c
+++ b/arch/mips/au1000/pb1200/board_setup.c
@@ -58,22 +58,10 @@
58extern void _board_init_irq(void); 58extern void _board_init_irq(void);
59extern void (*board_init_irq)(void); 59extern void (*board_init_irq)(void);
60 60
61#ifdef CONFIG_BLK_DEV_IDE_AU1XXX
62extern u32 au1xxx_ide_virtbase;
63extern u64 au1xxx_ide_physbase;
64extern int au1xxx_ide_irq;
65
66u32 led_base_addr;
67/* Ddma */
68chan_tab_t *ide_read_ch, *ide_write_ch;
69u32 au1xxx_ide_ddma_enable = 0, switch4ddma = 1; // PIO+ddma
70
71dbdev_tab_t new_dbdev_tab_element = { DSCR_CMD0_THROTTLE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 };
72#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX */
73
74void board_reset (void) 61void board_reset (void)
75{ 62{
76 bcsr->resets = 0; 63 bcsr->resets = 0;
64 bcsr->system = 0;
77} 65}
78 66
79void __init board_setup(void) 67void __init board_setup(void)
@@ -94,7 +82,7 @@ void __init board_setup(void)
94 au_sync(); 82 au_sync();
95#endif 83#endif
96 84
97#if defined( CONFIG_I2C_ALGO_AU1550 ) 85#if defined(CONFIG_I2C_AU1550)
98 { 86 {
99 u32 freq0, clksrc; 87 u32 freq0, clksrc;
100 88
@@ -134,35 +122,24 @@ void __init board_setup(void)
134#ifdef CONFIG_FB_AU1200 122#ifdef CONFIG_FB_AU1200
135 argptr = prom_getcmdline(); 123 argptr = prom_getcmdline();
136#ifdef CONFIG_MIPS_PB1200 124#ifdef CONFIG_MIPS_PB1200
137 strcat(argptr, " video=au1200fb:panel:s11"); 125 strcat(argptr, " video=au1200fb:panel:bs");
138#endif 126#endif
139#ifdef CONFIG_MIPS_DB1200 127#ifdef CONFIG_MIPS_DB1200
140 strcat(argptr, " video=au1200fb:panel:s7"); 128 strcat(argptr, " video=au1200fb:panel:bs");
141#endif 129#endif
142#endif 130#endif
143 131
144#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
145 /*
146 * Iniz IDE parameters
147 */
148 au1xxx_ide_irq = PB1200_IDE_INT;
149 au1xxx_ide_physbase = AU1XXX_ATA_PHYS_ADDR;
150 au1xxx_ide_virtbase = KSEG1ADDR(AU1XXX_ATA_PHYS_ADDR);
151 /*
152 * change PIO or PIO+Ddma
153 * check the GPIO-5 pin condition. pb1200:s18_dot */
154 switch4ddma = (au_readl(SYS_PINSTATERD) & (1 << 5)) ? 1 : 0;
155#endif
156
157 /* The Pb1200 development board uses external MUX for PSC0 to 132 /* The Pb1200 development board uses external MUX for PSC0 to
158 support SMB/SPI. bcsr->resets bit 12: 0=SMB 1=SPI 133 support SMB/SPI. bcsr->resets bit 12: 0=SMB 1=SPI
159 */ 134 */
160#if defined(CONFIG_AU1550_PSC_SPI) && defined(CONFIG_I2C_ALGO_AU1550) 135#if defined(CONFIG_AU1XXX_PSC_SPI) && defined(CONFIG_I2C_AU1550)
161 #error I2C and SPI are mutually exclusive. Both are physically connected to PSC0.\ 136 #error I2C and SPI are mutually exclusive. Both are physically connected to PSC0.\
162 Refer to Pb1200/Db1200 documentation. 137 Refer to Pb1200/Db1200 documentation.
163#elif defined( CONFIG_AU1550_PSC_SPI ) 138#elif defined( CONFIG_AU1XXX_PSC_SPI )
164 bcsr->resets |= BCSR_RESETS_PCS0MUX; 139 bcsr->resets |= BCSR_RESETS_PCS0MUX;
165#elif defined( CONFIG_I2C_ALGO_AU1550 ) 140 /*Hard Coding Value to enable Temp Sensors [bit 14] Value for SOC Au1200. Pls refer documentation*/
141 bcsr->resets =0x900f;
142#elif defined( CONFIG_I2C_AU1550 )
166 bcsr->resets &= (~BCSR_RESETS_PCS0MUX); 143 bcsr->resets &= (~BCSR_RESETS_PCS0MUX);
167#endif 144#endif
168 au_sync(); 145 au_sync();
@@ -181,3 +158,36 @@ void __init board_setup(void)
181 board_init_irq = _board_init_irq; 158 board_init_irq = _board_init_irq;
182 } 159 }
183} 160}
161
162int
163board_au1200fb_panel (void)
164{
165 BCSR *bcsr = (BCSR *)BCSR_KSEG1_ADDR;
166 int p;
167
168 p = bcsr->switches;
169 p >>= 8;
170 p &= 0x0F;
171 return p;
172}
173
174int
175board_au1200fb_panel_init (void)
176{
177 /* Apply power */
178 BCSR *bcsr = (BCSR *)BCSR_KSEG1_ADDR;
179 bcsr->board |= (BCSR_BOARD_LCDVEE | BCSR_BOARD_LCDVDD | BCSR_BOARD_LCDBL);
180 /*printk("board_au1200fb_panel_init()\n"); */
181 return 0;
182}
183
184int
185board_au1200fb_panel_shutdown (void)
186{
187 /* Remove power */
188 BCSR *bcsr = (BCSR *)BCSR_KSEG1_ADDR;
189 bcsr->board &= ~(BCSR_BOARD_LCDVEE | BCSR_BOARD_LCDVDD | BCSR_BOARD_LCDBL);
190 /*printk("board_au1200fb_panel_shutdown()\n"); */
191 return 0;
192}
193