]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Merge branch 'u-boot-samsung/master' into 'u-boot-arm/master'
authorAlbert ARIBAUD <albert.u.boot@aribaud.net>
Mon, 8 Sep 2014 22:21:24 +0000 (00:21 +0200)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Mon, 8 Sep 2014 22:21:24 +0000 (00:21 +0200)
arch/arm/cpu/armv7/keystone/clock.c
arch/arm/cpu/armv7/keystone/psc.c
arch/arm/cpu/armv7/omap5/hw_data.c
arch/arm/cpu/armv7/omap5/sdram.c
arch/arm/include/asm/arch-keystone/emac_defs.h
board/ti/am335x/Kconfig
drivers/mtd/nand/davinci_nand.c
drivers/mtd/nand/omap_gpmc.c
drivers/net/keystone_net.c
include/configs/am335x_igep0033.h
include/configs/omap3_beagle.h

index 30d76a6603ee475b52a2684bee3ebcd16e6958bc..47fc89398d44123441ade21d9bf017e7621bd4d6 100644 (file)
@@ -174,7 +174,7 @@ void init_pll(const struct pll_init_data *data)
                 * bypass disabled
                 */
                bwadj = pllm >> 1;
-               tmp |= ((bwadj & PLL_BWADJ_LO_SHIFT) << PLL_BWADJ_LO_SHIFT) |
+               tmp |= ((bwadj & PLL_BWADJ_LO_MASK) << PLL_BWADJ_LO_SHIFT) |
                        (pllm << PLL_MULT_SHIFT) |
                        (plld & PLL_DIV_MASK) |
                        (pllod << PLL_CLKOD_SHIFT);
index fa5422f2e8ba57fa49fba21c0329a43349092608..237e776e8790422dca0baad62732dd0b121bf8b3 100644 (file)
@@ -13,9 +13,6 @@
 #include <asm/processor.h>
 #include <asm/arch/psc_defs.h>
 
-#define DEVICE_REG32_R(addr)                   __raw_readl((u32 *)(addr))
-#define DEVICE_REG32_W(addr, val)              __raw_writel(val, (u32 *)(addr))
-
 int psc_delay(void)
 {
        udelay(10);
@@ -51,7 +48,7 @@ int psc_wait(u32 domain_num)
        retry = 0;
 
        do {
-               ptstat = DEVICE_REG32_R(KS2_PSC_BASE + PSC_REG_PSTAT);
+               ptstat = __raw_readl(KS2_PSC_BASE + PSC_REG_PSTAT);
                ptstat = ptstat & (1 << domain_num);
        } while ((ptstat != 0) && ((retry += psc_delay()) <
                 PSC_PTSTAT_TIMEOUT_LIMIT));
@@ -67,8 +64,7 @@ u32 psc_get_domain_num(u32 mod_num)
        u32 domain_num;
 
        /* Get the power domain associated with the module number */
-       domain_num = DEVICE_REG32_R(KS2_PSC_BASE +
-                                   PSC_REG_MDCFG(mod_num));
+       domain_num = __raw_readl(KS2_PSC_BASE + PSC_REG_MDCFG(mod_num));
        domain_num = PSC_REG_MDCFG_GET_PD(domain_num);
 
        return domain_num;
@@ -102,7 +98,7 @@ int psc_set_state(u32 mod_num, u32 state)
         * Get the power domain associated with the module number, and reset
         * isolation functionality
         */
-       v = DEVICE_REG32_R(KS2_PSC_BASE + PSC_REG_MDCFG(mod_num));
+       v = __raw_readl(KS2_PSC_BASE + PSC_REG_MDCFG(mod_num));
        domain_num = PSC_REG_MDCFG_GET_PD(v);
        reset_iso  = PSC_REG_MDCFG_GET_RESET_ISO(v);
 
@@ -119,24 +115,22 @@ int psc_set_state(u32 mod_num, u32 state)
         * change is made if the new state is power down.
         */
        if (state == PSC_REG_VAL_MDCTL_NEXT_ON) {
-               pdctl = DEVICE_REG32_R(KS2_PSC_BASE +
-                                      PSC_REG_PDCTL(domain_num));
+               pdctl = __raw_readl(KS2_PSC_BASE + PSC_REG_PDCTL(domain_num));
                pdctl = PSC_REG_PDCTL_SET_NEXT(pdctl,
                                               PSC_REG_VAL_PDCTL_NEXT_ON);
-               DEVICE_REG32_W(KS2_PSC_BASE + PSC_REG_PDCTL(domain_num),
-                              pdctl);
+               __raw_writel(pdctl, KS2_PSC_BASE + PSC_REG_PDCTL(domain_num));
        }
 
        /* Set the next state for the module to enabled/disabled */
-       mdctl = DEVICE_REG32_R(KS2_PSC_BASE + PSC_REG_MDCTL(mod_num));
+       mdctl = __raw_readl(KS2_PSC_BASE + PSC_REG_MDCTL(mod_num));
        mdctl = PSC_REG_MDCTL_SET_NEXT(mdctl, state);
        mdctl = PSC_REG_MDCTL_SET_RESET_ISO(mdctl, reset_iso);
-       DEVICE_REG32_W(KS2_PSC_BASE + PSC_REG_MDCTL(mod_num), mdctl);
+       __raw_writel(mdctl, KS2_PSC_BASE + PSC_REG_MDCTL(mod_num));
 
        /* Trigger the enable */
-       ptcmd = DEVICE_REG32_R(KS2_PSC_BASE + PSC_REG_PTCMD);
+       ptcmd = __raw_readl(KS2_PSC_BASE + PSC_REG_PTCMD);
        ptcmd |= (u32)(1<<domain_num);
-       DEVICE_REG32_W(KS2_PSC_BASE + PSC_REG_PTCMD, ptcmd);
+       __raw_writel(ptcmd, KS2_PSC_BASE + PSC_REG_PTCMD);
 
        /* Wait on the complete */
        return psc_wait(domain_num);
@@ -157,7 +151,7 @@ int psc_enable_module(u32 mod_num)
        u32 mdctl;
 
        /* Set the bit to apply reset */
-       mdctl = DEVICE_REG32_R(KS2_PSC_BASE + PSC_REG_MDCTL(mod_num));
+       mdctl = __raw_readl(KS2_PSC_BASE + PSC_REG_MDCTL(mod_num));
        if ((mdctl & 0x3f) == PSC_REG_VAL_MDSTAT_STATE_ON)
                return 0;
 
@@ -176,11 +170,11 @@ int psc_disable_module(u32 mod_num)
        u32 mdctl;
 
        /* Set the bit to apply reset */
-       mdctl = DEVICE_REG32_R(KS2_PSC_BASE + PSC_REG_MDCTL(mod_num));
+       mdctl = __raw_readl(KS2_PSC_BASE + PSC_REG_MDCTL(mod_num));
        if ((mdctl & 0x3f) == 0)
                return 0;
        mdctl = PSC_REG_MDCTL_SET_LRSTZ(mdctl, 0);
-       DEVICE_REG32_W(KS2_PSC_BASE + PSC_REG_MDCTL(mod_num), mdctl);
+       __raw_writel(mdctl, KS2_PSC_BASE + PSC_REG_MDCTL(mod_num));
 
        return psc_set_state(mod_num, PSC_REG_VAL_MDCTL_NEXT_SWRSTDISABLE);
 }
