blob: e7bc5b8c7db8640d189f7328a51268b1de2fc47b [file] [log] [blame]
Ralf Baechle23fbee92005-07-25 22:45:45 +00001/*
Ralf Baechle23fbee92005-07-25 22:45:45 +00002 * Setup pointers to hardware-dependent routines.
3 * Copyright (C) 2000-2001 Toshiba Corporation
4 *
5 * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
6 * terms of the GNU General Public License version 2. This program is
7 * licensed "as is" without any warranty of any kind, whether express
8 * or implied.
9 *
10 * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
11 */
Ralf Baechle23fbee92005-07-25 22:45:45 +000012#include <linux/init.h>
13#include <linux/types.h>
14#include <linux/ioport.h>
Ralf Baechle23fbee92005-07-25 22:45:45 +000015#include <linux/delay.h>
Atsushi Nemoto57e386c2007-05-01 00:27:58 +090016#include <linux/platform_device.h>
Atsushi Nemoto4cad1542008-04-05 00:56:09 +090017#include <linux/gpio.h>
Atsushi Nemoto51f607c2008-08-19 22:55:11 +090018#include <linux/mtd/physmap.h>
Ralf Baechlefcdb27a2006-01-18 17:37:07 +000019
Ralf Baechle23fbee92005-07-25 22:45:45 +000020#include <asm/reboot.h>
Ralf Baechle23fbee92005-07-25 22:45:45 +000021#include <asm/io.h>
Atsushi Nemoto89d63fe2008-07-11 00:33:08 +090022#include <asm/txx9/generic.h>
23#include <asm/txx9/pci.h>
Atsushi Nemoto22b1d702008-07-11 00:31:36 +090024#include <asm/txx9/rbtx4938.h>
Atsushi Nemotof74cf6f2007-06-22 23:22:06 +090025#include <linux/spi/spi.h>
Atsushi Nemoto22b1d702008-07-11 00:31:36 +090026#include <asm/txx9/spi.h>
Atsushi Nemoto4cad1542008-04-05 00:56:09 +090027#include <asm/txx9pio.h>
Ralf Baechle23fbee92005-07-25 22:45:45 +000028
Atsushi Nemoto7b226092008-07-14 00:15:04 +090029static void rbtx4938_machine_restart(char *command)
Ralf Baechle23fbee92005-07-25 22:45:45 +000030{
31 local_irq_disable();
Atsushi Nemoto66140c82008-04-14 21:49:07 +090032 writeb(1, rbtx4938_softresetlock_addr);
33 writeb(1, rbtx4938_sfvol_addr);
34 writeb(1, rbtx4938_softreset_addr);
Atsushi Nemotoa49297e2008-07-24 00:25:17 +090035 /* fallback */
36 (*_machine_halt)();
Ralf Baechle23fbee92005-07-25 22:45:45 +000037}
38
Atsushi Nemoto89d63fe2008-07-11 00:33:08 +090039static void __init rbtx4938_pci_setup(void)
Ralf Baechle23fbee92005-07-25 22:45:45 +000040{
Ralf Baechle23fbee92005-07-25 22:45:45 +000041#ifdef CONFIG_PCI
Atsushi Nemoto89d63fe2008-07-11 00:33:08 +090042 int extarb = !(__raw_readq(&tx4938_ccfgptr->ccfg) & TX4938_CCFG_PCIARB);
43 struct pci_controller *c = &txx9_primary_pcic;
Ralf Baechle23fbee92005-07-25 22:45:45 +000044
Atsushi Nemoto89d63fe2008-07-11 00:33:08 +090045 register_pci_controller(c);
Ralf Baechle23fbee92005-07-25 22:45:45 +000046
Atsushi Nemoto89d63fe2008-07-11 00:33:08 +090047 if (__raw_readq(&tx4938_ccfgptr->ccfg) & TX4938_CCFG_PCI66)
48 txx9_pci_option =
49 (txx9_pci_option & ~TXX9_PCI_OPT_CLK_MASK) |
50 TXX9_PCI_OPT_CLK_66; /* already configured */
Ralf Baechle23fbee92005-07-25 22:45:45 +000051
52 /* Reset PCI Bus */
Atsushi Nemoto66140c82008-04-14 21:49:07 +090053 writeb(0, rbtx4938_pcireset_addr);
Ralf Baechle23fbee92005-07-25 22:45:45 +000054 /* Reset PCIC */
Atsushi Nemoto89d63fe2008-07-11 00:33:08 +090055 txx9_set64(&tx4938_ccfgptr->clkctr, TX4938_CLKCTR_PCIRST);
56 if ((txx9_pci_option & TXX9_PCI_OPT_CLK_MASK) ==
57 TXX9_PCI_OPT_CLK_66)
Ralf Baechle23fbee92005-07-25 22:45:45 +000058 tx4938_pciclk66_setup();
59 mdelay(10);
60 /* clear PCIC reset */
Atsushi Nemoto89d63fe2008-07-11 00:33:08 +090061 txx9_clear64(&tx4938_ccfgptr->clkctr, TX4938_CLKCTR_PCIRST);
Atsushi Nemoto66140c82008-04-14 21:49:07 +090062 writeb(1, rbtx4938_pcireset_addr);
Atsushi Nemoto89d63fe2008-07-11 00:33:08 +090063 iob();
Ralf Baechle23fbee92005-07-25 22:45:45 +000064
65 tx4938_report_pciclk();
Atsushi Nemoto89d63fe2008-07-11 00:33:08 +090066 tx4927_pcic_setup(tx4938_pcicptr, c, extarb);
67 if ((txx9_pci_option & TXX9_PCI_OPT_CLK_MASK) ==
68 TXX9_PCI_OPT_CLK_AUTO &&
69 txx9_pci66_check(c, 0, 0)) {
Ralf Baechle23fbee92005-07-25 22:45:45 +000070 /* Reset PCI Bus */
Atsushi Nemoto66140c82008-04-14 21:49:07 +090071 writeb(0, rbtx4938_pcireset_addr);
Ralf Baechle23fbee92005-07-25 22:45:45 +000072 /* Reset PCIC */
Atsushi Nemoto89d63fe2008-07-11 00:33:08 +090073 txx9_set64(&tx4938_ccfgptr->clkctr, TX4938_CLKCTR_PCIRST);
Ralf Baechle23fbee92005-07-25 22:45:45 +000074 tx4938_pciclk66_setup();
75 mdelay(10);
76 /* clear PCIC reset */
Atsushi Nemoto89d63fe2008-07-11 00:33:08 +090077 txx9_clear64(&tx4938_ccfgptr->clkctr, TX4938_CLKCTR_PCIRST);
Atsushi Nemoto66140c82008-04-14 21:49:07 +090078 writeb(1, rbtx4938_pcireset_addr);
Atsushi Nemoto89d63fe2008-07-11 00:33:08 +090079 iob();
Ralf Baechle23fbee92005-07-25 22:45:45 +000080 /* Reinitialize PCIC */
81 tx4938_report_pciclk();
Atsushi Nemoto89d63fe2008-07-11 00:33:08 +090082 tx4927_pcic_setup(tx4938_pcicptr, c, extarb);
Ralf Baechle23fbee92005-07-25 22:45:45 +000083 }
84
Atsushi Nemoto89d63fe2008-07-11 00:33:08 +090085 if (__raw_readq(&tx4938_ccfgptr->pcfg) &
86 (TX4938_PCFG_ETH0_SEL|TX4938_PCFG_ETH1_SEL)) {
87 /* Reset PCIC1 */
88 txx9_set64(&tx4938_ccfgptr->clkctr, TX4938_CLKCTR_PCIC1RST);
89 /* PCI1DMD==0 => PCI1CLK==GBUSCLK/2 => PCI66 */
90 if (!(__raw_readq(&tx4938_ccfgptr->ccfg)
91 & TX4938_CCFG_PCI1DMD))
92 tx4938_ccfg_set(TX4938_CCFG_PCI1_66);
93 mdelay(10);
94 /* clear PCIC1 reset */
95 txx9_clear64(&tx4938_ccfgptr->clkctr, TX4938_CLKCTR_PCIC1RST);
96 tx4938_report_pci1clk();
Ralf Baechle23fbee92005-07-25 22:45:45 +000097
Atsushi Nemoto89d63fe2008-07-11 00:33:08 +090098 /* mem:64K(max), io:64K(max) (enough for ETH0,ETH1) */
99 c = txx9_alloc_pci_controller(NULL, 0, 0x10000, 0, 0x10000);
100 register_pci_controller(c);
101 tx4927_pcic_setup(tx4938_pcic1ptr, c, 0);
102 }
Atsushi Nemoto455cc252008-07-25 23:01:35 +0900103 tx4938_setup_pcierr_irq();
Ralf Baechle23fbee92005-07-25 22:45:45 +0000104#endif /* CONFIG_PCI */
Atsushi Nemoto89d63fe2008-07-11 00:33:08 +0900105}
Ralf Baechle23fbee92005-07-25 22:45:45 +0000106
107/* SPI support */
108
109/* chip select for SPI devices */
110#define SEEPROM1_CS 7 /* PIO7 */
111#define SEEPROM2_CS 0 /* IOC */
112#define SEEPROM3_CS 1 /* IOC */
113#define SRTC_CS 2 /* IOC */
114
Atsushi Nemotof74cf6f2007-06-22 23:22:06 +0900115static int __init rbtx4938_ethaddr_init(void)
Ralf Baechle23fbee92005-07-25 22:45:45 +0000116{
Atsushi Nemotoedcaf1a2008-07-11 23:27:54 +0900117#ifdef CONFIG_PCI
Atsushi Nemoto2db30152007-07-02 22:43:06 +0900118 unsigned char dat[17];
Atsushi Nemotof74cf6f2007-06-22 23:22:06 +0900119 unsigned char sum;
120 int i;
121
122 /* 0-3: "MAC\0", 4-9:eth0, 10-15:eth1, 16:sum */
Atsushi Nemoto2db30152007-07-02 22:43:06 +0900123 if (spi_eeprom_read(SEEPROM1_CS, 0, dat, sizeof(dat))) {
Atsushi Nemotof74cf6f2007-06-22 23:22:06 +0900124 printk(KERN_ERR "seeprom: read error.\n");
Atsushi Nemoto2db30152007-07-02 22:43:06 +0900125 return -ENODEV;
126 } else {
Atsushi Nemotof74cf6f2007-06-22 23:22:06 +0900127 if (strcmp(dat, "MAC") != 0)
128 printk(KERN_WARNING "seeprom: bad signature.\n");
129 for (i = 0, sum = 0; i < sizeof(dat); i++)
130 sum += dat[i];
131 if (sum)
132 printk(KERN_WARNING "seeprom: bad checksum.\n");
Ralf Baechle23fbee92005-07-25 22:45:45 +0000133 }
Atsushi Nemotoc49f91f2008-07-24 00:25:20 +0900134 tx4938_ethaddr_init(&dat[4], &dat[4 + 6]);
Atsushi Nemotoedcaf1a2008-07-11 23:27:54 +0900135#endif /* CONFIG_PCI */
Ralf Baechle23fbee92005-07-25 22:45:45 +0000136 return 0;
137}
Ralf Baechle23fbee92005-07-25 22:45:45 +0000138
Ralf Baechle23fbee92005-07-25 22:45:45 +0000139static void __init rbtx4938_spi_setup(void)
140{
141 /* set SPI_SEL */
Atsushi Nemoto89d63fe2008-07-11 00:33:08 +0900142 txx9_set64(&tx4938_ccfgptr->pcfg, TX4938_PCFG_SPI_SEL);
Ralf Baechle23fbee92005-07-25 22:45:45 +0000143}
144
145static struct resource rbtx4938_fpga_resource;
Ralf Baechle23fbee92005-07-25 22:45:45 +0000146
Atsushi Nemotoedcaf1a2008-07-11 23:27:54 +0900147static void __init rbtx4938_time_init(void)
Ralf Baechle23fbee92005-07-25 22:45:45 +0000148{
Atsushi Nemoto94a4c322008-07-19 01:51:47 +0900149 tx4938_time_init(0);
Ralf Baechle23fbee92005-07-25 22:45:45 +0000150}
151
Atsushi Nemotoedcaf1a2008-07-11 23:27:54 +0900152static void __init rbtx4938_mem_setup(void)
Ralf Baechle23fbee92005-07-25 22:45:45 +0000153{
154 unsigned long long pcfg;
155 char *argptr;
156
Ralf Baechle23fbee92005-07-25 22:45:45 +0000157 if (txx9_master_clock == 0)
158 txx9_master_clock = 25000000; /* 25MHz */
Atsushi Nemoto94a4c322008-07-19 01:51:47 +0900159
160 tx4938_setup();
161
162#ifdef CONFIG_PCI
163 txx9_alloc_pci_controller(&txx9_primary_pcic, 0, 0, 0, 0);
Atsushi Nemoto07517522008-07-24 00:25:15 +0900164 txx9_board_pcibios_setup = tx4927_pcibios_setup;
Atsushi Nemoto94a4c322008-07-19 01:51:47 +0900165#else
Ralf Baechle23fbee92005-07-25 22:45:45 +0000166 set_io_port_base(RBTX4938_ETHER_BASE);
167#endif
168
Atsushi Nemoto7779a5e2008-07-25 23:08:06 +0900169 tx4938_sio_init(7372800, 0);
Ralf Baechle23fbee92005-07-25 22:45:45 +0000170#ifdef CONFIG_SERIAL_TXX9_CONSOLE
Atsushi Nemotobb72f1f2008-07-24 00:25:21 +0900171 argptr = prom_getcmdline();
172 if (!strstr(argptr, "console="))
173 strcat(argptr, " console=ttyS0,38400");
Ralf Baechle23fbee92005-07-25 22:45:45 +0000174#endif
Ralf Baechle23fbee92005-07-25 22:45:45 +0000175
176#ifdef CONFIG_TOSHIBA_RBTX4938_MPLEX_PIO58_61
Atsushi Nemotobb72f1f2008-07-24 00:25:21 +0900177 printk(KERN_INFO "PIOSEL: disabling both ata and nand selection\n");
Atsushi Nemoto89d63fe2008-07-11 00:33:08 +0900178 txx9_clear64(&tx4938_ccfgptr->pcfg,
179 TX4938_PCFG_NDF_SEL | TX4938_PCFG_ATA_SEL);
Ralf Baechle23fbee92005-07-25 22:45:45 +0000180#endif
181
182#ifdef CONFIG_TOSHIBA_RBTX4938_MPLEX_NAND
Atsushi Nemotobb72f1f2008-07-24 00:25:21 +0900183 printk(KERN_INFO "PIOSEL: enabling nand selection\n");
Atsushi Nemoto89d63fe2008-07-11 00:33:08 +0900184 txx9_set64(&tx4938_ccfgptr->pcfg, TX4938_PCFG_NDF_SEL);
185 txx9_clear64(&tx4938_ccfgptr->pcfg, TX4938_PCFG_ATA_SEL);
Ralf Baechle23fbee92005-07-25 22:45:45 +0000186#endif
187
188#ifdef CONFIG_TOSHIBA_RBTX4938_MPLEX_ATA
Atsushi Nemotobb72f1f2008-07-24 00:25:21 +0900189 printk(KERN_INFO "PIOSEL: enabling ata selection\n");
Atsushi Nemoto89d63fe2008-07-11 00:33:08 +0900190 txx9_set64(&tx4938_ccfgptr->pcfg, TX4938_PCFG_ATA_SEL);
191 txx9_clear64(&tx4938_ccfgptr->pcfg, TX4938_PCFG_NDF_SEL);
Ralf Baechle23fbee92005-07-25 22:45:45 +0000192#endif
193
Ralf Baechle23fbee92005-07-25 22:45:45 +0000194 rbtx4938_spi_setup();
Atsushi Nemoto89d63fe2008-07-11 00:33:08 +0900195 pcfg = ____raw_readq(&tx4938_ccfgptr->pcfg); /* updated */
Ralf Baechle23fbee92005-07-25 22:45:45 +0000196 /* fixup piosel */
197 if ((pcfg & (TX4938_PCFG_ATA_SEL | TX4938_PCFG_NDF_SEL)) ==
Atsushi Nemoto66140c82008-04-14 21:49:07 +0900198 TX4938_PCFG_ATA_SEL)
199 writeb((readb(rbtx4938_piosel_addr) & 0x03) | 0x04,
200 rbtx4938_piosel_addr);
Ralf Baechle23fbee92005-07-25 22:45:45 +0000201 else if ((pcfg & (TX4938_PCFG_ATA_SEL | TX4938_PCFG_NDF_SEL)) ==
Atsushi Nemoto66140c82008-04-14 21:49:07 +0900202 TX4938_PCFG_NDF_SEL)
203 writeb((readb(rbtx4938_piosel_addr) & 0x03) | 0x08,
204 rbtx4938_piosel_addr);
205 else
206 writeb(readb(rbtx4938_piosel_addr) & ~(0x08 | 0x04),
207 rbtx4938_piosel_addr);
Ralf Baechle23fbee92005-07-25 22:45:45 +0000208
209 rbtx4938_fpga_resource.name = "FPGA Registers";
210 rbtx4938_fpga_resource.start = CPHYSADDR(RBTX4938_FPGA_REG_ADDR);
211 rbtx4938_fpga_resource.end = CPHYSADDR(RBTX4938_FPGA_REG_ADDR) + 0xffff;
212 rbtx4938_fpga_resource.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
Atsushi Nemoto8d795f22008-07-18 00:43:48 +0900213 if (request_resource(&txx9_ce_res[2], &rbtx4938_fpga_resource))
Atsushi Nemotobb72f1f2008-07-24 00:25:21 +0900214 printk(KERN_ERR "request resource for fpga failed\n");
Ralf Baechle23fbee92005-07-25 22:45:45 +0000215
Ralf Baechle23fbee92005-07-25 22:45:45 +0000216 _machine_restart = rbtx4938_machine_restart;
Ralf Baechle23fbee92005-07-25 22:45:45 +0000217
Atsushi Nemoto66140c82008-04-14 21:49:07 +0900218 writeb(0xff, rbtx4938_led_addr);
219 printk(KERN_INFO "RBTX4938 --- FPGA(Rev %02x) DIPSW:%02x,%02x\n",
220 readb(rbtx4938_fpga_rev_addr),
221 readb(rbtx4938_dipsw_addr), readb(rbtx4938_bdipsw_addr));
Ralf Baechle23fbee92005-07-25 22:45:45 +0000222}
223
Atsushi Nemotobb72f1f2008-07-24 00:25:21 +0900224static void __init rbtx4938_ne_init(void)
Atsushi Nemoto57e386c2007-05-01 00:27:58 +0900225{
226 struct resource res[] = {
227 {
228 .start = RBTX4938_RTL_8019_BASE,
229 .end = RBTX4938_RTL_8019_BASE + 0x20 - 1,
230 .flags = IORESOURCE_IO,
231 }, {
232 .start = RBTX4938_RTL_8019_IRQ,
233 .flags = IORESOURCE_IRQ,
234 }
235 };
Atsushi Nemotobb72f1f2008-07-24 00:25:21 +0900236 platform_device_register_simple("ne", -1, res, ARRAY_SIZE(res));
Atsushi Nemoto57e386c2007-05-01 00:27:58 +0900237}
Atsushi Nemoto3896b052007-06-22 23:21:55 +0900238
Atsushi Nemoto3896b052007-06-22 23:21:55 +0900239static DEFINE_SPINLOCK(rbtx4938_spi_gpio_lock);
240
Atsushi Nemoto4cad1542008-04-05 00:56:09 +0900241static void rbtx4938_spi_gpio_set(struct gpio_chip *chip, unsigned int offset,
242 int value)
Atsushi Nemoto3896b052007-06-22 23:21:55 +0900243{
244 u8 val;
245 unsigned long flags;
Atsushi Nemoto3896b052007-06-22 23:21:55 +0900246 spin_lock_irqsave(&rbtx4938_spi_gpio_lock, flags);
Atsushi Nemoto66140c82008-04-14 21:49:07 +0900247 val = readb(rbtx4938_spics_addr);
Atsushi Nemoto3896b052007-06-22 23:21:55 +0900248 if (value)
Atsushi Nemoto4cad1542008-04-05 00:56:09 +0900249 val |= 1 << offset;
Atsushi Nemoto3896b052007-06-22 23:21:55 +0900250 else
Atsushi Nemoto4cad1542008-04-05 00:56:09 +0900251 val &= ~(1 << offset);
Atsushi Nemoto66140c82008-04-14 21:49:07 +0900252 writeb(val, rbtx4938_spics_addr);
Atsushi Nemoto3896b052007-06-22 23:21:55 +0900253 mmiowb();
254 spin_unlock_irqrestore(&rbtx4938_spi_gpio_lock, flags);
255}
256
Atsushi Nemoto4cad1542008-04-05 00:56:09 +0900257static int rbtx4938_spi_gpio_dir_out(struct gpio_chip *chip,
258 unsigned int offset, int value)
Atsushi Nemoto3896b052007-06-22 23:21:55 +0900259{
Atsushi Nemoto4cad1542008-04-05 00:56:09 +0900260 rbtx4938_spi_gpio_set(chip, offset, value);
Atsushi Nemoto3896b052007-06-22 23:21:55 +0900261 return 0;
262}
263
Atsushi Nemoto4cad1542008-04-05 00:56:09 +0900264static struct gpio_chip rbtx4938_spi_gpio_chip = {
265 .set = rbtx4938_spi_gpio_set,
266 .direction_output = rbtx4938_spi_gpio_dir_out,
267 .label = "RBTX4938-SPICS",
268 .base = 16,
269 .ngpio = 3,
270};
Atsushi Nemotof74cf6f2007-06-22 23:22:06 +0900271
Atsushi Nemotof74cf6f2007-06-22 23:22:06 +0900272static int __init rbtx4938_spi_init(void)
273{
274 struct spi_board_info srtc_info = {
Atsushi Nemoto9f90a032007-08-19 22:32:10 +0900275 .modalias = "rtc-rs5c348",
Atsushi Nemotof74cf6f2007-06-22 23:22:06 +0900276 .max_speed_hz = 1000000, /* 1.0Mbps @ Vdd 2.0V */
277 .bus_num = 0,
278 .chip_select = 16 + SRTC_CS,
279 /* Mode 1 (High-Active, Shift-Then-Sample), High Avtive CS */
280 .mode = SPI_MODE_1 | SPI_CS_HIGH,
281 };
282 spi_register_board_info(&srtc_info, 1);
283 spi_eeprom_register(SEEPROM1_CS);
284 spi_eeprom_register(16 + SEEPROM2_CS);
285 spi_eeprom_register(16 + SEEPROM3_CS);
Atsushi Nemoto4cad1542008-04-05 00:56:09 +0900286 gpio_request(16 + SRTC_CS, "rtc-rs5c348");
287 gpio_direction_output(16 + SRTC_CS, 0);
288 gpio_request(SEEPROM1_CS, "seeprom1");
289 gpio_direction_output(SEEPROM1_CS, 1);
290 gpio_request(16 + SEEPROM2_CS, "seeprom2");
291 gpio_direction_output(16 + SEEPROM2_CS, 1);
292 gpio_request(16 + SEEPROM3_CS, "seeprom3");
293 gpio_direction_output(16 + SEEPROM3_CS, 1);
Atsushi Nemotoc49f91f2008-07-24 00:25:20 +0900294 tx4938_spi_init(0);
Atsushi Nemotof74cf6f2007-06-22 23:22:06 +0900295 return 0;
296}
Atsushi Nemoto4cad1542008-04-05 00:56:09 +0900297
Atsushi Nemoto51f607c2008-08-19 22:55:11 +0900298static void __init rbtx4938_mtd_init(void)
299{
300 struct physmap_flash_data pdata = {
301 .width = 4,
302 };
303
304 switch (readb(rbtx4938_bdipsw_addr) & 7) {
305 case 0:
306 /* Boot */
307 txx9_physmap_flash_init(0, 0x1fc00000, 0x400000, &pdata);
308 /* System */
309 txx9_physmap_flash_init(1, 0x1e000000, 0x1000000, &pdata);
310 break;
311 case 1:
312 /* System */
313 txx9_physmap_flash_init(0, 0x1f000000, 0x1000000, &pdata);
314 /* Boot */
315 txx9_physmap_flash_init(1, 0x1ec00000, 0x400000, &pdata);
316 break;
317 case 2:
318 /* Ext */
319 txx9_physmap_flash_init(0, 0x1f000000, 0x1000000, &pdata);
320 /* System */
321 txx9_physmap_flash_init(1, 0x1e000000, 0x1000000, &pdata);
322 /* Boot */
323 txx9_physmap_flash_init(2, 0x1dc00000, 0x400000, &pdata);
324 break;
325 case 3:
326 /* Boot */
327 txx9_physmap_flash_init(1, 0x1bc00000, 0x400000, &pdata);
328 /* System */
329 txx9_physmap_flash_init(2, 0x1a000000, 0x1000000, &pdata);
330 break;
331 }
332}
333
Atsushi Nemotoedcaf1a2008-07-11 23:27:54 +0900334static void __init rbtx4938_arch_init(void)
Atsushi Nemoto4cad1542008-04-05 00:56:09 +0900335{
Atsushi Nemoto4cad1542008-04-05 00:56:09 +0900336 gpiochip_add(&rbtx4938_spi_gpio_chip);
Atsushi Nemoto89d63fe2008-07-11 00:33:08 +0900337 rbtx4938_pci_setup();
Atsushi Nemotoedcaf1a2008-07-11 23:27:54 +0900338 rbtx4938_spi_init();
Atsushi Nemoto4cad1542008-04-05 00:56:09 +0900339}
Atsushi Nemotof74cf6f2007-06-22 23:22:06 +0900340
Atsushi Nemotoedcaf1a2008-07-11 23:27:54 +0900341static void __init rbtx4938_device_init(void)
Atsushi Nemotof74cf6f2007-06-22 23:22:06 +0900342{
Atsushi Nemotoedcaf1a2008-07-11 23:27:54 +0900343 rbtx4938_ethaddr_init();
344 rbtx4938_ne_init();
Atsushi Nemoto68314722008-07-24 00:25:18 +0900345 tx4938_wdt_init();
Atsushi Nemoto51f607c2008-08-19 22:55:11 +0900346 rbtx4938_mtd_init();
Atsushi Nemotof74cf6f2007-06-22 23:22:06 +0900347}
Atsushi Nemotof74cf6f2007-06-22 23:22:06 +0900348
Atsushi Nemotoedcaf1a2008-07-11 23:27:54 +0900349struct txx9_board_vec rbtx4938_vec __initdata = {
Atsushi Nemotoedcaf1a2008-07-11 23:27:54 +0900350 .system = "Toshiba RBTX4938",
351 .prom_init = rbtx4938_prom_init,
352 .mem_setup = rbtx4938_mem_setup,
353 .irq_setup = rbtx4938_irq_setup,
354 .time_init = rbtx4938_time_init,
355 .device_init = rbtx4938_device_init,
356 .arch_init = rbtx4938_arch_init,
357#ifdef CONFIG_PCI
358 .pci_map_irq = rbtx4938_pci_map_irq,
359#endif
360};