public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH-OMAP3 2/2] OMAP3: Convert register access to	structure style, part #2
Date: Sat, 6 Dec 2008 18:40:09 +0100	[thread overview]
Message-ID: <20081206174009.GF2977@game.jcrosoft.org> (raw)
In-Reply-To: <1228064004-8311-1-git-send-email-dirk.behme@googlemail.com>

> ===================================================================
> --- u-boot-arm.orig/include/asm-arm/arch-omap3/omap3.h
> +++ u-boot-arm/include/asm-arm/arch-omap3/omap3.h
> @@ -75,7 +75,15 @@
>  
>  /* 32KTIMER */
>  #define SYNC_32KTIMER_BASE		0x48320000
> -#define S32K_CR				0x10
> +
> +#ifndef __ASSEMBLY__
> +
> +typedef struct s32ktimer {
> +	unsigned char res[0x10];
> +	unsigned int s32k_cr;		/* 0x10 */
> +} s32ktimer_t;

I'm not a fan of typedef struct
I prefer struct
> +
> +#endif /* __ASSEMBLY__ */
>  
>  /* OMAP3 GPIO registers */
>  #define OMAP34XX_GPIO1_BASE		0x48310000
> @@ -85,9 +93,15 @@
>  #define OMAP34XX_GPIO5_BASE		0x49056000
>  #define OMAP34XX_GPIO6_BASE		0x49058000
>  
> -#define GPIO_OE				0x34
> -#define GPIO_CLEARDATAOUT		0x90
> -#define GPIO_SETDATAOUT			0x94
> +#ifndef __ASSEMBLY__
> +typedef struct gpio {
> +	unsigned char res1[0x34];
> +	unsigned int oe;		/* 0x34 */
> +	unsigned char res2[0x58];
> +	unsigned int cleardataout;	/* 0x90 */
> +	unsigned int setdataout;	/* 0x94 */
> +} gpio_t;
> +#endif /* __ASSEMBLY__ */
>  
>  #define GPIO0				(0x1 << 0)
>  #define GPIO1				(0x1 << 1)
> Index: u-boot-arm/include/asm-arm/arch-omap3/mem.h
> ===================================================================
> --- u-boot-arm.orig/include/asm-arm/arch-omap3/mem.h
> +++ u-boot-arm/include/asm-arm/arch-omap3/mem.h
> @@ -25,18 +25,19 @@
>  #ifndef _MEM_H_
>  #define _MEM_H_
>  
> -#define SDRC_CS0_OSET	0x0
> -#define SDRC_CS1_OSET	0x30 /* mirror CS1 regs appear offset 0x30 from CS0 */
> +//#define SDRC_CS0_OSET	0x0
> +//#define SDRC_CS1_OSET	0x30 /* mirror CS1 regs appear offset 0x30 from CS0 */
please remove if not need
>  
> -#ifndef __ASSEMBLY__
> +#define CS0		0x0
> +#define CS1		0x1 /* mirror CS1 regs appear offset 0x30 from CS0 */
>  
> +#ifndef __ASSEMBLY__
>  typedef enum {
>  	STACKED = 0,
>  	IP_DDR = 1,
>  	COMBO_DDR = 2,
>  	IP_SDR = 3,
>  } mem_t;
> -
>  #endif /* __ASSEMBLY__ */
>  
>  #define EARLY_INIT	1

Best Regards,
J.

      reply	other threads:[~2008-12-06 17:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-30 16:53 [U-Boot] [PATCH-OMAP3 2/2] OMAP3: Convert register access to structure style, part #2 Dirk Behme
2008-12-06 17:40 ` Jean-Christophe PLAGNIOL-VILLARD [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081206174009.GF2977@game.jcrosoft.org \
    --to=plagnioj@jcrosoft.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox