aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/txx9/generic
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/txx9/generic')
-rw-r--r--arch/mips/txx9/generic/setup.c27
-rw-r--r--arch/mips/txx9/generic/setup_tx4938.c16
2 files changed, 43 insertions, 0 deletions
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c
index 7b5705d18deb..b136c6692a5f 100644
--- a/arch/mips/txx9/generic/setup.c
+++ b/arch/mips/txx9/generic/setup.c
@@ -220,6 +220,33 @@ void __init txx9_wdt_init(unsigned long base)
220 platform_device_register_simple("txx9wdt", -1, &res, 1); 220 platform_device_register_simple("txx9wdt", -1, &res, 1);
221} 221}
222 222
223/* SPI support */
224void __init txx9_spi_init(int busid, unsigned long base, int irq)
225{
226 struct resource res[] = {
227 {
228 .start = base,
229 .end = base + 0x20 - 1,
230 .flags = IORESOURCE_MEM,
231 }, {
232 .start = irq,
233 .flags = IORESOURCE_IRQ,
234 },
235 };
236 platform_device_register_simple("spi_txx9", busid,
237 res, ARRAY_SIZE(res));
238}
239
240void __init txx9_ethaddr_init(unsigned int id, unsigned char *ethaddr)
241{
242 struct platform_device *pdev =
243 platform_device_alloc("tc35815-mac", id);
244 if (!pdev ||
245 platform_device_add_data(pdev, ethaddr, 6) ||
246 platform_device_add(pdev))
247 platform_device_put(pdev);
248}
249
223/* wrappers */ 250/* wrappers */
224void __init plat_mem_setup(void) 251void __init plat_mem_setup(void)
225{ 252{
diff --git a/arch/mips/txx9/generic/setup_tx4938.c b/arch/mips/txx9/generic/setup_tx4938.c
index b0a3dc8863fd..1ceace45ef6a 100644
--- a/arch/mips/txx9/generic/setup_tx4938.c
+++ b/arch/mips/txx9/generic/setup_tx4938.c
@@ -262,3 +262,19 @@ void __init tx4938_setup_serial(void)
262 } 262 }
263#endif /* CONFIG_SERIAL_TXX9 */ 263#endif /* CONFIG_SERIAL_TXX9 */
264} 264}
265
266void __init tx4938_spi_init(int busid)
267{
268 txx9_spi_init(busid, TX4938_SPI_REG & 0xfffffffffULL,
269 TXX9_IRQ_BASE + TX4938_IR_SPI);
270}
271
272void __init tx4938_ethaddr_init(unsigned char *addr0, unsigned char *addr1)
273{
274 u64 pcfg = __raw_readq(&tx4938_ccfgptr->pcfg);
275
276 if (addr0 && (pcfg & TX4938_PCFG_ETH0_SEL))
277 txx9_ethaddr_init(TXX9_IRQ_BASE + TX4938_IR_ETH0, addr0);
278 if (addr1 && (pcfg & TX4938_PCFG_ETH1_SEL))
279 txx9_ethaddr_init(TXX9_IRQ_BASE + TX4938_IR_ETH1, addr1);
280}