@@ -199,11 +193,11 @@ int psc_set_reset_iso(u32 mod_num)
        u32 mdctl;
 
        /* Set the reset isolation bit */
-       mdctl = DEVICE_REG32_R(KS2_PSC_BASE + PSC_REG_MDCTL(mod_num));
+       mdctl = __raw_readl(KS2_PSC_BASE + PSC_REG_MDCTL(mod_num));
        mdctl = PSC_REG_MDCTL_SET_RESET_ISO(mdctl, 1);
-       DEVICE_REG32_W(KS2_PSC_BASE + PSC_REG_MDCTL(mod_num), mdctl);
+       __raw_writel(mdctl, KS2_PSC_BASE + PSC_REG_MDCTL(mod_num));
 
-       v = DEVICE_REG32_R(KS2_PSC_BASE + PSC_REG_MDCFG(mod_num));
+       v = __raw_readl(KS2_PSC_BASE + PSC_REG_MDCFG(mod_num));
        if (PSC_REG_MDCFG_GET_RESET_ISO(v) == 1)
                return 0;
 
@@ -220,14 +214,14 @@ int psc_disable_domain(u32 domain_num)
        u32 pdctl;
        u32 ptcmd;
 
-       pdctl = DEVICE_REG32_R(KS2_PSC_BASE + PSC_REG_PDCTL(domain_num));
+       pdctl = __raw_readl(KS2_PSC_BASE + PSC_REG_PDCTL(domain_num));
        pdctl = PSC_REG_PDCTL_SET_NEXT(pdctl, PSC_REG_VAL_PDCTL_NEXT_OFF);
        pdctl = PSC_REG_PDCTL_SET_PDMODE(pdctl, PSC_REG_VAL_PDCTL_PDMODE_SLEEP);
-       DEVICE_REG32_W(KS2_PSC_BASE + PSC_REG_PDCTL(domain_num), pdctl);
+       __raw_writel(pdctl, KS2_PSC_BASE + PSC_REG_PDCTL(domain_num));
 
-       ptcmd = DEVICE_REG32_R(KS2_PSC_BASE + PSC_REG_PTCMD);
+       ptcmd = __raw_readl(KS2_PSC_BASE + PSC_REG_PTCMD);
        ptcmd |= (u32)(1 << domain_num);
-       DEVICE_REG32_W(KS2_PSC_BASE + PSC_REG_PTCMD, ptcmd);
+       __raw_writel(ptcmd, KS2_PSC_BASE + PSC_REG_PTCMD);
 
        return psc_wait(domain_num);
 }
index ed89f85458dd86a6b9f06cbf7a1369ddeedfa4cd..025738302a2878a6bdd59476d67338a532ee2b5c 100644 (file)
@@ -227,6 +227,16 @@ static const struct dpll_params usb_dpll_params_1920mhz[NUM_SYS_CLKS] = {
        {400, 15, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1},       /* 38.4 MHz */
 };
 
