]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - arch/arm/mach-davinci/board-da830-evm.c
davinci: cleanup mdio arch code and switch to phy_id
[net-next-2.6.git] / arch / arm / mach-davinci / board-da830-evm.c
index bc384d3561da8162a150a16adf9223c97e896d61..1bb89d3f9b1fb4062c5a95d2f2e43022b3be42bb 100644 (file)
 #include <mach/nand.h>
 #include <mach/da8xx.h>
 #include <mach/usb.h>
+#include <mach/aemif.h>
 
-#define DA830_EVM_PHY_MASK             0x0
-#define DA830_EVM_MDIO_FREQUENCY       2200000 /* PHY bus frequency */
-
+#define DA830_EVM_PHY_ID               ""
 /*
  * USB1 VBUS is controlled by GPIO1[15], over-current is reported on GPIO2[4].
  */
@@ -360,6 +359,16 @@ static struct nand_bbt_descr da830_evm_nand_bbt_mirror_descr = {
        .pattern        = da830_evm_nand_mirror_pattern
 };
 
+static struct davinci_aemif_timing da830_evm_nandflash_timing = {
+       .wsetup         = 24,
+       .wstrobe        = 21,
+       .whold          = 14,
+       .rsetup         = 19,
+       .rstrobe        = 50,
+       .rhold          = 0,
+       .ta             = 20,
+};
+
 static struct davinci_nand_pdata da830_evm_nand_pdata = {
        .parts          = da830_evm_nand_partitions,
        .nr_parts       = ARRAY_SIZE(da830_evm_nand_partitions),
@@ -368,6 +377,7 @@ static struct davinci_nand_pdata da830_evm_nand_pdata = {
        .options        = NAND_USE_FLASH_BBT,
        .bbt_td         = &da830_evm_nand_bbt_main_descr,
        .bbt_md         = &da830_evm_nand_bbt_mirror_descr,
+       .timing         = &da830_evm_nandflash_timing,
 };
 
 static struct resource da830_evm_nand_resources[] = {
@@ -494,12 +504,42 @@ static struct davinci_i2c_platform_data da830_evm_i2c_0_pdata = {
        .bus_delay      = 0,    /* usec */
 };
 
+/*
+ * The following EDMA channels/slots are not being used by drivers (for
+ * example: Timer, GPIO, UART events etc) on da830/omap-l137 EVM, hence
+ * they are being reserved for codecs on the DSP side.
+ */
+static const s16 da830_dma_rsv_chans[][2] = {
+       /* (offset, number) */
+       { 8,  2},
+       {12,  2},
+       {24,  4},
+       {30,  2},
+       {-1, -1}
+};
+
+static const s16 da830_dma_rsv_slots[][2] = {
+       /* (offset, number) */
+       { 8,  2},
+       {12,  2},
+       {24,  4},
+       {30, 26},
+       {-1, -1}
+};
+
+static struct edma_rsv_info da830_edma_rsv[] = {
+       {
+               .rsv_chans      = da830_dma_rsv_chans,
+               .rsv_slots      = da830_dma_rsv_slots,
+       },
+};
+
 static __init void da830_evm_init(void)
 {
        struct davinci_soc_info *soc_info = &davinci_soc_info;
        int ret;
 
-       ret = da8xx_register_edma();
+       ret = da830_register_edma(da830_edma_rsv);
        if (ret)
                pr_warning("da830_evm_init: edma registration failed: %d\n",
                                ret);
@@ -516,9 +556,8 @@ static __init void da830_evm_init(void)
 
        da830_evm_usb_init();
 
-       soc_info->emac_pdata->phy_mask = DA830_EVM_PHY_MASK;
-       soc_info->emac_pdata->mdio_max_freq = DA830_EVM_MDIO_FREQUENCY;
        soc_info->emac_pdata->rmii_en = 1;
+       soc_info->emac_pdata->phy_id = DA830_EVM_PHY_ID;
 
        ret = davinci_cfg_reg_list(da830_cpgmac_pins);
        if (ret)
@@ -556,6 +595,9 @@ static __init void da830_evm_init(void)
 #ifdef CONFIG_SERIAL_8250_CONSOLE
 static int __init da830_evm_console_init(void)
 {
+       if (!machine_is_davinci_da830_evm())
+               return 0;
+
        return add_preferred_console("ttyS", 2, "115200");
 }
 console_initcall(da830_evm_console_init);
@@ -566,7 +608,7 @@ static void __init da830_evm_map_io(void)
        da830_init();
 }
 
-MACHINE_START(DAVINCI_DA830_EVM, "DaVinci DA830/OMAP-L137 EVM")
+MACHINE_START(DAVINCI_DA830_EVM, "DaVinci DA830/OMAP-L137/AM17x EVM")
        .phys_io        = IO_PHYS,
        .io_pg_offst    = (__IO_ADDRESS(IO_PHYS) >> 18) & 0xfffc,
        .boot_params    = (DA8XX_DDR_BASE + 0x100),