]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/mips/txx9/generic/setup_tx4938.c
[MIPS] TXx9: Make tx4938-specific code more independent
[linux-2.6-omap-h63xx.git] / arch / mips / txx9 / generic / setup_tx4938.c
index 317378d8579d39f19bf665440e1e7b36f71a6d61..1ceace45ef6a4aa3173290b1b7a93d1ab8fcbe3b 100644 (file)
@@ -21,7 +21,7 @@
 #include <asm/txx9/generic.h>
 #include <asm/txx9/tx4938.h>
 
-void __init tx4938_wdr_init(void)
+static void __init tx4938_wdr_init(void)
 {
        /* clear WatchDogReset (W1C) */
        tx4938_ccfg_set(TX4938_CCFG_WDRST);
@@ -29,6 +29,11 @@ void __init tx4938_wdr_init(void)
        tx4938_ccfg_set(TX4938_CCFG_WR);
 }
 
+void __init tx4938_wdt_init(void)
+{
+       txx9_wdt_init(TX4938_TMR_REG(2) & 0xfffffffffULL);
+}
+
 static struct resource tx4938_sdram_resource[4];
 static struct resource tx4938_sram_resource;
 
@@ -257,3 +262,19 @@ void __init tx4938_setup_serial(void)
        }
 #endif /* CONFIG_SERIAL_TXX9 */
 }
+
+void __init tx4938_spi_init(int busid)
+{
+       txx9_spi_init(busid, TX4938_SPI_REG & 0xfffffffffULL,
+                     TXX9_IRQ_BASE + TX4938_IR_SPI);
+}
+
+void __init tx4938_ethaddr_init(unsigned char *addr0, unsigned char *addr1)
+{
+       u64 pcfg = __raw_readq(&tx4938_ccfgptr->pcfg);
+
+       if (addr0 && (pcfg & TX4938_PCFG_ETH0_SEL))
+               txx9_ethaddr_init(TXX9_IRQ_BASE + TX4938_IR_ETH0, addr0);
+       if (addr1 && (pcfg & TX4938_PCFG_ETH1_SEL))
+               txx9_ethaddr_init(TXX9_IRQ_BASE + TX4938_IR_ETH1, addr1);
+}