+static const struct dpll_params ddr_dpll_params_2664mhz[NUM_SYS_CLKS] = {
+       {111, 0, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1},          /* 12 MHz   */
+       {333, 4, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1},          /* 20 MHz   */
+       {555, 6, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1},          /* 16.8 MHz */
+       {555, 7, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1},          /* 19.2 MHz */
+       {666, 12, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1},         /* 26 MHz   */
+       {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},       /* 27 MHz   */
+       {555, 15, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1},         /* 38.4 MHz */
+};
+
 static const struct dpll_params ddr_dpll_params_2128mhz[NUM_SYS_CLKS] = {
        {266, 2, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1},          /* 12 MHz   */
        {266, 4, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1},          /* 20 MHz   */
@@ -286,6 +296,17 @@ struct dplls dra7xx_dplls = {
        .gmac = gmac_dpll_params_2000mhz,
 };
 
+struct dplls dra72x_dplls = {
+       .mpu = mpu_dpll_params_1ghz,
+       .core = core_dpll_params_2128mhz_dra7xx,
+       .per = per_dpll_params_768mhz_dra7xx,
+       .abe = abe_dpll_params_sysclk2_361267khz,
+       .iva = iva_dpll_params_2330mhz_dra7xx,
+       .usb = usb_dpll_params_1920mhz,
+       .ddr =  ddr_dpll_params_2664mhz,
+       .gmac = gmac_dpll_params_2000mhz,
+};
+
 struct pmic_data palmas = {
        .base_offset = PALMAS_SMPS_BASE_VOLT_UV,
        .step = 10000, /* 10 mV represented in uV */
@@ -560,6 +581,18 @@ const struct ctrl_ioregs ioregs_dra7xx_es1 = {
        .ctrl_ddr_ctrl_ext_0 = 0xA2000000,
 };
 
+const struct ctrl_ioregs ioregs_dra72x_es1 = {
+       .ctrl_ddrch = 0x40404040,
+       .ctrl_lpddr2ch = 0x40404040,
+       .ctrl_ddr3ch = 0x60606080,
+       .ctrl_ddrio_0 = 0xA2084210,
+       .ctrl_ddrio_1 = 0x84210840,
+       .ctrl_ddrio_2 = 0x84210000,
+       .ctrl_emif_sdram_config_ext = 0x0001C1A7,
+       .ctrl_emif_sdram_config_ext_final = 0x0001C1A7,
+       .ctrl_ddr_ctrl_ext_0 = 0xA2000000,
+};
+
 void hw_data_init(void)
 {
        u32 omap_rev = omap_revision();
@@ -592,7 +625,7 @@ void hw_data_init(void)
 
        case DRA722_ES1_0:
        *prcm = &dra7xx_prcm;
-       *dplls_data = &dra7xx_dplls;
+       *dplls_data = &dra72x_dplls;
        *omap_vcores = &dra722_volts;
        *ctrl = &dra7xx_ctrl;
        break;
@@ -619,9 +652,11 @@ void get_ioregs(const struct ctrl_ioregs **regs)
                break;
        case DRA752_ES1_0:
        case DRA752_ES1_1:
-       case DRA722_ES1_0:
                *regs = &ioregs_dra7xx_es1;
                break;
+       case DRA722_ES1_0:
+               *regs = &ioregs_dra72x_es1;
+               break;
 
        default:
                printf("\n INVALID OMAP REVISION ");
index 9105121ff60a04347c4bfd3b271ad625c0e10e1c..065199be7671db9276e044906fc270b0038c4075 100644 (file)
@@ -185,6 +185,30 @@ const struct emif_regs emif_2_regs_ddr3_532_mhz_1cs_dra_es1 = {
        .emif_rd_wr_exec_thresh         = 0x00000305
 };
 
+const struct emif_regs emif_1_regs_ddr3_666_mhz_1cs_dra_es1 = {
+       .sdram_config_init              = 0x61851AB2,
+       .sdram_config                   = 0x61851AB2,
+       .sdram_config2                  = 0x08000000,
+       .ref_ctrl                       = 0x00001035,
+       .sdram_tim1                     = 0xCCCF36B3,
+       .sdram_tim2                     = 0x308F7FDA,
+       .sdram_tim3                     = 0x027F88A8,
+       .read_idle_ctrl                 = 0x00050000,
+       .zq_config                      = 0x0007190B,
+       .temp_alert_config              = 0x00000000,
+       .emif_ddr_phy_ctlr_1_init       = 0x0024400A,
+       .emif_ddr_phy_ctlr_1            = 0x0024400A,
+       .emif_ddr_ext_phy_ctrl_1        = 0x10040100,
+       .emif_ddr_ext_phy_ctrl_2        = 0x00A400A4,
+       .emif_ddr_ext_phy_ctrl_3        = 0x00A900A9,
+       .emif_ddr_ext_phy_ctrl_4        = 0x00B000B0,
+       .emif_ddr_ext_phy_ctrl_5        = 0x00B000B0,
+       .emif_rd_wr_lvl_rmp_win         = 0x00000000,
+       .emif_rd_wr_lvl_rmp_ctl         = 0x00000000,
+       .emif_rd_wr_lvl_ctl             = 0x00000000,
+       .emif_rd_wr_exec_thresh         = 0x00000305
+};
+
 const struct dmm_lisa_map_regs lisa_map_4G_x_2_x_2 = {
        .dmm_lisa_map_0 = 0x0,
        .dmm_lisa_map_1 = 0x0,
@@ -267,6 +291,8 @@ static void emif_get_reg_dump_sdp(u32 emif_nr, const struct emif_regs **regs)
                }
                break;
        case DRA722_ES1_0:
+               *regs = &emif_1_regs_ddr3_666_mhz_1cs_dra_es1;
+               break;
        default:
                *regs = &emif_1_regs_ddr3_532_mhz_1cs_dra_es1;
        }
@@ -450,6 +476,35 @@ dra_ddr3_ext_phy_ctrl_const_base_es1_emif2[] = {
        0x0
 };
 
+const u32
+dra_ddr3_ext_phy_ctrl_const_base_666MHz[] = {
+       0x00A400A4,
+       0x00390039,
+       0x00320032,
+       0x00320032,
+       0x00320032,
+       0x00440044,
+       0x00550055,
+       0x00550055,
+       0x00550055,
+       0x00550055,
+       0x007F007F,
+       0x004D004D,
+       0x00430043,
+       0x00560056,
+       0x00540054,
+       0x00600060,
+       0x0,
+       0x00600020,
+       0x40010080,
+       0x08102040,
+       0x0,
+       0x0,
+       0x0,
+       0x0,
+       0x0
+};
+
 const struct lpddr2_mr_regs mr_regs = {
        .mr1    = MR1_BL_8_BT_SEQ_WRAP_EN_NWR_8,
        .mr2    = 0x6,
@@ -478,7 +533,6 @@ static void emif_get_ext_phy_ctrl_const_regs(u32 emif_nr,
                break;
        case DRA752_ES1_0:
        case DRA752_ES1_1:
-       case DRA722_ES1_0:
                if (emif_nr == 1) {
                        *regs = dra_ddr3_ext_phy_ctrl_const_base_es1_emif1;
                        *size =
@@ -489,6 +543,10 @@ static void emif_get_ext_phy_ctrl_const_regs(u32 emif_nr,
                        ARRAY_SIZE(dra_ddr3_ext_phy_ctrl_const_base_es1_emif2);
                }
                break;
+       case DRA722_ES1_0:
+               *regs = dra_ddr3_ext_phy_ctrl_const_base_666MHz;
+               *size = ARRAY_SIZE(dra_ddr3_ext_phy_ctrl_const_base_666MHz);
+               break;
        default:
                *regs = ddr3_ext_phy_ctrl_const_base_es2;
                *size = ARRAY_SIZE(ddr3_ext_phy_ctrl_const_base_es2);
index 0aa2f89d780bba74b8e941ef10a1f1e79f58a67d..9cd8925819922a08de3b915ac5b3e7399c9c6523 100644 (file)
@@ -13,9 +13,6 @@
 #include <asm/arch/hardware.h>
 #include <asm/io.h>
 
-#define DEVICE_REG32_R(a)               readl(a)
-#define DEVICE_REG32_W(a, v)            writel(v, a)
-
 #define EMAC_EMACSL_BASE_ADDR           (KS2_PASS_BASE + 0x00090900)
 #define EMAC_MDIO_BASE_ADDR             (KS2_PASS_BASE + 0x00090300)
 #define EMAC_SGMII_BASE_ADDR            (KS2_PASS_BASE + 0x00090100)
@@ -182,8 +179,8 @@ struct mac_sl_cfg {
 #endif
 
 #define hw_config_streaming_switch() \
-       DEVICE_REG32_W(DEVICE_PSTREAM_CFG_REG_ADDR, \
-                      DEVICE_PSTREAM_CFG_REG_VAL_ROUTE_CPPI);
+       writel(DEVICE_PSTREAM_CFG_REG_VAL_ROUTE_CPPI,\
+              DEVICE_PSTREAM_CFG_REG_ADDR);
 
 /* EMAC MDIO Registers Structure */
 struct mdio_regs {
index 0e5149c69c63ef0c36712d7a384423505d4b80a2..80701f5b989e1568cb665425be280f2fdea33ff4 100644 (file)
@@ -22,6 +22,7 @@ config SYS_CONFIG_NAME
 
 config CONS_INDEX
        int "UART used for console"
+       range 1 6
        default 1
        help
          The AM335x SoC has a total of 6 UARTs (UART0 to UART5 as referenced
index a079b1e5cffc54a2044c5602e66f8f2538c29487..02a1130af938c753168de0ff48ec0e13f98aa696 100644 (file)
@@ -306,8 +306,8 @@ static struct nand_ecclayout nand_davinci_4bit_layout_oobfirst = {
 };
 
 #if defined CONFIG_KEYSTONE_RBL_NAND
-#if defined(CONFIG_SYS_NAND_PAGE_2K)
 static struct nand_ecclayout nand_keystone_rbl_4bit_layout_oobfirst = {
+#if defined(CONFIG_SYS_NAND_PAGE_2K)
        .eccbytes = 40,
        .eccpos = {
                6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
index 1acf06b237c354df2c98e37869751a57cd6ce752..db1599e9a641402e811c9e6172e35909098a0769 100644 (file)
 static u8  bch8_polynomial[] = {0xef, 0x51, 0x2e, 0x09, 0xed, 0x93, 0x9a, 0xc2,
                                0x97, 0x79, 0xe5, 0x24, 0xb5};
 #endif
-static uint8_t cs;
+static uint8_t cs_next;
 static __maybe_unused struct nand_ecclayout omap_ecclayout;
 
+/*
+ * Driver configurations
+ */
+struct omap_nand_info {
+       struct bch_control *control;
+       enum omap_ecc ecc_scheme;
+       int cs;
+};
+
+/* We are wasting a bit of memory but al least we are safe */
+static struct omap_nand_info omap_nand_info[GPMC_MAX_CS];
+
 /*
  * omap_nand_hwcontrol - Set the address pointers corretly for the
  *                     following address/data/command operation
@@ -38,6 +50,8 @@ static void omap_nand_hwcontrol(struct mtd_info *mtd, int32_t cmd,
                                uint32_t ctrl)
 {
        register struct nand_chip *this = mtd->priv;
+       struct omap_nand_info *info = this->priv;
+       int cs = info->cs;
 
        /*
         * Point the IO_ADDR to DATA and ADDRESS registers instead
@@ -147,24 +161,6 @@ static int __maybe_unused omap_correct_data(struct mtd_info *mtd, uint8_t *dat,
        return 0;
 }
 
-/*
- * Driver configurations
- */
-struct omap_nand_info {
-       struct bch_control *control;
-       enum omap_ecc ecc_scheme;
-};
-
-/*
- * This can be a single instance cause all current users have only one NAND
- * with nearly the same setup (BCH8, some with ELM and others with sw BCH
- * library).
- * When some users with other BCH strength will exists this have to change!
- */
-static __maybe_unused struct omap_nand_info omap_nand_info = {
-       .control = NULL
-};
-
 /*
  * omap_reverse_list - re-orders list elements in reverse order [internal]
  * @list:      pointer to start of list
@@ -198,6 +194,7 @@ static void omap_enable_hwecc(struct mtd_info *mtd, int32_t mode)
        unsigned int eccsize1 = 0x00, eccsize0 = 0x00, bch_wrapmode = 0x00;
        u32 ecc_size_config_val = 0;
        u32 ecc_config_val = 0;
+       int cs = info->cs;
 
        /* configure GPMC for specific ecc-scheme */
        switch (info->ecc_scheme) {
@@ -478,11 +475,11 @@ static int omap_read_page_bch(struct mtd_info *mtd, struct nand_chip *chip,
                                oob += eccbytes) {
                chip->ecc.hwctl(mtd, NAND_ECC_READ);
                /* read data */
-               chip->cmdfunc(mtd, NAND_CMD_RNDOUT, data_pos, page);
+               chip->cmdfunc(mtd, NAND_CMD_RNDOUT, data_pos, -1);
                chip->read_buf(mtd, p, eccsize);
 
                /* read respective ecc from oob area */
-               chip->cmdfunc(mtd, NAND_CMD_RNDOUT, oob_pos, page);
+               chip->cmdfunc(mtd, NAND_CMD_RNDOUT, oob_pos, -1);
                chip->read_buf(mtd, oob, eccbytes);
                /* read syndrome */
                chip->ecc.calculate(mtd, p, &ecc_calc[i]);
@@ -826,7 +823,7 @@ int __maybe_unused omap_nand_switch_ecc(uint32_t hardware, uint32_t eccstrength)
 int board_nand_init(struct nand_chip *nand)
 {
        int32_t gpmc_config = 0;
-       cs = 0;
+       int cs = cs_next++;
        int err = 0;
        /*
         * xloader/Uboot's gpmc configuration would have configured GPMC for
@@ -856,7 +853,9 @@ int board_nand_init(struct nand_chip *nand)
 
        nand->IO_ADDR_R = (void __iomem *)&gpmc_cfg->cs[cs].nand_dat;
        nand->IO_ADDR_W = (void __iomem *)&gpmc_cfg->cs[cs].nand_cmd;
-       nand->priv      = &omap_nand_info;
+       omap_nand_info[cs].control = NULL;
+       omap_nand_info[cs].cs = cs;
+       nand->priv      = &omap_nand_info[cs];
        nand->cmd_ctrl  = omap_nand_hwcontrol;
        nand->options   |= NAND_NO_PADDING | NAND_CACHEPRG;
        nand->chip_delay = 100;
@@ -890,6 +889,5 @@ int board_nand_init(struct nand_chip *nand)
                nand->read_buf = nand_read_buf;
        nand->dev_ready = omap_spl_dev_ready;
 #endif
-
        return 0;
 }
index f95c9280765d05a5c418c33a0b8a25d68393488f..d22b722bc53de033f162171eee3da22b766a1db7 100644 (file)
@@ -290,13 +290,12 @@ int mac_sl_reset(u32 port)
                return GMACSL_RET_INVALID_PORT;
 
        /* Set the soft reset bit */
-       DEVICE_REG32_W(DEVICE_EMACSL_BASE(port) +
-                      CPGMACSL_REG_RESET, CPGMAC_REG_RESET_VAL_RESET);
+       writel(CPGMAC_REG_RESET_VAL_RESET,
+              DEVICE_EMACSL_BASE(port) + CPGMACSL_REG_RESET);
 
        /* Wait for the bit to clear */
        for (i = 0; i < DEVICE_EMACSL_RESET_POLL_COUNT; i++) {
-               v = DEVICE_REG32_R(DEVICE_EMACSL_BASE(port) +
-                                  CPGMACSL_REG_RESET);
+               v = readl(DEVICE_EMACSL_BASE(port) + CPGMACSL_REG_RESET);
                if ((v & CPGMAC_REG_RESET_VAL_RESET_MASK) !=
                    CPGMAC_REG_RESET_VAL_RESET)
                        return GMACSL_RET_OK;
@@ -321,8 +320,7 @@ int mac_sl_config(u_int16_t port, struct mac_sl_cfg *cfg)
 
        /* Must wait if the device is undergoing reset */
        for (i = 0; i < DEVICE_EMACSL_RESET_POLL_COUNT; i++) {
-               v = DEVICE_REG32_R(DEVICE_EMACSL_BASE(port) +
-                                  CPGMACSL_REG_RESET);
+               v = readl(DEVICE_EMACSL_BASE(port) + CPGMACSL_REG_RESET);
                if ((v & CPGMAC_REG_RESET_VAL_RESET_MASK) !=
                    CPGMAC_REG_RESET_VAL_RESET)
                        break;
@@ -331,11 +329,8 @@ int mac_sl_config(u_int16_t port, struct mac_sl_cfg *cfg)
        if (i == DEVICE_EMACSL_RESET_POLL_COUNT)
                return GMACSL_RET_CONFIG_FAIL_RESET_ACTIVE;
 
-       DEVICE_REG32_W(DEVICE_EMACSL_BASE(port) + CPGMACSL_REG_MAXLEN,
-                      cfg->max_rx_len);
-
-       DEVICE_REG32_W(DEVICE_EMACSL_BASE(port) + CPGMACSL_REG_CTL,
-                      cfg->ctl);
+       writel(cfg->max_rx_len, DEVICE_EMACSL_BASE(port) + CPGMACSL_REG_MAXLEN);
+       writel(cfg->ctl, DEVICE_EMACSL_BASE(port) + CPGMACSL_REG_CTL);
 
        return ret;
 }
@@ -345,24 +340,24 @@ int ethss_config(u32 ctl, u32 max_pkt_size)
        u32 i;
 
        /* Max length register */
-       DEVICE_REG32_W(DEVICE_CPSW_BASE + CPSW_REG_MAXLEN, max_pkt_size);
+       writel(max_pkt_size, DEVICE_CPSW_BASE + CPSW_REG_MAXLEN);
 
        /* Control register */
-       DEVICE_REG32_W(DEVICE_CPSW_BASE + CPSW_REG_CTL, ctl);
+       writel(ctl, DEVICE_CPSW_BASE + CPSW_REG_CTL);
 
        /* All statistics enabled by default */
-       DEVICE_REG32_W(DEVICE_CPSW_BASE + CPSW_REG_STAT_PORT_EN,
-                      CPSW_REG_VAL_STAT_ENABLE_ALL);
+       writel(CPSW_REG_VAL_STAT_ENABLE_ALL,
+              DEVICE_CPSW_BASE + CPSW_REG_STAT_PORT_EN);
 
        /* Reset and enable the ALE */
-       DEVICE_REG32_W(DEVICE_CPSW_BASE + CPSW_REG_ALE_CONTROL,
-                      CPSW_REG_VAL_ALE_CTL_RESET_AND_ENABLE |
-                      CPSW_REG_VAL_ALE_CTL_BYPASS);
+       writel(CPSW_REG_VAL_ALE_CTL_RESET_AND_ENABLE |
+              CPSW_REG_VAL_ALE_CTL_BYPASS,
+              DEVICE_CPSW_BASE + CPSW_REG_ALE_CONTROL);
 
        /* All ports put into forward mode */
        for (i = 0; i < DEVICE_CPSW_NUM_PORTS; i++)
-               DEVICE_REG32_W(DEVICE_CPSW_BASE + CPSW_REG_ALE_PORTCTL(i),
-                              CPSW_REG_VAL_PORTCTL_FORWARD_MODE);
+               writel(CPSW_REG_VAL_PORTCTL_FORWARD_MODE,
+                      DEVICE_CPSW_BASE + CPSW_REG_ALE_PORTCTL(i));
 
        return 0;
 }
index dcded0acbe047e2033a0e9679ab8be5b9185e62a..a14310a8edcbe1ea8715c44dd2f110d8f4b67ebe 100644 (file)
 #ifndef __CONFIG_IGEP0033_H
 #define __CONFIG_IGEP0033_H
 
-#define CONFIG_AM33XX
-#define CONFIG_OMAP
-#define CONFIG_OMAP_COMMON
-
-#include <asm/arch/omap.h>
+#define CONFIG_NAND
+#include <configs/ti_am335x_common.h>
 
 /* Mach type */
 #define MACH_TYPE_IGEP0033             4521    /* Until the next sync */
 #define V_SCLK                         (V_OSCK)
 
 #define CONFIG_ENV_SIZE                        (128 << 10)     /* 128 KiB */
-#define CONFIG_SYS_MALLOC_LEN          (1024 << 10)
-#define CONFIG_SYS_LONGHELP            /* undef to save memory */
-#define CONFIG_SYS_HUSH_PARSER         /* use "hush" command parser */
-#define CONFIG_SYS_PROMPT              "U-Boot# "
-#define CONFIG_SYS_NO_FLASH
-
-/* Display cpuinfo */
-#define CONFIG_DISPLAY_CPUINFO
-
-/* Flattened Device Tree */
-#define CONFIG_OF_LIBFDT
-
-/* Commands to include */
-#include <config_cmd_default.h>
-
-#define CONFIG_CMD_ASKENV
-#define CONFIG_CMD_BOOTZ
-#define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ECHO
-#define CONFIG_CMD_EXT4
-#define CONFIG_CMD_FAT
-#define CONFIG_CMD_FS_GENERIC
-#define CONFIG_CMD_MMC
-#define CONFIG_CMD_MTDPARTS
-#define CONFIG_CMD_NAND
-#define CONFIG_CMD_NET
-#define CONFIG_CMD_PING
-#define CONFIG_CMD_UBI
-#define CONFIG_CMD_UBIFS
 
 /* Make the verbose messages from UBI stop printing */
 #define CONFIG_UBI_SILENCE_MSG
 #define CONFIG_UBIFS_SILENCE_MSG
 
-#define CONFIG_BOOTDELAY               1       /* negative for no autoboot */
-#define CONFIG_ENV_VARS_UBOOT_CONFIG
 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+
+#ifndef CONFIG_SPL_BUILD
 #define CONFIG_EXTRA_ENV_SETTINGS \
-       "loadaddr=0x80F80000\0" \
-       "dtbaddr=0x80200000\0" \
+       DEFAULT_LINUX_BOOT_ENV \
        "bootdir=/boot\0" \
        "bootfile=zImage\0" \
        "dtbfile=am335x-base0033.dtb\0" \
        "console=ttyO0,115200n8\0" \
-       "mtdids=" MTDIDS_DEFAULT "\0" \
-       "mtdparts=" MTDPARTS_DEFAULT "\0" \
        "mmcdev=0\0" \
        "mmcroot=/dev/mmcblk0p2 rw\0" \
-       "ubiroot=ubi0:filesystem rw ubi.mtd=3,2048\0" \
        "mmcrootfstype=ext4 rootwait\0" \
-       "ubirootfstype=ubifs rootwait\0" \
        "mmcargs=setenv bootargs console=${console} " \
+               "${optargs} " \
                "root=${mmcroot} " \
                "rootfstype=${mmcrootfstype}\0" \
-       "ubiargs=setenv bootargs console=${console} " \
-               "root=${ubiroot} " \
-               "rootfstype=${ubirootfstype}\0" \
-       "bootenv=uEnv.txt\0" \
+               "bootenv=uEnv.txt\0" \
        "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
        "importbootenv=echo Importing environment from mmc ...; " \
                "env import -t ${loadaddr} ${filesize}\0" \
        "mmcload=load mmc ${mmcdev}:2 ${loadaddr} ${bootdir}/${bootfile}; " \
-               "load mmc ${mmcdev}:2 ${dtbaddr} ${bootdir}/${dtbfile}\0" \
-       "ubiload=ubi part filesystem 2048; ubifsmount ubi0; " \
+               "load mmc ${mmcdev}:2 ${fdtaddr} ${bootdir}/${dtbfile}\0" \
+       "mmcboot=mmc dev ${mmcdev}; " \
+               "if mmc rescan; then " \
+                       "echo SD/MMC found on device ${mmcdev};" \
+                       "if run loadbootenv; then " \
+                               "echo Loaded environment from ${bootenv};" \
+                               "run importbootenv;" \
+                       "fi;" \
+                       "if test -n $uenvcmd; then " \
+                               "echo Running uenvcmd ...;" \
+                               "run uenvcmd;" \
+                       "fi;" \
+                       "if run mmcload; then " \
+                               "run mmcargs; " \
+                               "bootz ${loadaddr} - ${fdtaddr};" \
+                       "fi;" \
+               "fi;\0" \
+       "mtdids=" MTDIDS_DEFAULT "\0" \
+       "mtdparts=" MTDPARTS_DEFAULT "\0" \
+       "nandroot=ubi0:filesystem rw ubi.mtd=3,2048\0" \
+       "nandrootfstype=ubifs rootwait\0" \
+       "nandload=ubi part filesystem 2048; ubifsmount ubi0; " \
                "ubifsload ${loadaddr} ${bootdir}/${bootfile}; " \
-               "ubifsload ${dtbaddr} ${bootdir}/${dtbfile} \0" \
-       "mmcboot=echo Booting from mmc ...; " \
-               "run mmcargs; " \
-               "bootz ${loadaddr} - ${dtbaddr}\0" \
-       "ubiboot=echo Booting from nand (ubifs) ...; " \
-               "run ubiargs; run ubiload; " \
-               "bootz ${loadaddr} - ${dtbaddr}\0" \
+               "ubifsload ${fdtaddr} ${bootdir}/${dtbfile} \0" \
+       "nandargs=setenv bootargs console=${console} " \
+               "${optargs} " \
+               "root=${nandroot} " \
+               "rootfstype=${nandrootfstype} \0" \
+       "nandboot=echo Booting from nand ...; " \
+               "run nandargs; " \
+               "run nandload; " \
+               "bootz ${loadaddr} - ${fdtaddr} \0"
+#endif
 
 #define CONFIG_BOOTCOMMAND \
-       "mmc dev ${mmcdev}; if mmc rescan; then " \
-               "echo SD/MMC found on device ${mmcdev};" \
-               "if run loadbootenv; then " \
-                       "echo Loaded environment from ${bootenv};" \
-                       "run importbootenv;" \
-               "fi;" \
-               "if test -n $uenvcmd; then " \
-                       "echo Running uenvcmd ...;" \
-                       "run uenvcmd;" \
-               "fi;" \
-               "if run mmcload; then " \
-                       "run mmcboot;" \
-               "fi;" \
-       "else " \
-               "run ubiboot;" \
-       "fi;" \
-
-/* Max number of command args */
-#define CONFIG_SYS_MAXARGS             16
-
-/* Console I/O Buffer Size */
-#define CONFIG_SYS_CBSIZE              512
-
-/* Print Buffer Size */
-#define CONFIG_SYS_PBSIZE              (CONFIG_SYS_CBSIZE \
-                                       + sizeof(CONFIG_SYS_PROMPT) + 16)
-
-/* Boot Argument Buffer Size */
-#define CONFIG_SYS_BARGSIZE            CONFIG_SYS_CBSIZE
-#define CONFIG_SYS_LOAD_ADDR           0x81000000 /* Default load address */
-
-/* Physical Memory Map */
-#define CONFIG_NR_DRAM_BANKS           1               /*  1 bank of DRAM */
-#define CONFIG_MAX_RAM_BANK_SIZE       (1024 << 20)    /* 1GB */
-
-#define CONFIG_SYS_SDRAM_BASE          0x80000000
-#define CONFIG_SYS_INIT_SP_ADDR         (NON_SECURE_SRAM_END - \
-                                               GENERATED_GBL_DATA_SIZE)
-/* Platform/Board specific defs */
-#define CONFIG_SYS_TIMERBASE           0x48040000      /* Use Timer2 */
-#define CONFIG_SYS_PTV                 2       /* Divisor: 2^(PTV+1) => 8 */
+       "run mmcboot;" \
+       "run nandboot;"
 
 /* NS16550 Configuration */
-#define CONFIG_SYS_NS16550
-#define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE    (-4)
-#define CONFIG_SYS_NS16550_CLK         (48000000)
 #define CONFIG_SYS_NS16550_COM1                0x44e09000      /* UART0 */
-
 #define CONFIG_CONS_INDEX              1
 #define CONFIG_BAUDRATE                        115200
 
-/* CPU */
-#define CONFIG_ARCH_CPU_INIT
-
-#define CONFIG_ENV_OVERWRITE           1
-#define CONFIG_SYS_CONSOLE_INFO_QUIET
-
-/* MMC support */
-#define CONFIG_MMC
-#define CONFIG_GENERIC_MMC
-#define CONFIG_OMAP_HSMMC
-#define CONFIG_DOS_PARTITION
-
-/* GPIO support */
-#define CONFIG_OMAP_GPIO
-
 /* Ethernet support */
-#define CONFIG_DRIVER_TI_CPSW
-#define CONFIG_MII
-#define CONFIG_BOOTP_DNS
-#define CONFIG_BOOTP_DNS2
-#define CONFIG_BOOTP_SEND_HOSTNAME
-#define CONFIG_BOOTP_GATEWAY
-#define CONFIG_BOOTP_SUBNETMASK
-#define CONFIG_NET_RETRY_COUNT         10
-#define CONFIG_NET_MULTI
 #define CONFIG_PHYLIB
 #define CONFIG_PHY_SMSC
 
 /* NAND support */
-#define CONFIG_NAND
-#define CONFIG_NAND_OMAP_GPMC
 #define CONFIG_NAND_OMAP_ELM
-#define CONFIG_SYS_NAND_BASE           (0x08000000)    /* phys address CS0 */
-#define CONFIG_SYS_MAX_NAND_DEVICE     1
 #define CONFIG_SYS_NAND_ONFI_DETECTION 1
 #define CONFIG_SYS_ENV_SECT_SIZE       (128 << 10)     /* 128 KiB */
 #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
 /* Unsupported features */
 #undef CONFIG_USE_IRQ
 
-/* Defines for SPL */
-#define CONFIG_SPL_FRAMEWORK
-/*
- * Place the image at the start of the ROM defined image space.
- * We limit our size to the ROM-defined downloaded image area, and use the
- * rest of the space for stack.
- */
-#define CONFIG_SPL_TEXT_BASE           0x402F0400
-#define CONFIG_SPL_MAX_SIZE            (0x4030C000 - CONFIG_SPL_TEXT_BASE)
-#define CONFIG_SPL_STACK               CONFIG_SYS_INIT_SP_ADDR
-
-#define CONFIG_SPL_BSS_START_ADDR      0x80000000
-#define CONFIG_SPL_BSS_MAX_SIZE                0x80000         /* 512 KB */
-
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR        0x300 /* address 0x60000 */
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     0x200 /* 256 KB */
-#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION   1
-#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME       "u-boot.img"
-#define CONFIG_SPL_MMC_SUPPORT
-#define CONFIG_SPL_FAT_SUPPORT
-#define CONFIG_SPL_LIBCOMMON_SUPPORT
-#define CONFIG_SPL_LIBDISK_SUPPORT
-#define CONFIG_SPL_LIBGENERIC_SUPPORT
-#define CONFIG_SPL_SERIAL_SUPPORT
-#define CONFIG_SPL_GPIO_SUPPORT
+/* SPL */
+#undef CONFIG_SPL_OS_BOOT      /* Not supported by existing map */
 #define CONFIG_SPL_YMODEM_SUPPORT
 #define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/am33xx/u-boot-spl.lds"
 
-#define CONFIG_SPL_BOARD_INIT
-#define CONFIG_SPL_NAND_AM33XX_BCH
-#define CONFIG_SPL_NAND_SUPPORT
-#define CONFIG_SPL_NAND_BASE
-#define CONFIG_SPL_NAND_DRIVERS
-#define CONFIG_SPL_NAND_ECC
 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
 #define CONFIG_SYS_NAND_PAGE_COUNT     (CONFIG_SYS_NAND_BLOCK_SIZE / \
                                         CONFIG_SYS_NAND_PAGE_SIZE)
 
 #define CONFIG_SYS_NAND_U_BOOT_OFFS    0x80000
 
-/*
- * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
- * 64 bytes before this address should be set aside for u-boot.img's
- * header. That is 0x800FFFC0--0x80100000 should not be used for any
- * other needs.
- */
-#define CONFIG_SYS_TEXT_BASE           0x80800000
-#define CONFIG_SYS_SPL_MALLOC_START    0x80208000
-#define CONFIG_SYS_SPL_MALLOC_SIZE     0x100000
-
-/*
- * Since SPL did pll and ddr initialization for us,
- * we don't need to do it twice.
- */
-#ifndef CONFIG_SPL_BUILD
-#define CONFIG_SKIP_LOWLEVEL_INIT
-#endif
-
 #endif /* ! __CONFIG_IGEP0033_H */
index 644e97f4c4f6e075eb2f338b7aa2d765812234de..f25a9407891eae894be347611656c5dd9d23bb27 100644 (file)
                "rootfstype=${ramrootfstype}\0" \
        "loadramdisk=load mmc ${bootpart} ${rdaddr} ${bootdir}/${ramdisk}\0" \
        "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
+       "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
+       "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \
+               "source ${loadaddr}\0" \
        "loadfdt=run validatefdt; load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
        "mmcboot=echo Booting from mmc ...; " \
                "run mmcargs; " \
                        "echo Running uenvcmd ...;" \
                        "run uenvcmd;" \
                "fi;" \
-               "if run loadimage; then " \
-                       "run mmcboot;" \
-               "fi;" \
+               "if run loadbootscript; then " \
+                       "run bootscript; " \
+               "else " \
+                       "if run loadimage; then " \
+                               "run mmcboot;" \
+                       "fi;" \
+               "fi; " \
        "fi;" \
        "run nandboot;" \
        "setenv bootfile zImage;" \