[U-Boot] [PATCH-ARM] Add support for Embest SBC2440-II Board 2/7

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Wed Jul 8 22:50:22 CEST 2009


On 01:35 Thu 25 Jun     , kevin.morfitt at fearnside-systems.co.uk wrote:
> 
> This patch re-formats the s3c24x0 header files in preparation for changes 
> to add support for the Embest SBC2440-II Board.
> 
> The changes are as follows:
> 
> - re-indent the code using Lindent
> - make sure register layouts are defined using a C struct, from a 
>   comment by Wolfgang on 03/06/2009
> - replace the upper-case typedef'ed C struct names with lower case 
>   non-typedef'ed ones, from a comment by Scott on 22/06/2009
> - make sure registers are accessed using the proper accessor 
>   functions, from a comment by Wolfgang on 03/06/2009
> - run checkpatch.pl and fix any error reports
> 
> Signed-off-by: Kevin Morfitt <kevin.morfitt at fearnside-systems.co.uk>
> ---
>  include/s3c2400.h |  493 ++++----------------------------------------
>  include/s3c2410.h |  158 ++++-----------
>  include/s3c24x0.h |  595 +++++------------------------------------------------
>  3 files changed, 130 insertions(+), 1116 deletions(-)
> 
> diff --git a/include/s3c2400.h b/include/s3c2400.h
> index 4fdc62e..89027fa 100644
> --- a/include/s3c2400.h
> +++ b/include/s3c2400.h
> @@ -35,12 +35,12 @@
>  #define S3C24X0_SPI_CHANNELS	1
>  #define PALETTE			(0x14A00400)	/* SJS */
>  
> -typedef enum {
> +enum s3c24x0_uarts_nr {
>  	S3C24X0_UART0,
>  	S3C24X0_UART1,
> -} S3C24X0_UARTS_NR;
> +};
>  
> -/* S3C2400 device base addresses */
> +/*S3C2400 device base addresses */
>  #define S3C24X0_MEMCTL_BASE		0x14000000
>  #define S3C24X0_USB_HOST_BASE		0x14200000
>  #define S3C24X0_INTERRUPT_BASE		0x14400000
> @@ -63,492 +63,73 @@ typedef enum {
>  #include <s3c24x0.h>
>  
>  
> -static inline S3C24X0_MEMCTL * S3C24X0_GetBase_MEMCTL(void)
> +static inline struct s3c24x0_memctl *S3C24X0_GetBase_MEMCTL(void)
please no uppercase in the function name
>  {
> -	return (S3C24X0_MEMCTL * const)S3C24X0_MEMCTL_BASE;
> +	return (struct s3c24x0_memctl *)S3C24X0_MEMCTL_BASE;
>  }

> diff --git a/include/s3c24x0.h b/include/s3c24x0.h
> index 71f35a5..b34c880 100644
> --- a/include/s3c24x0.h
> +++ b/include/s3c24x0.h
> @@ -36,18 +36,18 @@ typedef volatile u16	S3C24X0_REG16;
>  typedef volatile u32	S3C24X0_REG32;
>  
>  /* Memory controller (see manual chapter 5) */
> -typedef struct {
> +struct s3c24x0_memctl {
>  	S3C24X0_REG32	BWSCON;
please remove the S3C24X0_REG32
please use u32 or other proper type
please no uppercase in entry name too
>  	S3C24X0_REG32	BANKCON[8];
>  	S3C24X0_REG32	REFRESH;
>  	S3C24X0_REG32	BANKSIZE;
>  	S3C24X0_REG32	MRSRB6;
>  	S3C24X0_REG32	MRSRB7;

Best Regards,
J.


More information about the U-Boot mailing list