add cs select for dm9000 and move io set function to board-XXXX.c file
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-rk2818 / devices.c
index 60719ac16928af999ee885e9551e6bde6d3a5ca0..3e76ca5c11f10879b15963dc97044133f6631226 100755 (executable)
@@ -325,40 +325,32 @@ struct platform_device rk2818_soc_camera_pdrv = {
 //net device
 /* DM9000 */
 #ifdef CONFIG_DM9000
+#ifdef CONFIG_DM9000_CHIP_SELECT
+#define DM9000_CS CONFIG_DM9000_CHIP_SELECT
+#else
+#define DM9000_CS 1
+#endif
 static struct resource dm9k_resource[] = {
        [0] = {
-               .start = RK2818_NANDC_PHYS + 0x800 + (1*0x100 + 0x8),    //nand_cs1+nand_cmd
-               .end   = RK2818_NANDC_PHYS + 0x800 + (1*0x100 + 0x8) + 3,
+               .start = RK2818_NANDC_PHYS + 0x800 + (DM9000_CS*0x100 + 0x8),    //nand_cs1+nand_cmd
+               .end   = RK2818_NANDC_PHYS + 0x800 + (DM9000_CS*0x100 + 0x8) + 3,
                .flags = IORESOURCE_MEM,
        },
        [1] = {
-               .start = RK2818_NANDC_PHYS + 0x800 + (1*0x100 + 0x4),   //nand_cs1+nand_data
-               .end   = RK2818_NANDC_PHYS + 0x800 + (1*0x100 + 0x4) + 3,
+               .start = RK2818_NANDC_PHYS + 0x800 + (DM9000_CS*0x100 + 0x4),   //nand_cs1+nand_data
+               .end   = RK2818_NANDC_PHYS + 0x800 + (DM9000_CS*0x100 + 0x4) + 3,
                .flags = IORESOURCE_MEM,
        },
-       #ifdef CONFIG_MACH_RK2818MID
-       [2] = {
-               .start = RK2818_PIN_PE2,        //use pe2 as interrupt
-               .end   = RK2818_PIN_PE2,
-               .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
-       }
-       #else   
        [2] = {
-               .start = RK2818_PIN_PA1,        //use pa1 as interrupt
-               .end   = RK2818_PIN_PA1,
                .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
        }
-       #endif
-
 };
 
 /* for the moment we limit ourselves to 8bit IO until some
  * better IO routines can be written and tested
 */
 
-static struct dm9000_plat_data dm9k_platdata = {
-       .flags          = DM9000_PLATF_8BITONLY,
-};
+//dm9k_platdata.flags = DM9000_PLATF_8BITONLY;
 
 struct platform_device rk2818_device_dm9k = {
        .name           = "dm9000",