From: Ash C. <ash...@gm...> - 2010-07-15 18:50:33
|
(in reference to a very old thread: http://old.nabble.com/Re:-Wifistix-CF-Boot-Problems-td11088675.html#a11088675) Hi, I've got some robots at school running Connex boards with a Wifistix attached and wanted to boot from the CF card. Below is a patch for U-boot-1.2.0 that does allow U-boot to access the second PCMCIA slot for boards such as the wifistix-CF. It is a dirty hack but it works well enough for me so I thought others might also find it useful. -Ash Index: u-boot-1.2.0/include/configs/gumstix.h =================================================================== --- u-boot-1.2.0.orig/include/configs/gumstix.h 2010-07-15 09:11:53.000000000 -0700 +++ u-boot-1.2.0/include/configs/gumstix.h 2010-07-15 09:15:25.000000000 -0700 @@ -156,17 +156,23 @@ #define GPIO4_nSTSCHG GPIO4_nBVD1 #define GPIO8_RESET 8 #define GPIO11_nPCD1 11 +#define GPIO18_nBVD2 18 +#define GPIO18_nSTSCHG GPIO18_nBVD2 #define GPIO22_nINPACK 22 -#define GPIO26_PRDY_nBSY0 26 -#define GPIO36_nBVD2 36 +#define GPIO26_PRDY_nBSY1 26 +#define GPIO27_PRDY_nBSY2 27 +#define GPIO36_nPCD2 36 -#define GPIO4_nBVD1_MD ( GPIO4_nBVD1| GPIO_IN ) +#define GPIO4_nBVD1_MD ( GPIO4_nBVD1 | GPIO_IN ) #define GPIO4_nSTSCHG_MD ( GPIO4_nSTSCHG | GPIO_IN ) #define GPIO8_RESET_MD ( GPIO8_RESET | GPIO_OUT ) #define GPIO11_nPCD1_MD ( GPIO11_nPCD1 | GPIO_IN ) +#define GPIO18_nBVD2_MD ( GPIO18_nBVD2 | GPIO_IN ) +#define GPIO18_nSTSCHG_MD ( GPIO18_nSTSCHG | GPIO_IN ) #define GPIO22_nINPACK_MD ( GPIO22_nINPACK | GPIO_IN ) -#define GPIO26_PRDY_nBSY0_MD ( GPIO26_PRDY_nBSY0 | GPIO_IN ) -#define GPIO36_nBVD2_MD ( GPIO36_nBVD2 | GPIO_IN ) +#define GPIO26_PRDY_nBSY1_MD ( GPIO26_PRDY_nBSY1 | GPIO_IN ) +#define GPIO27_PRDY_nBSY2_MD ( GPIO27_PRDY_nBSY2 | GPIO_IN ) +#define GPIO36_nPCD2_MD ( GPIO36_nPCD2 | GPIO_IN ) #define CONFIG_PXA_PCMCIA 1 #define CONFIG_PXA_IDE 1 @@ -181,7 +187,7 @@ #define CFG_PCMCIA_MEM_ADDR 0x2c000000 #define CFG_PCMCIA_MEM_SIZE 0x04000000 -#define CFG_MECR_VAL 0x00000002 +#define CFG_MECR_VAL 0x00000003 #define CFG_MCMEM0_VAL 0x0002449d #define CFG_MCMEM1_VAL 0x0002449d #define CFG_MCATT0_VAL 0x0002449d @@ -197,7 +203,7 @@ #define CFG_IDE_MAXDEVICE 1 /* max. 1 drive per IDE bus */ #define CFG_ATA_IDE0_OFFSET 0x0000 /* it's simple, all regs are in I/O space */ -#define CFG_ATA_BASE_ADDR CFG_PCMCIA_IO_ADDR +#define CFG_ATA_BASE_ADDR (CFG_PCMCIA_IO_ADDR + 0x10000000) /* Offset for data I/O */ #define CFG_ATA_DATA_OFFSET 0x1f0 /* Offset for normal register accesses */ Index: u-boot-1.2.0/drivers/pxa_pcmcia.c =================================================================== --- u-boot-1.2.0.orig/drivers/pxa_pcmcia.c 2010-07-15 09:12:03.000000000 -0700 +++ u-boot-1.2.0/drivers/pxa_pcmcia.c 2010-07-15 09:19:40.000000000 -0700 @@ -11,21 +11,7 @@ /* * The following are missing from pxa-regs.h */ -#define GPIO4_nBVD1 4 -#define GPIO4_nSTSCHG GPIO4_nBVD1 #define GPIO8_RESET 8 -#define GPIO11_nPCD1 11 -#define GPIO22_nINPACK 22 -#define GPIO26_PRDY_nBSY0 26 -#define GPIO36_nBVD2 36 - -#define GPIO4_nBVD1_MD ( GPIO4_nBVD1| GPIO_IN ) -#define GPIO4_nSTSCHG_MD ( GPIO4_nSTSCHG | GPIO_IN ) -#define GPIO8_RESET_MD ( GPIO8_RESET | GPIO_OUT ) -#define GPIO11_nPCD1_MD ( GPIO11_nPCD1 | GPIO_IN ) -#define GPIO22_nINPACK_MD ( GPIO22_nINPACK | GPIO_IN ) -#define GPIO26_PRDY_nBSY0_MD ( GPIO26_PRDY_nBSY0 | GPIO_IN ) -#define GPIO36_nBVD2_MD ( GPIO36_nBVD2 | GPIO_IN ) #endif @@ -75,8 +61,10 @@ #else set_GPIO_mode(GPIO11_nPCD1_MD); set_GPIO_mode(GPIO4_nBVD1_MD); - set_GPIO_mode(GPIO36_nBVD2_MD); - set_GPIO_mode(GPIO26_PRDY_nBSY0_MD); + set_GPIO_mode(GPIO36_nPCD2_MD); + set_GPIO_mode(GPIO18_nBVD2_MD); + set_GPIO_mode(GPIO26_PRDY_nBSY1_MD); + set_GPIO_mode(GPIO27_PRDY_nBSY2_MD); set_GPIO_mode(GPIO8_RESET_MD); GPSR(GPIO8_RESET) = GPIO_bit(GPIO8_RESET); udelay(50); @@ -177,7 +165,7 @@ #endif /* EXADRON 1 */ - rc = check_ide_device (0); /* use just slot 0 */ + rc = check_ide_device (1); /* use slot 1 for CF card on wifi-cf */ if(!rc) ide_init(); return rc; |