]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
upgrade to upstream version 2013.07 KARO-TX6-2013-08-23
authorLothar Waßmann <LW@KARO-electronics.de>
Fri, 23 Aug 2013 15:27:09 +0000 (17:27 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 23 Aug 2013 15:27:09 +0000 (17:27 +0200)
25 files changed:
1  2 
Makefile
arch/arm/cpu/arm926ejs/mxs/clock.c
arch/arm/cpu/arm926ejs/mxs/mxs.c
arch/arm/cpu/arm926ejs/mxs/timer.c
arch/arm/cpu/armv7/omap-common/boot-common.c
arch/arm/imx-common/timer.c
arch/arm/include/asm/arch-mxs/clock.h
arch/arm/include/asm/arch-mxs/regs-ssp.h
arch/arm/lib/board.c
board/karo/common/fdt.c
board/karo/tx28/tx28.c
board/karo/tx53/lowlevel_init.S
board/karo/tx6/lowlevel_init.S
common/cmd_fdt.c
common/lcd.c
drivers/mmc/fsl_esdhc.c
drivers/mmc/omap_hsmmc.c
drivers/mtd/nand/mxc_nand.c
drivers/net/fec_mxc.c
drivers/video/ipu_common.c
drivers/video/mxc_ipuv3_fb.c
include/configs/tx48.h
include/configs/tx51.h
include/configs/tx53.h
include/configs/tx6.h

diff --cc Makefile
index 26326e96df31c2d74343ab77758ba124e53cb0e9,b82feebefa3167810b8bc3428e5a360e63ab6ed8..261bde92efe74af5fa465799a58419eea49c296a
+++ b/Makefile
@@@ -512,13 -508,9 +508,9 @@@ $(obj)u-boot.ais:       $(obj)spl/u-boo
                cat $(obj)spl/u-boot-spl-pad.ais $(obj)u-boot.img > \
                        $(obj)u-boot.ais
  
- # Specify the target for use in elftosb call
- ELFTOSB_TARGET-$(CONFIG_MX28) = imx28
  
 -$(obj)u-boot.sb:       $(obj)u-boot $(obj)spl/u-boot-spl.bin elftosb
 +$(obj)u-boot.sb:       $(obj)u-boot.bin $(obj)spl/u-boot-spl.bin elftosb
-               cd $(OBJTREE); \
-               $(TOPDIR)/$(SUBDIR_TOOLS)/elftosb/bld/linux/elftosb -zdf $(ELFTOSB_TARGET-y) -c $(TOPDIR)/$(CPUDIR)/$(SOC)/u-boot-$(ELFTOSB_TARGET-y).bd \
-                       -o $(obj)u-boot.sb
+               $(MAKE) -C $(SRCTREE)/$(CPUDIR)/$(SOC)/ $(OBJTREE)/u-boot.sb
  
  # On x600 (SPEAr600) U-Boot is appended to U-Boot SPL.
  # Both images are created using mkimage (crc etc), so that the ROM
index 85f219d4d425b1366ee2d4ab7dd380c8647e1166,e9d8800f8c1b30f26d3598bdbb18d14732949638..8b5ad018ea7d3000c093f14c2090ccc810ceb650
  #define       PLL_FREQ_MHZ    (PLL_FREQ_KHZ / 1000)
  #define       XTAL_FREQ_MHZ   (XTAL_FREQ_KHZ / 1000)
  
 -static uint32_t mxs_get_pclk(void)
+ #if defined(CONFIG_MX23)
+ #define MXC_SSPCLK_MAX MXC_SSPCLK0
+ #elif defined(CONFIG_MX28)
+ #define MXC_SSPCLK_MAX MXC_SSPCLK3
+ #endif
 +static struct mxs_clkctrl_regs *clkctrl_regs = (void *)MXS_CLKCTRL_BASE;
 +
 +static uint32_t get_frac_clk(uint32_t refclk, uint32_t div, uint32_t _mask)
  {
 -      struct mxs_clkctrl_regs *clkctrl_regs =
 -              (struct mxs_clkctrl_regs *)MXS_CLKCTRL_BASE;
 +      uint32_t mask = (_mask + 1) >> 1;
 +      uint32_t acc = div;
 +      int period = 0;
 +      int mult = 0;
 +
 +      if (div & mask)
 +              return 0;
 +
 +      do {
 +              acc += div;
 +              if (acc & mask) {
 +                      acc &= ~mask;
 +                      mult++;
 +              }
 +              period++;
 +      } while (acc != div);
  
- static uint32_t mx28_get_pclk(void)
 +      return refclk * mult / period;
 +}
 +
++static uint32_t mxs_get_pclk(void)
 +{
        uint32_t clkctrl, clkseq, div;
        uint8_t clkfrac, frac;
  
        return (PLL_FREQ_MHZ * PLL_FREQ_COEF / frac) / div;
  }
  
- static uint32_t mx28_get_hclk(void)
+ static uint32_t mxs_get_hclk(void)
  {
 -      struct mxs_clkctrl_regs *clkctrl_regs =
 -              (struct mxs_clkctrl_regs *)MXS_CLKCTRL_BASE;
 -
        uint32_t div;
        uint32_t clkctrl;
-       uint32_t refclk = mx28_get_pclk();
++      uint32_t refclk = mxs_get_pclk();
  
        clkctrl = readl(&clkctrl_regs->hw_clkctrl_hbus);
 +      div = clkctrl & CLKCTRL_HBUS_DIV_MASK;
  
 -      /* No support of fractional divider calculation */
        if (clkctrl & CLKCTRL_HBUS_DIV_FRAC_EN)
 -              return 0;
 +              return get_frac_clk(refclk, div, CLKCTRL_HBUS_DIV_MASK);
  
 -      div = clkctrl & CLKCTRL_HBUS_DIV_MASK;
 -      return mxs_get_pclk() / div;
 +      return refclk / div;
  }
  
- static uint32_t mx28_get_emiclk(void)
+ static uint32_t mxs_get_emiclk(void)
  {
 -      struct mxs_clkctrl_regs *clkctrl_regs =
 -              (struct mxs_clkctrl_regs *)MXS_CLKCTRL_BASE;
 -
        uint32_t clkctrl, clkseq, div;
        uint8_t clkfrac, frac;
  
        return (PLL_FREQ_MHZ * PLL_FREQ_COEF / frac) / div;
  }
  
- static uint32_t mx28_get_gpmiclk(void)
+ static uint32_t mxs_get_gpmiclk(void)
  {
 -      struct mxs_clkctrl_regs *clkctrl_regs =
 -              (struct mxs_clkctrl_regs *)MXS_CLKCTRL_BASE;
+ #if defined(CONFIG_MX23)
+       uint8_t *reg =
+               &clkctrl_regs->hw_clkctrl_frac0[CLKCTRL_FRAC0_CPU];
+ #elif defined(CONFIG_MX28)
+       uint8_t *reg =
+               &clkctrl_regs->hw_clkctrl_frac1[CLKCTRL_FRAC1_GPMI];
+ #endif
        uint32_t clkctrl, clkseq, div;
        uint8_t clkfrac, frac;
  
  /*
   * Set IO clock frequency, in kHz
   */
- void mx28_set_ioclk(enum mxs_ioclock io, uint32_t freq)
+ void mxs_set_ioclk(enum mxs_ioclock io, uint32_t freq)
  {
 -      struct mxs_clkctrl_regs *clkctrl_regs =
 -              (struct mxs_clkctrl_regs *)MXS_CLKCTRL_BASE;
        uint32_t div;
        int io_reg;
  
  /*
   * Get IO clock, returns IO clock in kHz
   */
- static uint32_t mx28_get_ioclk(enum mxs_ioclock io)
+ static uint32_t mxs_get_ioclk(enum mxs_ioclock io)
  {
 -      struct mxs_clkctrl_regs *clkctrl_regs =
 -              (struct mxs_clkctrl_regs *)MXS_CLKCTRL_BASE;
        uint8_t ret;
        int io_reg;
  
  /*
   * Configure SSP clock frequency, in kHz
   */
- void mx28_set_sspclk(enum mxs_sspclock ssp, uint32_t freq, int xtal)
+ void mxs_set_sspclk(enum mxs_sspclock ssp, uint32_t freq, int xtal)
  {
 -      struct mxs_clkctrl_regs *clkctrl_regs =
 -              (struct mxs_clkctrl_regs *)MXS_CLKCTRL_BASE;
        uint32_t clk, clkreg;
  
-       if (ssp > MXC_SSPCLK3)
+       if (ssp > MXC_SSPCLK_MAX)
                return;
  
        clkreg = (uint32_t)(&clkctrl_regs->hw_clkctrl_ssp0) +
  /*
   * Return SSP frequency, in kHz
   */
- static uint32_t mx28_get_sspclk(enum mxs_sspclock ssp)
+ static uint32_t mxs_get_sspclk(enum mxs_sspclock ssp)
  {
 -      struct mxs_clkctrl_regs *clkctrl_regs =
 -              (struct mxs_clkctrl_regs *)MXS_CLKCTRL_BASE;
 -      uint32_t clkreg;
 +      uint32_t *clkreg;
        uint32_t clk, tmp;
  
-       if (ssp > MXC_SSPCLK3)
+       if (ssp > MXC_SSPCLK_MAX)
                return 0;
  
        tmp = readl(&clkctrl_regs->hw_clkctrl_clkseq);
@@@ -324,53 -309,127 +326,144 @@@ void mxs_set_ssp_busclock(unsigned int 
                bus, tgtclk, freq);
  }
  
- static uint32_t mx28_get_xbus_clk(void)
+ void mxs_set_lcdclk(uint32_t freq)
+ {
 -      struct mxs_clkctrl_regs *clkctrl_regs =
 -              (struct mxs_clkctrl_regs *)MXS_CLKCTRL_BASE;
+       uint32_t fp, x, k_rest, k_best, x_best, tk;
+       int32_t k_best_l = 999, k_best_t = 0, x_best_l = 0xff, x_best_t = 0xff;
+       if (freq == 0)
+               return;
+ #if defined(CONFIG_MX23)
+       writel(CLKCTRL_CLKSEQ_BYPASS_PIX, &clkctrl_regs->hw_clkctrl_clkseq_clr);
+ #elif defined(CONFIG_MX28)
+       writel(CLKCTRL_CLKSEQ_BYPASS_DIS_LCDIF, &clkctrl_regs->hw_clkctrl_clkseq_clr);
+ #endif
+       /*
+        *             /               18 \     1       1
+        * freq kHz = | 480000000 Hz * --  | * --- * ------
+        *             \                x /     k     1000
+        *
+        *      480000000 Hz   18
+        *      ------------ * --
+        *        freq kHz      x
+        * k = -------------------
+        *             1000
+        */
+       fp = ((PLL_FREQ_KHZ * 1000) / freq) * 18;
+       for (x = 18; x <= 35; x++) {
+               tk = fp / x;
+               if ((tk / 1000 == 0) || (tk / 1000 > 255))
+                       continue;
+               k_rest = tk % 1000;
+               if (k_rest < (k_best_l % 1000)) {
+                       k_best_l = tk;
+                       x_best_l = x;
+               }
+               if (k_rest > (k_best_t % 1000)) {
+                       k_best_t = tk;
+                       x_best_t = x;
+               }
+       }
+       if (1000 - (k_best_t % 1000) > (k_best_l % 1000)) {
+               k_best = k_best_l;
+               x_best = x_best_l;
+       } else {
+               k_best = k_best_t;
+               x_best = x_best_t;
+       }
+       k_best /= 1000;
+ #if defined(CONFIG_MX23)
+       writeb(CLKCTRL_FRAC_CLKGATE,
+               &clkctrl_regs->hw_clkctrl_frac0_set[CLKCTRL_FRAC0_PIX]);
+       writeb(CLKCTRL_FRAC_CLKGATE | (x_best & CLKCTRL_FRAC_FRAC_MASK),
+               &clkctrl_regs->hw_clkctrl_frac0[CLKCTRL_FRAC0_PIX]);
+       writeb(CLKCTRL_FRAC_CLKGATE,
+               &clkctrl_regs->hw_clkctrl_frac0_clr[CLKCTRL_FRAC0_PIX]);
+       writel(CLKCTRL_PIX_CLKGATE,
+               &clkctrl_regs->hw_clkctrl_pix_set);
+       clrsetbits_le32(&clkctrl_regs->hw_clkctrl_pix,
+                       CLKCTRL_PIX_DIV_MASK | CLKCTRL_PIX_CLKGATE,
+                       k_best << CLKCTRL_PIX_DIV_OFFSET);
+       while (readl(&clkctrl_regs->hw_clkctrl_pix) & CLKCTRL_PIX_BUSY)
+               ;
+ #elif defined(CONFIG_MX28)
+       writeb(CLKCTRL_FRAC_CLKGATE,
+               &clkctrl_regs->hw_clkctrl_frac1_set[CLKCTRL_FRAC1_PIX]);
+       writeb(CLKCTRL_FRAC_CLKGATE | (x_best & CLKCTRL_FRAC_FRAC_MASK),
+               &clkctrl_regs->hw_clkctrl_frac1[CLKCTRL_FRAC1_PIX]);
+       writeb(CLKCTRL_FRAC_CLKGATE,
+               &clkctrl_regs->hw_clkctrl_frac1_clr[CLKCTRL_FRAC1_PIX]);
+       writel(CLKCTRL_DIS_LCDIF_CLKGATE,
+               &clkctrl_regs->hw_clkctrl_lcdif_set);
+       clrsetbits_le32(&clkctrl_regs->hw_clkctrl_lcdif,
+                       CLKCTRL_DIS_LCDIF_DIV_MASK | CLKCTRL_DIS_LCDIF_CLKGATE,
+                       k_best << CLKCTRL_DIS_LCDIF_DIV_OFFSET);
+       while (readl(&clkctrl_regs->hw_clkctrl_lcdif) & CLKCTRL_DIS_LCDIF_BUSY)
+               ;
+ #endif
+ }
++static uint32_t mxs_get_xbus_clk(void)
 +{
-       struct mxs_clkctrl_regs *clkctrl_regs =
-               (struct mxs_clkctrl_regs *)MXS_CLKCTRL_BASE;
 +      uint32_t div;
 +      uint32_t clkctrl;
-       uint32_t refclk = mx28_get_pclk();
++      uint32_t refclk = mxs_get_pclk();
 +
 +      clkctrl = readl(&clkctrl_regs->hw_clkctrl_xbus);
 +      div = clkctrl & CLKCTRL_XBUS_DIV_MASK;
 +
 +      if (clkctrl & CLKCTRL_XBUS_DIV_FRAC_EN)
 +              return get_frac_clk(refclk, div, CLKCTRL_XBUS_DIV_MASK);
 +
 +      return refclk / div;
 +}
 +
  uint32_t mxc_get_clock(enum mxc_clock clk)
  {
        switch (clk) {
        case MXC_ARM_CLK:
-               return mx28_get_pclk() * 1000000;
+               return mxs_get_pclk() * 1000000;
        case MXC_GPMI_CLK:
-               return mx28_get_gpmiclk() * 1000000;
+               return mxs_get_gpmiclk() * 1000000;
        case MXC_AHB_CLK:
        case MXC_IPG_CLK:
-               return mx28_get_hclk() * 1000000;
+               return mxs_get_hclk() * 1000000;
        case MXC_EMI_CLK:
-               return mx28_get_emiclk();
+               return mxs_get_emiclk();
        case MXC_IO0_CLK:
-               return mx28_get_ioclk(MXC_IOCLK0);
+               return mxs_get_ioclk(MXC_IOCLK0);
        case MXC_IO1_CLK:
-               return mx28_get_ioclk(MXC_IOCLK1);
+               return mxs_get_ioclk(MXC_IOCLK1);
+       case MXC_XTAL_CLK:
+               return XTAL_FREQ_KHZ * 1000;
        case MXC_SSP0_CLK:
-               return mx28_get_sspclk(MXC_SSPCLK0);
+               return mxs_get_sspclk(MXC_SSPCLK0);
+ #ifdef CONFIG_MX28
        case MXC_SSP1_CLK:
-               return mx28_get_sspclk(MXC_SSPCLK1);
+               return mxs_get_sspclk(MXC_SSPCLK1);
        case MXC_SSP2_CLK:
-               return mx28_get_sspclk(MXC_SSPCLK2);
+               return mxs_get_sspclk(MXC_SSPCLK2);
        case MXC_SSP3_CLK:
-               return mx28_get_sspclk(MXC_SSPCLK3);
-       case MXC_XTAL_CLK:
-               return XTAL_FREQ_KHZ * 1000;
+               return mxs_get_sspclk(MXC_SSPCLK3);
+ #endif
 +      case MXC_XBUS_CLK:
-               return mx28_get_xbus_clk() * 1000000;
++              return mxs_get_xbus_clk() * 1000000;
 +      default:
 +              printf("Invalid clock selector %u\n", clk);
        }
  
        return 0;
Simple merge
index f2dfc8a6dd640e101cf045c23c1681364d96e11d,20693e2a94cd4c1ddf68e3086fce4818ff9606fd..12789327ccb65dbcb18b5b3c5eb66be53dd17a8e
@@@ -82,6 -74,13 +74,13 @@@ int timer_init(void
                TIMROT_TIMCTRLn_SELECT_1KHZ_XTAL,
                &timrot_regs->hw_timrot_timctrl0);
  
 -      /* Set fixed_count to maximal value */
++      /* Set fixed_count to maximum value */
+ #if defined(CONFIG_MX23)
+       writel(TIMER_LOAD_VAL - 1, &timrot_regs->hw_timrot_timcount0);
+ #elif defined(CONFIG_MX28)
+       writel(TIMER_LOAD_VAL, &timrot_regs->hw_timrot_fixed_count0);
+ #endif
  #ifndef DEBUG_TIMER_WRAP
        /* Set fixed_count to maximum value */
        writel(TIMER_LOAD_VAL, &timrot_regs->hw_timrot_fixed_count0);
@@@ -90,8 -89,8 +89,7 @@@
        writel(20 * MXS_INCREMENTER_HZ,
                &timrot_regs->hw_timrot_fixed_count0);
        gd->arch.lastinc = TIMER_LOAD_VAL - 20 * MXS_INCREMENTER_HZ;
--#endif
--#ifdef DEBUG_TIMER_WRAP
++
        /* Make the usec counter roll over 30 seconds after startup */
        writel(-30000000, MXS_HW_DIGCTL_MICROSECONDS);
  #endif
index d5fb40e22eae98ad786de57a53df427f6dca4264,6b9ce369f5efe8d1a6d9871258cd119d9d84385b..ad383872c57f706a65a8171c756c2b815e92a194
  #include <asm/arch/mmc_host_def.h>
  #include <asm/arch/sys_proto.h>
  
- /*
-  * This is used to verify if the configuration header
-  * was executed by rom code prior to control of transfer
-  * to the bootloader. SPL is responsible for saving and
-  * passing the boot_params pointer to the u-boot.
-  */
- struct omap_boot_parameters boot_params __attribute__ ((section(".data")));
+ DECLARE_GLOBAL_DATA_PTR;
  
- #ifdef CONFIG_SPL_BUILD
- /*
-  * We use static variables because global data is not ready yet.
-  * Initialized data is available in SPL right from the beginning.
-  * We would not typically need to save these parameters in regular
-  * U-Boot. This is needed only in SPL at the moment.
-  */
- u32 omap_bootmode __attribute__ ((section(".data"))) = MMCSD_MODE_UNDEFINED;
+ void save_omap_boot_params(void)
+ {
+       u32 rom_params = *((u32 *)OMAP_SRAM_SCRATCH_BOOT_PARAMS);
+       u8 boot_device;
+       u32 dev_desc, dev_data;
+       if ((rom_params <  NON_SECURE_SRAM_START) ||
+           (rom_params > NON_SECURE_SRAM_END))
+               return;
+       /*
+        * rom_params can be type casted to omap_boot_parameters and
+        * used. But it not correct to assume that romcode structure
+        * encoding would be same as u-boot. So use the defined offsets.
+        */
+       gd->arch.omap_boot_params.omap_bootdevice = boot_device =
+                                  *((u8 *)(rom_params + BOOT_DEVICE_OFFSET));
+       gd->arch.omap_boot_params.ch_flags =
+                               *((u8 *)(rom_params + CH_FLAGS_OFFSET));
  
+       if ((boot_device >= MMC_BOOT_DEVICES_START) &&
+           (boot_device <= MMC_BOOT_DEVICES_END)) {
+ #if !defined(CONFIG_AM33XX) && !defined(CONFIG_TI81XX)
+               if ((omap_hw_init_context() ==
+                                     OMAP_INIT_CONTEXT_UBOOT_AFTER_SPL)) {
+                       gd->arch.omap_boot_params.omap_bootmode =
+                       *((u8 *)(rom_params + BOOT_MODE_OFFSET));
+               } else
+ #endif
+               {
+                       dev_desc = *((u32 *)(rom_params + DEV_DESC_PTR_OFFSET));
+                       dev_data = *((u32 *)(dev_desc + DEV_DATA_PTR_OFFSET));
+                       gd->arch.omap_boot_params.omap_bootmode =
+                                       *((u32 *)(dev_data + BOOT_MODE_OFFSET));
+               }
+       }
+ }
+ #ifdef CONFIG_SPL_BUILD
  u32 spl_boot_device(void)
  {
-       return boot_params.omap_bootdevice;
 -      return (u32) (gd->arch.omap_boot_params.omap_bootdevice);
++      return gd->arch.omap_boot_params.omap_bootdevice;
  }
  
  u32 spl_boot_mode(void)
index bf1810264190f11c255fce4a813a6c3bd0db3d63,a4b0137cf3f68986accca9c42889ff64d5de6727..92712a6de55b86a2432bbbf02ac694566b2c3b68
@@@ -45,67 -27,25 +27,33 @@@ static struct mxc_gpt *cur_gpt = (struc
  /* General purpose timers bitfields */
  #define GPTCR_SWR             (1 << 15)       /* Software reset */
  #define GPTCR_FRR             (1 << 9)        /* Freerun / restart */
- #define GPTCR_CLKSOURCE_IPG   (1 << 6)        /* Clock source */
- #define GPTCR_CLKSOURCE_CKIH  (2 << 6)
- #define GPTCR_CLKSOURCE_32kHz (4 << 6)
- #if defined(CONFIG_MX6Q)
- #define GPTCR_CLKSOURCE_OSCDIV8       (5 << 6)
- #define GPTCR_CLKSOURCE_OSC   (7 << 6)
- #elif defined(CONFIG_MX6DL)
- #define GPTCR_M24EN           (1 << 10)
- #define GPTCR_CLKSOURCE_OSC   ((5 << 6) | GPTCR_M24EN)
- #else
- #define GPTCR_CLKSOURCE_OSC   (5 << 6)
- #endif
- #define GPTCR_CLKSOURCE_MASK  (7 << 6)
+ #define GPTCR_CLKSOURCE_32    (4 << 6)        /* Clock source */
  #define GPTCR_TEN             1               /* Timer enable */
  
- #if 1
- #define GPT_CLKSOURCE         GPTCR_CLKSOURCE_OSC
- #define GPT_REFCLK            24000000
- #define GPT_PRESCALER         24
- #else
- #define GPT_CLKSOURCE         GPTCR_CLKSOURCE_32kHz
- #define GPT_REFCLK            32768
- #define GPT_PRESCALER         1
- #endif
- #define GPT_CLK                       (GPT_REFCLK / GPT_PRESCALER)
- #ifdef DEBUG_TIMER_WRAP
- /*
-  * Let the timer wrap 30 seconds after start to catch misbehaving
-  * timer related code early
-  */
- #define TIMER_START           (-time_to_tick(30 * CONFIG_SYS_HZ))
- #else
- #define TIMER_START           0UL
- #endif
  DECLARE_GLOBAL_DATA_PTR;
  
- static inline unsigned long tick_to_time(unsigned long tick)
+ static inline unsigned long long tick_to_time(unsigned long long tick)
  {
-       unsigned long long t = (unsigned long long)tick * CONFIG_SYS_HZ;
-       do_div(t, GPT_CLK);
-       return t;
+       tick *= CONFIG_SYS_HZ;
+       do_div(tick, MXC_CLK32);
 -
+       return tick;
  }
  
-       ticks *= GPT_CLK;
 +static inline unsigned long time_to_tick(unsigned long time)
 +{
 +      unsigned long long ticks = (unsigned long long)time;
 +
- static inline unsigned long us_to_tick(unsigned long usec)
++      ticks *= MXC_CLK32;
 +      do_div(ticks, CONFIG_SYS_HZ);
 +      return ticks;
 +}
 +
+ static inline unsigned long long us_to_tick(unsigned long long usec)
  {
-       unsigned long long ticks = (unsigned long long)usec;
+       usec = usec * MXC_CLK32 + 999999;
+       do_div(usec, 1000000);
  
-       ticks *= GPT_CLK;
-       do_div(ticks, 1000 * CONFIG_SYS_HZ);
-       return ticks;
+       return usec;
  }
  
  int timer_init(void)
@@@ -164,11 -96,9 +111,9 @@@ ulong get_timer_masked(void
  
  ulong get_timer(ulong base)
  {
 -      return get_timer_masked() - base;
 +      return tick_to_time(get_ticks() - time_to_tick(base));
  }
  
- #include <asm/gpio.h>
  /* delay x useconds AND preserve advance timstamp value */
  void __udelay(unsigned long usec)
  {
index 0e145dba75799f72809311b32085369f8e11c7f5,fc9d75b50940504c874f914cb3d8731e23ce67a7..d3bc95b8240ac270c8fa5920dde868bdffbacf83
@@@ -35,8 -24,7 +24,8 @@@ enum mxc_clock 
        MXC_SSP1_CLK,
        MXC_SSP2_CLK,
        MXC_SSP3_CLK,
-       MXC_XTAL_CLK,
+ #endif
 +      MXC_XBUS_CLK,
  };
  
  enum mxs_ioclock {
index 51a703775225b6681245ac43d9fecf91893acc30,be74e4b1cffb58f6ee5332a71d32023393c8848a..464e9e0914b6f4d02cd8502499c3fbda1af4b13d
  #ifndef __MX28_REGS_SSP_H__
  #define __MX28_REGS_SSP_H__
  
- #include <asm/arch/regs-common.h>
+ #include <asm/imx-common/regs-common.h>
  
  #ifndef       __ASSEMBLY__
 -      mxs_reg_32(hw_ssp_ctrl0)
 -      mxs_reg_32(hw_ssp_cmd0)
 -      mxs_reg_32(hw_ssp_cmd1)
 -      mxs_reg_32(hw_ssp_compref)
 -      mxs_reg_32(hw_ssp_compmask)
 -      mxs_reg_32(hw_ssp_timing)
 -      mxs_reg_32(hw_ssp_ctrl1)
 -      mxs_reg_32(hw_ssp_data)
 -      mxs_reg_32(hw_ssp_sdresp0)
 -      mxs_reg_32(hw_ssp_sdresp1)
 -      mxs_reg_32(hw_ssp_sdresp2)
 -      mxs_reg_32(hw_ssp_sdresp3)
 -      mxs_reg_32(hw_ssp_status)
 -
 -      uint32_t        reserved1[12];
 -
 -      mxs_reg_32(hw_ssp_debug)
 -      mxs_reg_32(hw_ssp_version)
+ #if defined(CONFIG_MX23)
+ struct mxs_ssp_regs {
++      mxs_reg_32(hw_ssp_ctrl0);
++      mxs_reg_32(hw_ssp_cmd0);
++      mxs_reg_32(hw_ssp_cmd1);
++      mxs_reg_32(hw_ssp_compref);
++      mxs_reg_32(hw_ssp_compmask);
++      mxs_reg_32(hw_ssp_timing);
++      mxs_reg_32(hw_ssp_ctrl1);
++      mxs_reg_32(hw_ssp_data);
++      mxs_reg_32(hw_ssp_sdresp0);
++      mxs_reg_32(hw_ssp_sdresp1);
++      mxs_reg_32(hw_ssp_sdresp2);
++      mxs_reg_32(hw_ssp_sdresp3);
++      mxs_reg_32(hw_ssp_status);
++      reg_32(reserved[3]);
++      mxs_reg_32(hw_ssp_debug);
++      mxs_reg_32(hw_ssp_version);
+ };
+ #elif defined(CONFIG_MX28)
  struct mxs_ssp_regs {
        mxs_reg_32(hw_ssp_ctrl0);
        mxs_reg_32(hw_ssp_cmd0);
Simple merge
Simple merge
Simple merge
index 5dc4a964d1d525d0d2abb056ee765b707f0e5537,85b204df6a3598f6d3c011613028592fb8834500..ba8d961aacd1d7955f0c38ca9a41b76818d54057
  #define SDRAM_SIZE            PHYS_SDRAM_1_SIZE
  #endif
  
- #define REG_ESDCTL0           0x00
- #define REG_ESDCFG0           0x04
- #define REG_ESDCTL1           0x08
- #define REG_ESDCFG1           0x0c
- #define REG_ESDMISC           0x10
- #define REG_ESDSCR            0x14
- #define REG_ESDGPR            0x34
 -#define REG_CCOSR             0x60
  
  #define REG_CCGR0             0x68
  #define REG_CCGR1             0x6c
Simple merge
Simple merge
diff --cc common/lcd.c
index 77052e696d3f7c84b73a254b96a6c2cbc8caf4c1,8ba13160c44b4a35f728b9b49c79c0b319af98e3..0a8835e83cab3068cc7b0a453c741b723695be41
@@@ -1050,8 -1074,7 +1074,8 @@@ int lcd_display_bitmap(ulong bmp_image
                                fb[2] = *bmap++; /* R */
                                fb += 4;
                        }
-                       fb   -= width * 4 + lcd_line_length;
 +                      bmap += (padded_width - width) * 4;
+                       fb -= lcd_line_length + width * (bpix / 8);
                }
                break;
        };
Simple merge
index a00e507449e6bd158dd788bd3a9da5a06145b2e6,c6dfd3931be41edd2e0a4d758730fa67f17cb122..67d6b6862554c8150aea1b3c3786a58e5b0c424a
@@@ -177,7 -215,7 +215,8 @@@ void mmc_init_stream(struct hsmmc *mmc_
  
  static int mmc_init_setup(struct mmc *mmc)
  {
-       struct hsmmc *mmc_base = (struct hsmmc *)mmc->priv;
 -      struct hsmmc *mmc_base;
++      struct omap_hsmmc_data *priv_data = mmc->priv;
++      struct hsmmc *mmc_base = priv_data->base_addr;
        unsigned int reg_val;
        unsigned int dsor;
        ulong start;
@@@ -262,7 -301,7 +301,8 @@@ static void mmc_reset_controller_fsm(st
  static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
                        struct mmc_data *data)
  {
-       struct hsmmc *mmc_base = mmc->priv;
 -      struct hsmmc *mmc_base;
++      struct omap_hsmmc_data *priv_data = mmc->priv;
++      struct hsmmc *mmc_base = priv_data->base_addr;
        unsigned int flags, mmc_stat;
        ulong start;
  
@@@ -488,7 -528,7 +528,8 @@@ static int mmc_write_data(struct hsmmc 
  
  static void mmc_set_ios(struct mmc *mmc)
  {
-       struct hsmmc *mmc_base = (struct hsmmc *)mmc->priv;
 -      struct hsmmc *mmc_base;
++      struct omap_hsmmc_data *priv_data = mmc->priv;
++      struct hsmmc *mmc_base = priv_data->base_addr;
        unsigned int dsor = 0;
        ulong start;
  
index 0e89828ee622c11b6ca0b9628a51469db2b3fdd2,57f4e796402d34e0560bc28bd4063611395a14f3..f4528f20bd377d1c053611e7e75cdc617e5c950c
@@@ -138,10 -130,10 +130,6 @@@ static int is_16bit_nand(void
  #define NFC_VERSION           "unknown"
  #endif
  
- #ifndef CONFIG_MXC_NAND_IP_BASE
- #define CONFIG_MXC_NAND_IP_BASE       0
 -#ifndef CONFIG_MXC_NAND_IP_REGS_BASE
 -#define CONFIG_MXC_NAND_IP_REGS_BASE  0
--#endif
--
  /* Addresses for NFC registers */
  #define NFC_V1_V2_BUF_SIZE            (host->regs + 0x00)
  #define NFC_V1_V2_BUF_ADDR            (host->regs + 0x04)
Simple merge
Simple merge
index cad5db9511e79492bf888827355b1a9f1715c2fa,d7232ad1d62be8baf8131e6d79c3b211a90d25f0..6a147d5186af55d5a0cbccdff9cfd5c772154d7b
@@@ -8,26 -8,9 +8,10 @@@
   *
   * (C) Copyright 2004-2011 Freescale Semiconductor, Inc.
   *
-  * See file CREDITS for list of people who contributed to this
-  * project.
-  *
-  * This program is free software; you can redistribute it and/or
-  * modify it under the terms of the GNU General Public License as
-  * published by the Free Software Foundation; either version 2 of
-  * the License, or (at your option) any later version.
-  *
-  * This program is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
-  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  * GNU General Public License for more details.
-  *
-  * You should have received a copy of the GNU General Public License
-  * along with this program; if not, write to the Free Software
-  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-  * MA 02111-1307 USA
+  * SPDX-License-Identifier:   GPL-2.0+
   */
  
 +/* #define DEBUG */
  #include <common.h>
  #include <asm/errno.h>
  #include <linux/string.h>
index 8ce9efcd3c3086d8aa9ef2583db8ab727dda8f55,0ee481440c8a6def0a92a93bb07b030b7c916eaa..64f42e023b2e80c1469fb474c1105366bb37fea7
@@@ -6,18 -6,12 +6,12 @@@
   * based on: am335x_evm
   * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
   *
-  * This program is free software; you can redistribute it and/or
-  * modify it under the terms of the GNU General Public License as
-  * published by the Free Software Foundation version 2.
+  * SPDX-License-Identifier:      GPL-2.0
   *
-  * This program is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
-  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.        See the
-  * GNU General Public License for more details.
   */
  
--#ifndef __CONFIGS_TX48_H
--#define __CONFIGS_TX48_H
++#ifndef __CONFIG_H
++#define __CONFIG_H
  
  #include <asm/sizes.h>
  
  #define CONFIG_SYS_SPL_MALLOC_START   (PHYS_SDRAM_1 + SZ_2M + SZ_32K)
  #define CONFIG_SYS_SPL_MALLOC_SIZE    SZ_1M
  
--#endif        /* __CONFIGS_TX48_H */
++#endif        /* __CONFIG_H */
index 8ab6ebb3a1fabe0332164b0f3e8cb7b5f3129c82,e0fde5cd18a3319aa1861ecbe57a0ebbe8bbc6e4..5005a47ebc949f193b72134b2f67ed7d46e81f19
@@@ -1,28 -1,23 +1,24 @@@
  /*
   * Copyright (C) 2012 <LW@KARO-electronics.de>
   *
-  * This program is free software; you can redistribute it and/or
-  * modify it under the terms of the GNU General Public License as
-  * published by the Free Software Foundation version 2.
+  * SPDX-License-Identifier:      GPL-2.0
   *
-  * This program is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
-  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.        See the
-  * GNU General Public License for more details.
   */
--#ifndef __CONFIGS_TX51_H
--#define __CONFIGS_TX51_H
 -#define CONFIG_MX51                           /* must be set before including imx-regs.h */
++#ifndef __CONFIG_H
++#define __CONFIG_H
++
++#define CONFIG_MX51                   /* must be set before including imx-regs.h */
  
  #include <asm/sizes.h>
+ #include <asm/arch/imx-regs.h>
  
  /*
   * Ka-Ro TX51 board - SoC configuration
   */
- #define CONFIG_MX51                           /* i.MX51 SoC */
  #define CONFIG_SYS_MX5_IOMUX_V3
--#define CONFIG_MXC_GPIO                               /* GPIO control */
++#define CONFIG_MXC_GPIO                       /* GPIO control */
  #define CONFIG_SYS_MX5_HCLK           24000000
- #define CONFIG_SYS_MX5_CLK32          32768
  #define CONFIG_SYS_DDR_CLKSEL         0
  #define CONFIG_SYS_HZ                 1000    /* Ticks per second */
  #define CONFIG_SHOW_ACTIVITY
   */
  #include <config_cmd_default.h>
  #define CONFIG_CMD_CACHE
 -#if 0
--#define CONFIG_CMD_IIM
 -#endif
  #define CONFIG_CMD_MMC
  #define CONFIG_CMD_NAND
  #define CONFIG_CMD_MTDPARTS
  #define CONFIG_MTD_DEVICE
  #define CONFIG_ENV_IS_IN_NAND
  #define CONFIG_NAND_MXC
- #define CONFIG_MXC_NAND_REGS_BASE     0xcfff0000
- #define CONFIG_MXC_NAND_IP_BASE               0x83fdb000
 -#define CONFIG_MXC_NAND_REGS_BASE     NFC_BASE_ADDR_AXI // 0xcfff0000
 -#define CONFIG_MXC_NAND_IP_REGS_BASE  NFC_BASE_ADDR // 0x83fdb000
++#define CONFIG_MXC_NAND_REGS_BASE     NFC_BASE_ADDR_AXI
++#define CONFIG_MXC_NAND_IP_REGS_BASE  NFC_BASE_ADDR
  #define CONFIG_MXC_NAND_HWECC
  #define CONFIG_CMD_NAND_TRIMFFS
  #define CONFIG_SYS_MAX_FLASH_SECT     1024
                                        GENERATED_GBL_DATA_SIZE)
  
  #ifdef CONFIG_CMD_IIM
- #define CONFIG_IMX_IIM
+ #define CONFIG_FSL_IIM
  #endif
  
--#endif /* __CONFIGS_TX51_H */
++#endif /* __CONFIG_H */
index b7821a88b5c050420c4db5c9d1e28f75fbcc016e,8044fd09b2a321ec695b1906aca9881e41c3a75a..3b2eb240f37869c0afa1bcb95166a7e95466ab5b
@@@ -1,29 -1,25 +1,25 @@@
  /*
   * Copyright (C) 2012 <LW@KARO-electronics.de>
   *
-  * This program is free software; you can redistribute it and/or
-  * modify it under the terms of the GNU General Public License as
-  * published by the Free Software Foundation version 2.
+  * SPDX-License-Identifier:      GPL-2.0
   *
-  * This program is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
-  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.        See the
-  * GNU General Public License for more details.
   */
- #ifndef __CONFIGS_TX53_H
- #define __CONFIGS_TX53_H
 -#ifndef __CONFIGS_TX53_H
 -#define __CONFIGS_TX53_H
++#ifndef __CONFIG_H
++#define __CONFIG_H
 -#define CONFIG_MX53                           /* must be set before including imx-regs.h */
++#define CONFIG_MX53                   /* must be set before including imx-regs.h */
  
  #include <asm/sizes.h>
+ #include <asm/arch/imx-regs.h>
  
  /*
   * Ka-Ro TX53 board - SoC configuration
   */
--#define CONFIG_TX53                           /* TX53 SoM */
- #define CONFIG_MX53                           /* i.MX53 SoC */
++#define CONFIG_TX53                   /* TX53 SoM */
  #define CONFIG_SYS_MX5_IOMUX_V3
--#define CONFIG_MXC_GPIO                               /* GPIO control */
++#define CONFIG_MXC_GPIO                       /* GPIO control */
  #define CONFIG_SYS_MX5_HCLK           24000000
- #define CONFIG_SYS_MX5_CLK32          32768
  #define CONFIG_SYS_DDR_CLKSEL         0
  #define CONFIG_SYS_HZ                 1000    /* Ticks per second */
  #define CONFIG_SHOW_ACTIVITY
   */
  #include <config_cmd_default.h>
  #define CONFIG_CMD_CACHE
 -#if 0
--#define CONFIG_CMD_IIM
 -#endif
  #define CONFIG_CMD_MMC
  #define CONFIG_CMD_NAND
  #define CONFIG_CMD_MTDPARTS
  #define CONFIG_MTD_DEVICE
  #define CONFIG_ENV_IS_IN_NAND
  #define CONFIG_NAND_MXC
- #define CONFIG_MXC_NAND_REGS_BASE     0xf7ff0000
- #define CONFIG_MXC_NAND_IP_BASE               0x63fdb000
 -#define CONFIG_MXC_NAND_REGS_BASE     NFC_BASE_ADDR_AXI // 0xf7ff0000
 -#define CONFIG_MXC_NAND_IP_REGS_BASE  NFC_BASE_ADDR // 0x63fdb000
++#define CONFIG_MXC_NAND_REGS_BASE     NFC_BASE_ADDR_AXI
++#define CONFIG_MXC_NAND_IP_REGS_BASE  NFC_BASE_ADDR
  #define CONFIG_MXC_NAND_HWECC
  #define CONFIG_CMD_NAND_TRIMFFS
  #define CONFIG_SYS_MAX_FLASH_SECT     1024
  #define CONFIG_MMC
  #define CONFIG_GENERIC_MMC
  #define CONFIG_FSL_ESDHC
 -#if 0
--#define CONFIG_SYS_FSL_ESDHC_USE_PIO
 -#endif
  #define CONFIG_SYS_FSL_ESDHC_ADDR     0
  #define CONFIG_SYS_FSL_ESDHC_NUM      2
  
                                        GENERATED_GBL_DATA_SIZE)
  
  #ifdef CONFIG_CMD_IIM
- #define CONFIG_IMX_IIM
+ #define CONFIG_FSL_IIM
  #endif
  
--#endif /* __CONFIGS_TX53_H */
++#endif /* __CONFIG_H */
index 8065accf30c0751fe6a898c1a17ee02177b5f85f,a9a50113870505241ca8b83d0e958d8f6ca334b3..24058cb25965590140a48ff293f6f6c55da460c8
@@@ -1,19 -1,15 +1,15 @@@
  /*
   * Copyright (C) 2012 <LW@KARO-electronics.de>
   *
-  * This program is free software; you can redistribute it and/or
-  * modify it under the terms of the GNU General Public License as
-  * published by the Free Software Foundation version 2.
+  * SPDX-License-Identifier:      GPL-2.0
   *
-  * This program is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
-  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.        See the
-  * GNU General Public License for more details.
   */
- #ifndef __TX6_H
- #define __TX6_H
 -#ifndef __TX6_H
 -#define __TX6_H
++#ifndef __CONFIG_H
++#define __CONFIG_H
  
  #include <asm/sizes.h>
+ #include <asm/arch/imx-regs.h>
  
  /*
   * Ka-Ro TX6 board - SoC configuration
  #define CONFIG_SYS_INIT_SP_ADDR               (CONFIG_SYS_SDRAM_BASE + 0x1000 - /* Fix this */ \
                                        GENERATED_GBL_DATA_SIZE)
  
- #ifdef CONFIG_CMD_IIM
- #define CONFIG_IMX_IIM
- #endif
 -#endif /* __CONFIGS_TX6_H */
 +#endif /* __CONFIG_H */