diff mbox

[U-Boot,2/4,v3] i.MX28: Fix ref_cpu clock setup

Message ID 1328540291-24271-1-git-send-email-robert@delien.nl
State Changes Requested
Headers show

Commit Message

Robert Deliƫn Feb. 6, 2012, 2:58 p.m. UTC
From: Robert Delien <robert@delien.nl>

Introducing 8-bit wide register, mx28_register_8.

---
 arch/arm/include/asm/arch-mx28/regs-common.h |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

Comments

Marek Vasut Feb. 6, 2012, 3:33 p.m. UTC | #1
> From: Robert Delien <robert@delien.nl>
> 
> Introducing 8-bit wide register, mx28_register_8.
> 
> ---
>  arch/arm/include/asm/arch-mx28/regs-common.h |   16 ++++++++++++++++
>  1 files changed, 16 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/include/asm/arch-mx28/regs-common.h
> b/arch/arm/include/asm/arch-mx28/regs-common.h index 75cc9a6..d2e1953
> 100644
> --- a/arch/arm/include/asm/arch-mx28/regs-common.h
> +++ b/arch/arm/include/asm/arch-mx28/regs-common.h
> @@ -47,16 +47,32 @@
>   *
>   */
> 
> +#define	__mx28_reg_8(name)		\
> +	uint8_t	name[4];		\
> +	uint8_t	name##_set[4];		\
> +	uint8_t	name##_clr[4];		\
> +	uint8_t	name##_tog[4];		\
> +
>  #define	__mx28_reg_32(name)		\
>  	uint32_t name;			\
>  	uint32_t name##_set;		\
>  	uint32_t name##_clr;		\
>  	uint32_t name##_tog;
> 
> +struct mx28_register_8 {
> +	__mx28_reg_8(reg)
> +};
> +
>  struct mx28_register_32 {
>  	__mx28_reg_32(reg)
>  };
> 
> +#define	mx28_reg_8(name)				\
> +	union {						\
> +		struct { __mx28_reg_8(name) };		\
> +		struct mx28_register_8 name##_reg;	\

Will this kind of access (via register.reg) even work? I think we should replace 
it with register_32.

> +	};
> +
>  #define	mx28_reg_32(name)				\
>  	union {						\
>  		struct { __mx28_reg_32(name) };		\
diff mbox

Patch

diff --git a/arch/arm/include/asm/arch-mx28/regs-common.h b/arch/arm/include/asm/arch-mx28/regs-common.h
index 75cc9a6..d2e1953 100644
--- a/arch/arm/include/asm/arch-mx28/regs-common.h
+++ b/arch/arm/include/asm/arch-mx28/regs-common.h
@@ -47,16 +47,32 @@ 
  *
  */
 
+#define	__mx28_reg_8(name)		\
+	uint8_t	name[4];		\
+	uint8_t	name##_set[4];		\
+	uint8_t	name##_clr[4];		\
+	uint8_t	name##_tog[4];		\
+
 #define	__mx28_reg_32(name)		\
 	uint32_t name;			\
 	uint32_t name##_set;		\
 	uint32_t name##_clr;		\
 	uint32_t name##_tog;
 
+struct mx28_register_8 {
+	__mx28_reg_8(reg)
+};
+
 struct mx28_register_32 {
 	__mx28_reg_32(reg)
 };
 
+#define	mx28_reg_8(name)				\
+	union {						\
+		struct { __mx28_reg_8(name) };		\
+		struct mx28_register_8 name##_reg;	\
+	};
+
 #define	mx28_reg_32(name)				\
 	union {						\
 		struct { __mx28_reg_32(name) };		\