int
ar7240_mem_config(void)
{
#if !defined(CONFIG_WASP_EMU)
    unsigned int tap_val1, tap_val2;
    ar7240_ddr_initial_config(CFG_DDR_REFRESH_VAL);

    /* Default tap values for starting the tap_init*/
    if (!(is_ar7241() || is_ar7242()))  {
        ar7240_reg_wr (AR7240_DDR_TAP_CONTROL0, 0x8);
        ar7240_reg_wr (AR7240_DDR_TAP_CONTROL1, 0x9);
        ar7240_ddr_tap_init();
    }
    else {
        ar7240_reg_wr (AR7240_DDR_TAP_CONTROL0, 0x2);
        ar7240_reg_wr (AR7240_DDR_TAP_CONTROL1, 0x2);
        ar7240_reg_wr (AR7240_DDR_TAP_CONTROL2, 0x0);
        ar7240_reg_wr (AR7240_DDR_TAP_CONTROL3, 0x0);
    }

    tap_val1 = ar7240_reg_rd(0xb800001c);
    tap_val2 = ar7240_reg_rd(0xb8000020);

    printf("#### TAP VALUE 1 = 0x%x, 2 = 0x%x [0x%x: 0x%x]\n",
                tap_val1, tap_val2, *(unsigned *)0x80500000,
                *(unsigned *)0x80500004); 
    ar7240_usb_initial_config();
    ar7240_gpio_config();

#endif 
    return (ar7240_ddr_find_size());
}
int
ar7240_mem_config(void)
{
#ifndef COMPRESSED_UBOOT
    unsigned int tap_val1, tap_val2;
#endif
    ar7240_ddr_initial_config(CFG_DDR_REFRESH_VAL);

    /* Default tap values for starting the tap_init*/
    if (!(is_ar7241() || is_ar7242()))  {
        ar7240_reg_wr (AR7240_DDR_TAP_CONTROL0, 0x8);
        ar7240_reg_wr (AR7240_DDR_TAP_CONTROL1, 0x9);
#ifndef COMPRESSED_UBOOT
        ar7240_ddr_tap_init();
#endif
    }
    else {
        ar7240_reg_wr (AR7240_DDR_TAP_CONTROL0, 0x2);
        ar7240_reg_wr (AR7240_DDR_TAP_CONTROL1, 0x2);
        ar7240_reg_wr (AR7240_DDR_TAP_CONTROL2, 0x0);
        ar7240_reg_wr (AR7240_DDR_TAP_CONTROL3, 0x0);
    }

#ifndef COMPRESSED_UBOOT
    tap_val1 = ar7240_reg_rd(0xb800001c);
    tap_val2 = ar7240_reg_rd(0xb8000020);
    printf("#### TAP VALUE 1 = %x, 2 = %x\n",tap_val1, tap_val2);
#endif

    ar7240_usb_initial_config();
    ar7240_gpio_config();

    return (ar7240_ddr_find_size());
}
예제 #3
0
int
ar7240_mem_config(void)
{
    ar7240_ddr_initial_config(CFG_DDR_REFRESH_VAL);

    ar7240_reg_wr (AR7240_DDR_TAP_CONTROL0, 0x8);
    ar7240_reg_wr (AR7240_DDR_TAP_CONTROL1, 0x8);
    ar7240_reg_wr (AR7240_DDR_TAP_CONTROL2, 0x7);
    ar7240_reg_wr (AR7240_DDR_TAP_CONTROL3, 0x7);

    ar7240_usb_initial_config();
    ar7240_gpio_config();

    return (ar7240_ddr_find_size());
}
예제 #4
0
int
ar7240_mem_config(void)
{
    unsigned int tap_val1, tap_val2;
    ar7240_ddr_initial_config(CFG_DDR_REFRESH_VAL);

/* Default tap values for starting the tap_init*/
    ar7240_reg_wr (AR7240_DDR_TAP_CONTROL0, 0x8);
    ar7240_reg_wr (AR7240_DDR_TAP_CONTROL1, 0x9);

    ar7240_ddr_tap_init();

    tap_val1 = ar7240_reg_rd(0xb800001c);
    tap_val2 = ar7240_reg_rd(0xb8000020);
    printf("#### TAP VALUE 1 = %x, 2 = %x\n",tap_val1, tap_val2);

    ar7240_usb_initial_config();
    ar7240_gpio_config();

    return (ar7240_ddr_find_size());
}
int
ar7240_mem_config()
{
    uint32_t  ddr_config, ddr_config2;
    int i;
#if 0
    ar7240_ddr_width_t width;
#endif

    ar7240_ddr_initial_config(CFG_DDR_REFRESH_VAL);
#if 0
    ar7240_ddr_tap_config();
#else
    ar7240_reg_wr (AR7240_DDR_TAP_CONTROL0, 0x5);
    ar7240_reg_wr (AR7240_DDR_TAP_CONTROL1, 0x5);
    ar7240_reg_wr (AR7240_DDR_TAP_CONTROL2, 0x0);
    ar7240_reg_wr (AR7240_DDR_TAP_CONTROL3, 0x0);
#endif

#if 0
    ddr_config   = ar7240_reg_rd(AR7240_DDR_CONFIG);
    ddr_config2  = ar7240_reg_rd(AR7240_DDR_CONFIG2);
    width        = ar7240_ddr_get_width();

    if (width != AR7240_DDR_32B)
        ddr_config |= AR7240_DDR_CONFIG_16BIT;
    if (width == AR7240_DDR_16B_HIGH)
        ddr_config2 &= ~AR7240_DDR_CONFIG2_HALF_WIDTH_L;

    ddr_config2 &= ~((0x1f << AR7240_DDR_CONFIG2_TRTW_SHIFT) |
                     (0x1f << AR7240_DDR_CONFIG2_TWTR_SHIFT) |
                      0xf);

    ddr_config2 |= ((CFG_DDR_TRTW_VAL << AR7240_DDR_CONFIG2_TRTW_SHIFT) |
                    (CFG_DDR_TWTR_VAL << AR7240_DDR_CONFIG2_TWTR_SHIFT) |
                    AR7240_DDR_CONFIG2_BL2);
    /*
     * XXX These bits are reserved...
     */
    ddr_config2 |= (1 << 26)|(1 << 27)|(1 << 30);

    printf("programming config1 %#x, config2 %#x\n", ddr_config, ddr_config2);

    ar7240_reg_wr(AR7240_DDR_CONFIG, ddr_config);
    ar7240_reg_wr(AR7240_DDR_CONFIG2, ddr_config2);
#endif

    /* XXX - these don't really belong here!
    *(volatile unsigned int *)0xb8050004 = 0x00001032;
    udelay(100);
*/
#if 0
    *(volatile unsigned int *)0xb8050018 = 0x1313;
    udelay(10);

    *(volatile unsigned int *)0xb805001c = 0x00000909;
    udelay(100);

    *(volatile unsigned int *)0xb8050014 = 0x14000044;
    udelay(100);
#endif
#if 0
    i = *(volatile int *)0xb8050004;
    i = i & (~(1 << 25));
    *(volatile int *)0xb8050004 = i;
    while ((*(volatile int *)0xb8050004) & (1 << 17));

    i = *(volatile int *)0xb8050004;
    i = i & (~(1 << 16));
    *(volatile int *)0xb8050004 = i;
    while ((*(volatile int *)0xb8050004) & (1 << 17));

    i = *(volatile int *)0xb8050004;
    i = i | (0x3f << 19);
    *(volatile int *)0xb8050004 = i;
    udelay(100);

    *(volatile int *)0xb8050014 = 0x13000a44;
/*
    *(volatile int *)0xb8050014 = 0x13000044;
    *(volatile int *)0xb8050014 = 0x13111321;
    *(volatile int *)0xb8050014 = 0x00111321;
    *(volatile int *)0xb8050014 = 0x00001344;
    *(volatile int *)0xb8050014 = 0x14000044;
    *(volatile int *)0xb8050014 = 0x14000f44;
    *(volatile int *)0xb8050014 = 0x00001044;
    *(volatile int *)0xb8050014 = 0x14001044;
    *(volatile int *)0xb8050014 = 0x14001f44;
    *(volatile int *)0xb8050014 = 0x1f001044;
    *(volatile int *)0xb8050014 = 0x1f001f44;
*/

    *(volatile int *)0xb805001c = 0x00000909;
    udelay(100);

    i = *(volatile int *)0xb8050004;
    i = i & (~(0x3b << 19));
    *(volatile int *)0xb8050004 = i;
    udelay(100);

    i = *(volatile int *)0xb8050004;
    i = i | (0x3 << 20);
    *(volatile int *)0xb8050004 = i;
    udelay(100);

    i = *(volatile int *)0xb8050004;
    i = i & (~(0x3 << 20));
    *(volatile int *)0xb8050004 = i;
    udelay(100);

    /* Temp addition - check with Ravi */
    *(volatile unsigned int *)0xb8080008 = 0x00000040;
    udelay(100);
#endif
    ar7240_usb_initial_config();

    return (ar7240_ddr_find_size());
}