Re: [U-Boot] [PATCH v1 3/3] mxs: Convert sys_proto.h prefixes to 'mxs'

2012-08-13 Thread Otavio Salvador
On Mon, Aug 13, 2012 at 3:59 PM, Marek Vasut  wrote:
>> >> - for (i = 0; i < ARRAY_SIZE(mx28_boot_modes); i++) {
>> >> - masked = bootmode & mx28_boot_modes[i].boot_mask;
>> >> - if (masked == mx28_boot_modes[i].boot_pads)
>> >> + for (i = 0; i < ARRAY_SIZE(mxs_boot_modes); i++) {
>> >> + masked = bootmode & mxs_boot_modes[i].boot_mask;
>> >> + if (masked == mxs_boot_modes[i].boot_pads)
>> >
>> > mxs_boot_modes? They're different for mx23 and mx28!
>>
>> Yes, they're but the structure is the same so we can use same symbol
>> and have a different mxs_boot_modes matrix for each.
>
> Unless we want a single image for mx233 and mx28. Oh well ... for now

What do you mean by single image?

-- 
Otavio Salvador O.S. Systems
E-mail: ota...@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854  http://projetos.ossystems.com.br
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v1 3/3] mxs: Convert sys_proto.h prefixes to 'mxs'

2012-08-13 Thread Marek Vasut
Dear Otavio Salvador,

> On Mon, Aug 13, 2012 at 3:11 PM, Marek Vasut  wrote:
> > Dear Otavio Salvador,
> > 
> > [...]
> > 
> >> diff --git a/arch/arm/cpu/arm926ejs/mxs/spl_boot.c
> >> b/arch/arm/cpu/arm926ejs/mxs/spl_boot.c index 84d4a17..ddafddb 100644
> >> --- a/arch/arm/cpu/arm926ejs/mxs/spl_boot.c
> >> +++ b/arch/arm/cpu/arm926ejs/mxs/spl_boot.c
> >> @@ -82,9 +82,9 @@ uint8_t mxs_get_bootmode_index(void)
> >> 
> >>   bootmode |= (gpio_get_value(MX28_PAD_LCD_D04__GPIO_1_4) ? 1 : 0)
> >>   << 4; bootmode |= (gpio_get_value(MX28_PAD_LCD_D05__GPIO_1_5) ? 1
> >>   : 0) << 5;
> >> 
> >> - for (i = 0; i < ARRAY_SIZE(mx28_boot_modes); i++) {
> >> - masked = bootmode & mx28_boot_modes[i].boot_mask;
> >> - if (masked == mx28_boot_modes[i].boot_pads)
> >> + for (i = 0; i < ARRAY_SIZE(mxs_boot_modes); i++) {
> >> + masked = bootmode & mxs_boot_modes[i].boot_mask;
> >> + if (masked == mxs_boot_modes[i].boot_pads)
> > 
> > mxs_boot_modes? They're different for mx23 and mx28!
> 
> Yes, they're but the structure is the same so we can use same symbol
> and have a different mxs_boot_modes matrix for each.

Unless we want a single image for mx233 and mx28. Oh well ... for now

Acked-by: Marek Vasut 

> >>   break;
> >>   
> >>   }
> > 
> > [...]
> > 
> > Rest seems fine
> > 
> > Best regards,
> > Marek Vasut

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v1 3/3] mxs: Convert sys_proto.h prefixes to 'mxs'

2012-08-13 Thread Otavio Salvador
On Mon, Aug 13, 2012 at 3:11 PM, Marek Vasut  wrote:
> Dear Otavio Salvador,
>
> [...]
>
>> diff --git a/arch/arm/cpu/arm926ejs/mxs/spl_boot.c
>> b/arch/arm/cpu/arm926ejs/mxs/spl_boot.c index 84d4a17..ddafddb 100644
>> --- a/arch/arm/cpu/arm926ejs/mxs/spl_boot.c
>> +++ b/arch/arm/cpu/arm926ejs/mxs/spl_boot.c
>> @@ -82,9 +82,9 @@ uint8_t mxs_get_bootmode_index(void)
>>   bootmode |= (gpio_get_value(MX28_PAD_LCD_D04__GPIO_1_4) ? 1 : 0) << 4;
>>   bootmode |= (gpio_get_value(MX28_PAD_LCD_D05__GPIO_1_5) ? 1 : 0) << 5;
>>
>> - for (i = 0; i < ARRAY_SIZE(mx28_boot_modes); i++) {
>> - masked = bootmode & mx28_boot_modes[i].boot_mask;
>> - if (masked == mx28_boot_modes[i].boot_pads)
>> + for (i = 0; i < ARRAY_SIZE(mxs_boot_modes); i++) {
>> + masked = bootmode & mxs_boot_modes[i].boot_mask;
>> + if (masked == mxs_boot_modes[i].boot_pads)
>
> mxs_boot_modes? They're different for mx23 and mx28!

Yes, they're but the structure is the same so we can use same symbol
and have a different mxs_boot_modes matrix for each.

>>   break;
>>   }
>>
> [...]
>
> Rest seems fine
>
> Best regards,
> Marek Vasut

-- 
Otavio Salvador O.S. Systems
E-mail: ota...@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854  http://projetos.ossystems.com.br
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v1 3/3] mxs: Convert sys_proto.h prefixes to 'mxs'

2012-08-13 Thread Marek Vasut
Dear Otavio Salvador,

[...]

> diff --git a/arch/arm/cpu/arm926ejs/mxs/spl_boot.c
> b/arch/arm/cpu/arm926ejs/mxs/spl_boot.c index 84d4a17..ddafddb 100644
> --- a/arch/arm/cpu/arm926ejs/mxs/spl_boot.c
> +++ b/arch/arm/cpu/arm926ejs/mxs/spl_boot.c
> @@ -82,9 +82,9 @@ uint8_t mxs_get_bootmode_index(void)
>   bootmode |= (gpio_get_value(MX28_PAD_LCD_D04__GPIO_1_4) ? 1 : 0) << 4;
>   bootmode |= (gpio_get_value(MX28_PAD_LCD_D05__GPIO_1_5) ? 1 : 0) << 5;
> 
> - for (i = 0; i < ARRAY_SIZE(mx28_boot_modes); i++) {
> - masked = bootmode & mx28_boot_modes[i].boot_mask;
> - if (masked == mx28_boot_modes[i].boot_pads)
> + for (i = 0; i < ARRAY_SIZE(mxs_boot_modes); i++) {
> + masked = bootmode & mxs_boot_modes[i].boot_mask;
> + if (masked == mxs_boot_modes[i].boot_pads)

mxs_boot_modes? They're different for mx23 and mx28!

>   break;
>   }
> 
[...]

Rest seems fine

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v1 3/3] mxs: Convert sys_proto.h prefixes to 'mxs'

2012-08-13 Thread Otavio Salvador
The sys_proto.h functions (except the boot modes) are compatible with
i.MX233 and i.MX28 so we use 'mxs' prefix for its methods.

Signed-off-by: Otavio Salvador 
---
 arch/arm/cpu/arm926ejs/mxs/mxs.c  |   32 ++---
 arch/arm/cpu/arm926ejs/mxs/spl_boot.c |6 +++---
 arch/arm/cpu/arm926ejs/mxs/timer.c|2 +-
 arch/arm/include/asm/arch-mxs/sys_proto.h |   20 +-
 board/bluegiga/apx4devkit/apx4devkit.c|2 +-
 drivers/dma/apbh_dma.c|4 ++--
 drivers/i2c/mxs_i2c.c |2 +-
 drivers/mmc/mxsmmc.c  |2 +-
 drivers/mtd/nand/mxs_nand.c   |6 +++---
 drivers/rtc/mxsrtc.c  |4 ++--
 drivers/spi/mxs_spi.c |8 
 11 files changed, 44 insertions(+), 44 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/mxs/mxs.c b/arch/arm/cpu/arm926ejs/mxs/mxs.c
index a61f75b..c028e5e 100644
--- a/arch/arm/cpu/arm926ejs/mxs/mxs.c
+++ b/arch/arm/cpu/arm926ejs/mxs/mxs.c
@@ -41,8 +41,8 @@ DECLARE_GLOBAL_DATA_PTR;
 /* 1 second delay should be plenty of time for block reset. */
 #defineRESET_MAX_TIMEOUT   100
 
-#defineMX28_BLOCK_SFTRST   (1 << 31)
-#defineMX28_BLOCK_CLKGATE  (1 << 30)
+#defineMXS_BLOCK_SFTRST(1 << 31)
+#defineMXS_BLOCK_CLKGATE   (1 << 30)
 
 /* Lowlevel init isn't used on i.MX28, so just have a dummy here */
 inline void lowlevel_init(void) {}
@@ -81,7 +81,7 @@ void enable_caches(void)
 #endif
 }
 
