Message ID | 1370000944-19786-4-git-send-email-tushar.behera@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Hi, On 05/31/2013 01:49 PM, Tushar Behera wrote: > The uncompress code in S5P64X0 is almost same as the uncompress code > defined in plat-samsung. Better to reuse that code. > > Signed-off-by: Tushar Behera<tushar.behera@linaro.org> > --- > arch/arm/mach-s5p64x0/include/mach/uncompress.h | 163 ++--------------------- > 1 file changed, 8 insertions(+), 155 deletions(-) Not sure if you are aware of it, Tomasz has already posted a patch that removes this duplicated code: https://patchwork.kernel.org/patch/2589331 I think that patch is not yet merged though. Regards, Sylwester -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 06/01/2013 02:11 PM, Sylwester Nawrocki wrote: > Hi, > > On 05/31/2013 01:49 PM, Tushar Behera wrote: >> The uncompress code in S5P64X0 is almost same as the uncompress code >> defined in plat-samsung. Better to reuse that code. >> >> Signed-off-by: Tushar Behera<tushar.behera@linaro.org> >> --- >> arch/arm/mach-s5p64x0/include/mach/uncompress.h | 163 >> ++--------------------- >> 1 file changed, 8 insertions(+), 155 deletions(-) > > Not sure if you are aware of it, Tomasz has already posted a patch that > removes this duplicated code: https://patchwork.kernel.org/patch/2589331 > I think that patch is not yet merged though. > > Regards, > Sylwester Tomasz, I had somehow missed that mail. The patch that I have additionally makes calculation of uart_base conditional on DEBUG_LL in line with the rest of the patches. Would you mind re-spining your patch with those changes? Alternately, I can take your patch and do above modifications in them. Let me know your opinion on this.
Hi Tushar, On Monday 03 of June 2013 09:48:07 Tushar Behera wrote: > On 06/01/2013 02:11 PM, Sylwester Nawrocki wrote: > > Hi, > > > > On 05/31/2013 01:49 PM, Tushar Behera wrote: > >> The uncompress code in S5P64X0 is almost same as the uncompress code > >> defined in plat-samsung. Better to reuse that code. > >> > >> Signed-off-by: Tushar Behera<tushar.behera@linaro.org> > >> --- > >> > >> arch/arm/mach-s5p64x0/include/mach/uncompress.h | 163 > >> > >> ++--------------------- > >> > >> 1 file changed, 8 insertions(+), 155 deletions(-) > > > > Not sure if you are aware of it, Tomasz has already posted a patch that > > removes this duplicated code: https://patchwork.kernel.org/patch/2589331 > > I think that patch is not yet merged though. > > > > Regards, > > Sylwester > > Tomasz, > > I had somehow missed that mail. > > The patch that I have additionally makes calculation of uart_base > conditional on DEBUG_LL in line with the rest of the patches. > > Would you mind re-spining your patch with those changes? > > Alternately, I can take your patch and do above modifications in them. Unfortunately I'm unlikely to find time to do it myself in nearest future, so feel free to do it. Thanks. Keep in mind, however, that this patch was a dependency of [PATCH 0/6] Samsung watchdog support clean-up http://thread.gmane.org/gmane.linux.kernel.samsung-soc/18736/focus=18951 so I would like to keep this series applicable. Best regards,
>> >> Tomasz, >> >> I had somehow missed that mail. >> >> The patch that I have additionally makes calculation of uart_base >> conditional on DEBUG_LL in line with the rest of the patches. >> >> Would you mind re-spining your patch with those changes? >> >> Alternately, I can take your patch and do above modifications in them. > > Unfortunately I'm unlikely to find time to do it myself in nearest future, so > feel free to do it. Thanks. > > Keep in mind, however, that this patch was a dependency of > > [PATCH 0/6] Samsung watchdog support clean-up > http://thread.gmane.org/gmane.linux.kernel.samsung-soc/18736/focus=18951 > > so I would like to keep this series applicable. > Sure. I will ensure that there is minimal change to the original patch that you submitted. > Best regards, >
diff --git a/arch/arm/mach-s5p64x0/include/mach/uncompress.h b/arch/arm/mach-s5p64x0/include/mach/uncompress.h index 19e0d64..b28a551 100644 --- a/arch/arm/mach-s5p64x0/include/mach/uncompress.h +++ b/arch/arm/mach-s5p64x0/include/mach/uncompress.h @@ -14,171 +14,24 @@ #define __ASM_ARCH_UNCOMPRESS_H #include <mach/map.h> +#include <plat/uncompress.h> -/* - * cannot use commonly <plat/uncompress.h> - * because uart base of S5P6440 and S5P6450 is different - */ - -typedef unsigned int upf_t; /* cannot include linux/serial_core.h */ - -/* uart setup */ - -unsigned int fifo_mask; -unsigned int fifo_max; - -/* forward declerations */ - -static void arch_detect_cpu(void); - -/* defines for UART registers */ - -#include <plat/regs-serial.h> -#include <plat/regs-watchdog.h> - -/* working in physical space... */ -#undef S3C2410_WDOGREG -#define S3C2410_WDOGREG(x) ((S3C24XX_PA_WATCHDOG + (x))) - -/* how many bytes we allow into the FIFO at a time in FIFO mode */ -#define FIFO_MAX (14) - -unsigned long uart_base; - -static __inline__ void get_uart_base(void) +static void arch_detect_cpu(void) { unsigned int chipid; chipid = *(const volatile unsigned int __force *) 0xE0100118; - uart_base = S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT; - +#ifdef DEBUG_LL if ((chipid & 0xff000) == 0x50000) - uart_base += 0xEC800000; + uart_base = S5P6450_PA_UART(CONFIG_S3C_LOWLEVEL_UART_PORT); else - uart_base += 0xEC000000; -} - -static __inline__ void uart_wr(unsigned int reg, unsigned int val) -{ - volatile unsigned int *ptr; - - get_uart_base(); - ptr = (volatile unsigned int *)(reg + uart_base); - *ptr = val; -} - -static __inline__ unsigned int uart_rd(unsigned int reg) -{ - volatile unsigned int *ptr; - - get_uart_base(); - ptr = (volatile unsigned int *)(reg + uart_base); - return *ptr; -} - -/* - * we can deal with the case the UARTs are being run - * in FIFO mode, so that we don't hold up our execution - * waiting for tx to happen... - */ - -static void putc(int ch) -{ - if (uart_rd(S3C2410_UFCON) & S3C2410_UFCON_FIFOMODE) { - int level; - - while (1) { - level = uart_rd(S3C2410_UFSTAT); - level &= fifo_mask; - - if (level < fifo_max) - break; - } - - } else { - /* not using fifos */ - - while ((uart_rd(S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXE) != S3C2410_UTRSTAT_TXE) - barrier(); - } - - /* write byte to transmission register */ - uart_wr(S3C2410_UTXH, ch); -} - -static inline void flush(void) -{ -} - -#define __raw_writel(d, ad) \ - do { \ - *((volatile unsigned int __force *)(ad)) = (d); \ - } while (0) - - -#ifdef CONFIG_S3C_BOOT_ERROR_RESET - -static void arch_decomp_error(const char *x) -{ - putstr("\n\n"); - putstr(x); - putstr("\n\n -- System resetting\n"); - - __raw_writel(0x4000, S3C2410_WTDAT); - __raw_writel(0x4000, S3C2410_WTCNT); - __raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x40), S3C2410_WTCON); - - while(1); -} - -#define arch_error arch_decomp_error -#endif - -#ifdef CONFIG_S3C_BOOT_UART_FORCE_FIFO -static inline void arch_enable_uart_fifo(void) -{ - u32 fifocon = uart_rd(S3C2410_UFCON); - - if (!(fifocon & S3C2410_UFCON_FIFOMODE)) { - fifocon |= S3C2410_UFCON_RESETBOTH; - uart_wr(S3C2410_UFCON, fifocon); - - /* wait for fifo reset to complete */ - while (1) { - fifocon = uart_rd(S3C2410_UFCON); - if (!(fifocon & S3C2410_UFCON_RESETBOTH)) - break; - } - } -} + uart_base = S5P6440_PA_UART(CONFIG_S3C_LOWLEVEL_UART_PORT); #else -#define arch_enable_uart_fifo() do { } while(0) + uart_base = NULL; #endif -static void arch_decomp_setup(void) -{ - /* - * we may need to setup the uart(s) here if we are not running - * on an BAST... the BAST will have left the uarts configured - * after calling linux. - */ - - arch_detect_cpu(); - - /* - * Enable the UART FIFOs if they where not enabled and our - * configuration says we should turn them on. - */ - - arch_enable_uart_fifo(); + fifo_mask = S3C2440_UFSTAT_TXMASK; + fifo_max = 63 << S3C2440_UFSTAT_TXSHIFT; } - - - -static void arch_detect_cpu(void) -{ - /* we do not need to do any cpu detection here at the moment. */ -} - #endif /* __ASM_ARCH_UNCOMPRESS_H */
The uncompress code in S5P64X0 is almost same as the uncompress code defined in plat-samsung. Better to reuse that code. Signed-off-by: Tushar Behera <tushar.behera@linaro.org> --- arch/arm/mach-s5p64x0/include/mach/uncompress.h | 163 ++--------------------- 1 file changed, 8 insertions(+), 155 deletions(-)