X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Finca-ip_sw.c;h=e4aaed6afbc6c1709987c5fbc3226cc0a5487525;hb=bd86220f58b99d6896198c385fda132f0c980915;hp=f8fe52ea26db9def4535bcce7eac9272b2b59598;hpb=79d696fc558b2bcdb8aa8dc6cd7e4ccd22008e21;p=oweals%2Fu-boot.git diff --git a/drivers/inca-ip_sw.c b/drivers/inca-ip_sw.c index f8fe52ea26..e4aaed6afb 100644 --- a/drivers/inca-ip_sw.c +++ b/drivers/inca-ip_sw.c @@ -26,8 +26,8 @@ #include -#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI) \ - && defined(CONFIG_INCA_IP_SWITCH) +#if defined(CONFIG_CMD_NET) \ + && defined(CONFIG_NET_MULTI) && defined(CONFIG_INCA_IP_SWITCH) #include #include @@ -41,13 +41,21 @@ #define DELAY udelay(10000) + /* Sometimes the store word instruction hangs while writing to one + * of the Switch registers. Moving the instruction into a separate + * function somehow makes the problem go away. + */ +static void SWORD(volatile u32 * reg, u32 value) +{ + *reg = value; +} #define DMA_WRITE_REG(reg, value) *((volatile u32 *)reg) = (u32)value; #define DMA_READ_REG(reg, value) value = (u32)*((volatile u32*)reg) #define SW_WRITE_REG(reg, value) \ - *((volatile u32*)reg) = (u32)value;\ + SWORD(reg, value);\ DELAY;\ - *((volatile u32*)reg) = (u32)value; + SWORD(reg, value); #define SW_READ_REG(reg, value) \ value = (u32)*((volatile u32*)reg);\