-int mx28_wait_mask_set(struct mxs_register_32 *reg, uint32_t mask, int timeout)
+int mxs_wait_mask_set(struct mxs_register_32 *reg, uint32_t mask, int timeout)
 {
while (--timeout) {
if ((readl(®->reg) & mask) == mask)
@@ -92,7 +92,7 @@ int mx28_wait_mask_set(struct mxs_register_32 *reg, uint32_t 
mask, int timeout)
return !timeout;
 }
 
-int mx28_wait_mask_clr(struct mxs_register_32 *reg, uint32_t mask, int timeout)
+int mxs_wait_mask_clr(struct mxs_register_32 *reg, uint32_t mask, int timeout)
 {
while (--timeout) {
if ((readl(®->reg) & mask) == 0)
@@ -103,34 +103,34 @@ int mx28_wait_mask_clr(struct mxs_register_32 *reg, 
uint32_t mask, int timeout)
return !timeout;
 }
 
-int mx28_reset_block(struct mxs_register_32 *reg)
+int mxs_reset_block(struct mxs_register_32 *reg)
 {
/* Clear SFTRST */
-   writel(MX28_BLOCK_SFTRST, ®->reg_clr);
+   writel(MXS_BLOCK_SFTRST, ®->reg_clr);
 
-   if (mx28_wait_mask_clr(reg, MX28_BLOCK_SFTRST, RESET_MAX_TIMEOUT))
+   if (mxs_wait_mask_clr(reg, MXS_BLOCK_SFTRST, RESET_MAX_TIMEOUT))
return 1;
 
/* Clear CLKGATE */
-   writel(MX28_BLOCK_CLKGATE, ®->reg_clr);
+   writel(MXS_BLOCK_CLKGATE, ®->reg_clr);
 
/* Set SFTRST */
-   writel(MX28_BLOCK_SFTRST, ®->reg_set);
+   writel(MXS_BLOCK_SFTRST, ®->reg_set);
 
/* Wait for CLKGATE being set */
-   if (mx28_wait_mask_set(reg, MX28_BLOCK_CLKGATE, RESET_MAX_TIMEOUT))
+   if (mxs_wait_mask_set(reg, MXS_BLOCK_CLKGATE, RESET_MAX_TIMEOUT))
return 1;
 
/* Clear SFTRST */
-   writel(MX28_BLOCK_SFTRST, ®->reg_clr);
+   writel(MXS_BLOCK_SFTRST, ®->reg_clr);
 
-   if (mx28_wait_mask_clr(reg, MX28_BLOCK_SFTRST, RESET_MAX_TIMEOUT))
+   if (mxs_wait_mask_clr(reg, MXS_BLOCK_SFTRST, RESET_MAX_TIMEOUT))
return 1;
 
/* Clear CLKGATE */
-   writel(MX28_BLOCK_CLKGATE, ®->reg_clr);
+   writel(MXS_BLOCK_CLKGATE, ®->reg_clr);
 
-   if (mx28_wait_mask_clr(reg, MX28_BLOCK_CLKGATE, RESET_MAX_TIMEOUT))
+   if (mxs_wait_mask_clr(reg, MXS_BLOCK_CLKGATE, RESET_MAX_TIMEOUT))
return 1;
 
return 0;
@@ -229,7 +229,7 @@ int print_cpuinfo(void)
get_cpu_type(),
get_cpu_rev(),
mxc_get_clock(MXC_ARM_CLK) / 100);
-   printf("BOOT:  %s\n", mx28_boot_modes[data->boot_mode_idx].mode);
+   printf("BOOT:  %s\n", mxs_boot_modes[data->boot_mode_idx].mode);
return 0;
 }
 #endif
@@ -299,7 +299,7 @@ void imx_get_mac_from_fuse(int dev_id, unsigned char *mac)
 
writel(OCOTP_CTRL_RD_BANK_OPEN, &ocotp_regs->hw_ocotp_ctrl_set);
 
-   if (mx28_wait_mask_clr(&ocotp_regs->hw_ocotp_ctrl_reg, OCOTP_CTRL_BUSY,
+   if (mxs_wait_mask_clr(&ocotp_regs->hw_ocotp_ctrl_reg, OCOTP_CTRL_BUSY,
MXS_OCOTP_MAX_TIMEOUT)) {
printf("MXS FEC: Can't get MAC from OCOTP\n");
return;
diff --git a/arch/arm/cpu/arm926ejs/mxs/spl_boot.c 
b/arch/arm/cpu/arm926ejs/mxs/spl_boot.c
index 84d4a17..ddafddb 100644
--- a/arch/arm/cpu/arm926ejs/mxs/spl_boot.c
+++ b/arch/arm/cpu/arm926ejs/mxs/spl_boot.c
@@ -82,9 +82,9 @@ uint8_t mxs_get_bootmode_index(void)
bootmode |= (gpio_get_value(MX28_PAD_LCD_D04__GPIO_1_4) ? 1 : 0) << 4;
bootmode |= (gpio_get_value(MX28_PAD_LCD_D05