All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] powerpc: Rework interrupt_init_cpu()
@ 2017-08-14  2:44 Tom Rini
  2017-08-14  2:44 ` [U-Boot] [PATCH 2/2] powerpc: Rework cpu_init_f() to take no arguments Tom Rini
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Tom Rini @ 2017-08-14  2:44 UTC (permalink / raw)
  To: u-boot

The function interrupt_init_cpu() is given an int return type but does
not return anything but 0.  Rework this to be a void function.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 arch/powerpc/cpu/mpc83xx/interrupts.c | 4 +---
 arch/powerpc/cpu/mpc85xx/interrupts.c | 4 +---
 arch/powerpc/cpu/mpc86xx/interrupts.c | 4 +---
 arch/powerpc/cpu/mpc8xx/interrupts.c  | 4 +---
 arch/powerpc/include/asm/ppc.h        | 2 +-
 arch/powerpc/lib/interrupts.c         | 7 +------
 6 files changed, 6 insertions(+), 19 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/interrupts.c b/arch/powerpc/cpu/mpc83xx/interrupts.c
index 668aa020889e..50503b4d2c0f 100644
--- a/arch/powerpc/cpu/mpc83xx/interrupts.c
+++ b/arch/powerpc/cpu/mpc83xx/interrupts.c
@@ -20,7 +20,7 @@ struct irq_action {
 	ulong count;
 };
 
-int interrupt_init_cpu (unsigned *decrementer_count)
+void interrupt_init_cpu (unsigned *decrementer_count)
 {
 	volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
 
@@ -29,8 +29,6 @@ int interrupt_init_cpu (unsigned *decrementer_count)
 	/* Enable e300 time base */
 
 	immr->sysconf.spcr |= 0x00400000;
-
-	return 0;
 }
 
 
diff --git a/arch/powerpc/cpu/mpc85xx/interrupts.c b/arch/powerpc/cpu/mpc85xx/interrupts.c
index cf730c5c53cb..b92549000fbc 100644
--- a/arch/powerpc/cpu/mpc85xx/interrupts.c
+++ b/arch/powerpc/cpu/mpc85xx/interrupts.c
@@ -20,7 +20,7 @@
 #include <post.h>
 #endif
 
-int interrupt_init_cpu(unsigned *decrementer_count)
+void interrupt_init_cpu(unsigned *decrementer_count)
 {
 	ccsr_pic_t __iomem *pic = (void *)CONFIG_SYS_MPC8xxx_PIC_ADDR;
 
@@ -77,8 +77,6 @@ int interrupt_init_cpu(unsigned *decrementer_count)
 #ifdef CONFIG_POST
 	post_word_store(post_word);
 #endif
-
-	return (0);
 }
 
 /* Install and free a interrupt handler. Not implemented yet. */
diff --git a/arch/powerpc/cpu/mpc86xx/interrupts.c b/arch/powerpc/cpu/mpc86xx/interrupts.c
index a6db0baab33f..81874790ff35 100644
--- a/arch/powerpc/cpu/mpc86xx/interrupts.c
+++ b/arch/powerpc/cpu/mpc86xx/interrupts.c
@@ -23,7 +23,7 @@
 #include <post.h>
 #endif
 
-int interrupt_init_cpu(unsigned *decrementer_count)
+void interrupt_init_cpu(unsigned *decrementer_count)
 {
 	volatile immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
 	volatile ccsr_pic_t *pic = &immr->im_pic;
@@ -73,8 +73,6 @@ int interrupt_init_cpu(unsigned *decrementer_count)
 #ifdef CONFIG_POST
 	post_word_store(post_word);
 #endif
-
-	return 0;
 }
 
 /*
diff --git a/arch/powerpc/cpu/mpc8xx/interrupts.c b/arch/powerpc/cpu/mpc8xx/interrupts.c
index e8e287a13fa8..846148ab9867 100644
--- a/arch/powerpc/cpu/mpc8xx/interrupts.c
+++ b/arch/powerpc/cpu/mpc8xx/interrupts.c
@@ -30,7 +30,7 @@ static void cpm_interrupt(void *regs);
 
 /************************************************************************/
 
-int interrupt_init_cpu(unsigned *decrementer_count)
+void interrupt_init_cpu(unsigned *decrementer_count)
 {
 	immap_t __iomem *immr = (immap_t __iomem *)CONFIG_SYS_IMMR;
 
@@ -41,8 +41,6 @@ int interrupt_init_cpu(unsigned *decrementer_count)
 
 	/* Configure CPM interrupts */
 	cpm_interrupt_init();
-
-	return 0;
 }
 
 /************************************************************************/
diff --git a/arch/powerpc/include/asm/ppc.h b/arch/powerpc/include/asm/ppc.h
index 850fe93f9798..5e0aa08be936 100644
--- a/arch/powerpc/include/asm/ppc.h
+++ b/arch/powerpc/include/asm/ppc.h
@@ -122,7 +122,7 @@ static inline void set_msr(unsigned long msr)
 void print_reginfo(void);
 #endif
 
-int interrupt_init_cpu(unsigned *);
+void interrupt_init_cpu(unsigned *);
 void timer_interrupt_cpu(struct pt_regs *);
 unsigned long search_exception_table(unsigned long addr);
 
diff --git a/arch/powerpc/lib/interrupts.c b/arch/powerpc/lib/interrupts.c
index 46fa18c63fb0..e8784aa16e9c 100644
--- a/arch/powerpc/lib/interrupts.c
+++ b/arch/powerpc/lib/interrupts.c
@@ -63,13 +63,8 @@ int disable_interrupts (void)
 
 int interrupt_init (void)
 {
-	int ret;
-
 	/* call cpu specific function from $(CPU)/interrupts.c */
-	ret = interrupt_init_cpu (&decrementer_count);
-
-	if (ret)
-		return ret;
+	interrupt_init_cpu (&decrementer_count);
 
 	set_dec (decrementer_count);
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 2/2] powerpc: Rework cpu_init_f() to take no arguments
  2017-08-14  2:44 [U-Boot] [PATCH 1/2] powerpc: Rework interrupt_init_cpu() Tom Rini
@ 2017-08-14  2:44 ` Tom Rini
  2017-08-14  6:20   ` Christophe LEROY
  2017-08-14  6:55 ` [U-Boot] [PATCH 1/2] powerpc: Rework interrupt_init_cpu() Mario Six
  2017-08-26 20:45 ` [U-Boot] [U-Boot,1/2] " Tom Rini
  2 siblings, 1 reply; 6+ messages in thread
From: Tom Rini @ 2017-08-14  2:44 UTC (permalink / raw)
  To: u-boot

The function cpu_init_f() is called slightly differently on different
PowerPC platforms.  In some cases the function needs to make use of the
IMMR and in other cases it does not.  Rather than pass the IMMR location
as the function argument and then ignore it on some platforms, allow the
function to use the location as needed as it is a constant.

Cc: Mario Six <mario.six@gdsys.cc>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
 arch/powerpc/cpu/mpc83xx/cpu_init.c    | 4 +++-
 arch/powerpc/cpu/mpc83xx/spl_minimal.c | 4 +++-
 arch/powerpc/cpu/mpc83xx/start.S       | 2 --
 arch/powerpc/cpu/mpc85xx/cpu_init.c    | 4 +---
 arch/powerpc/cpu/mpc8xx/cpu_init.c     | 4 +++-
 arch/powerpc/cpu/mpc8xx/start.S        | 1 -
 arch/powerpc/include/asm/ppc.h         | 1 +
 7 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/cpu_init.c b/arch/powerpc/cpu/mpc83xx/cpu_init.c
index 2a9db0c51b89..f09a96b9abff 100644
--- a/arch/powerpc/cpu/mpc83xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc83xx/cpu_init.c
@@ -46,8 +46,10 @@ static void config_qe_ioports(void)
  * initialize a bunch of registers,
  * initialize the UPM's
  */
-void cpu_init_f (volatile immap_t * im)
+void cpu_init_f (void)
 {
+	volatile immap_t *im = (void *)(CONFIG_SYS_IMMR);
+
 	__be32 acr_mask =
 #ifdef CONFIG_SYS_ACR_PIPE_DEP /* Arbiter pipeline depth */
 		ACR_PIPE_DEP |
diff --git a/arch/powerpc/cpu/mpc83xx/spl_minimal.c b/arch/powerpc/cpu/mpc83xx/spl_minimal.c
index 1c65e4cb78dd..ce751d3bdf9f 100644
--- a/arch/powerpc/cpu/mpc83xx/spl_minimal.c
+++ b/arch/powerpc/cpu/mpc83xx/spl_minimal.c
@@ -16,8 +16,10 @@ DECLARE_GLOBAL_DATA_PTR;
  * initialize a bunch of registers,
  * initialize the UPM's
  */
-void cpu_init_f (volatile immap_t * im)
+void cpu_init_f (void)
 {
+	volatile immap_t *im = (void *)(CONFIG_SYS_IMMR);
+
 	/* Pointer is writable since we allocated a register for it */
 	gd = (gd_t *) (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET);
 
diff --git a/arch/powerpc/cpu/mpc83xx/start.S b/arch/powerpc/cpu/mpc83xx/start.S
index d2fced8aba86..8d10c50f6912 100644
--- a/arch/powerpc/cpu/mpc83xx/start.S
+++ b/arch/powerpc/cpu/mpc83xx/start.S
@@ -290,8 +290,6 @@ in_flash:
 
 	GET_GOT			/* initialize GOT access	*/
 
-	/* r3: IMMR */
-	lis	r3, CONFIG_SYS_IMMR at h
 	/* run low-level CPU init code (in Flash)*/
 	bl	cpu_init_f
 
diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init.c b/arch/powerpc/cpu/mpc85xx/cpu_init.c
index a3076d8d7100..2db8f1f91fe2 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu_init.c
@@ -435,7 +435,7 @@ void fsl_erratum_a007212_workaround(void)
 }
 #endif
 
-ulong cpu_init_f(void)
+void cpu_init_f(void)
 {
 	extern void m8560_cpm_reset (void);
 #ifdef CONFIG_SYS_DCSRBAR_PHYS
@@ -507,8 +507,6 @@ ulong cpu_init_f(void)
 #ifdef CONFIG_SYS_FSL_ERRATUM_A007212
 	fsl_erratum_a007212_workaround();
 #endif
-
-	return 0;
 }
 
 /* Implement a dummy function for those platforms w/o SERDES */
diff --git a/arch/powerpc/cpu/mpc8xx/cpu_init.c b/arch/powerpc/cpu/mpc8xx/cpu_init.c
index dc601a12976f..c1cd2fac36f4 100644
--- a/arch/powerpc/cpu/mpc8xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc8xx/cpu_init.c
@@ -19,8 +19,10 @@
  * initialize a bunch of registers,
  * initialize the UPM's
  */
-void cpu_init_f(immap_t __iomem *immr)
+void cpu_init_f(void)
 {
+	volatile immap_t *immr = (void *)(CONFIG_SYS_IMMR);
+
 	memctl8xx_t __iomem *memctl = &immr->im_memctl;
 	ulong reg;
 
diff --git a/arch/powerpc/cpu/mpc8xx/start.S b/arch/powerpc/cpu/mpc8xx/start.S
index 202ea81ae498..f03bfe94f25b 100644
--- a/arch/powerpc/cpu/mpc8xx/start.S
+++ b/arch/powerpc/cpu/mpc8xx/start.S
@@ -158,7 +158,6 @@ in_flash:
 
 	GET_GOT			/* initialize GOT access			*/
 
-	/* r3: IMMR */
 	bl	cpu_init_f	/* run low-level CPU init code     (from Flash)	*/
 
 	bl	board_init_f	/* run 1st part of board init code (from Flash) */
diff --git a/arch/powerpc/include/asm/ppc.h b/arch/powerpc/include/asm/ppc.h
index 5e0aa08be936..615d7fda9324 100644
--- a/arch/powerpc/include/asm/ppc.h
+++ b/arch/powerpc/include/asm/ppc.h
@@ -122,6 +122,7 @@ static inline void set_msr(unsigned long msr)
 void print_reginfo(void);
 #endif
 
+void cpu_init_f(void);
 void interrupt_init_cpu(unsigned *);
 void timer_interrupt_cpu(struct pt_regs *);
 unsigned long search_exception_table(unsigned long addr);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 2/2] powerpc: Rework cpu_init_f() to take no arguments
  2017-08-14  2:44 ` [U-Boot] [PATCH 2/2] powerpc: Rework cpu_init_f() to take no arguments Tom Rini
@ 2017-08-14  6:20   ` Christophe LEROY
  2017-08-14  6:56     ` Mario Six
  0 siblings, 1 reply; 6+ messages in thread
From: Christophe LEROY @ 2017-08-14  6:20 UTC (permalink / raw)
  To: u-boot

Acked-by: Christophe Leroy <christophe.leroy@c-s.fr>


Le 14/08/2017 à 04:44, Tom Rini a écrit :
> The function cpu_init_f() is called slightly differently on different
> PowerPC platforms.  In some cases the function needs to make use of the
> IMMR and in other cases it does not.  Rather than pass the IMMR location
> as the function argument and then ignore it on some platforms, allow the
> function to use the location as needed as it is a constant.
> 
> Cc: Mario Six <mario.six@gdsys.cc>
> Cc: Wolfgang Denk <wd@denx.de>
> Cc: Christophe Leroy <christophe.leroy@c-s.fr>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
>   arch/powerpc/cpu/mpc83xx/cpu_init.c    | 4 +++-
>   arch/powerpc/cpu/mpc83xx/spl_minimal.c | 4 +++-
>   arch/powerpc/cpu/mpc83xx/start.S       | 2 --
>   arch/powerpc/cpu/mpc85xx/cpu_init.c    | 4 +---
>   arch/powerpc/cpu/mpc8xx/cpu_init.c     | 4 +++-
>   arch/powerpc/cpu/mpc8xx/start.S        | 1 -
>   arch/powerpc/include/asm/ppc.h         | 1 +
>   7 files changed, 11 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/powerpc/cpu/mpc83xx/cpu_init.c b/arch/powerpc/cpu/mpc83xx/cpu_init.c
> index 2a9db0c51b89..f09a96b9abff 100644
> --- a/arch/powerpc/cpu/mpc83xx/cpu_init.c
> +++ b/arch/powerpc/cpu/mpc83xx/cpu_init.c
> @@ -46,8 +46,10 @@ static void config_qe_ioports(void)
>    * initialize a bunch of registers,
>    * initialize the UPM's
>    */
> -void cpu_init_f (volatile immap_t * im)
> +void cpu_init_f (void)
>   {
> +	volatile immap_t *im = (void *)(CONFIG_SYS_IMMR);
> +
>   	__be32 acr_mask =
>   #ifdef CONFIG_SYS_ACR_PIPE_DEP /* Arbiter pipeline depth */
>   		ACR_PIPE_DEP |
> diff --git a/arch/powerpc/cpu/mpc83xx/spl_minimal.c b/arch/powerpc/cpu/mpc83xx/spl_minimal.c
> index 1c65e4cb78dd..ce751d3bdf9f 100644
> --- a/arch/powerpc/cpu/mpc83xx/spl_minimal.c
> +++ b/arch/powerpc/cpu/mpc83xx/spl_minimal.c
> @@ -16,8 +16,10 @@ DECLARE_GLOBAL_DATA_PTR;
>    * initialize a bunch of registers,
>    * initialize the UPM's
>    */
> -void cpu_init_f (volatile immap_t * im)
> +void cpu_init_f (void)
>   {
> +	volatile immap_t *im = (void *)(CONFIG_SYS_IMMR);
> +
>   	/* Pointer is writable since we allocated a register for it */
>   	gd = (gd_t *) (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET);
>   
> diff --git a/arch/powerpc/cpu/mpc83xx/start.S b/arch/powerpc/cpu/mpc83xx/start.S
> index d2fced8aba86..8d10c50f6912 100644
> --- a/arch/powerpc/cpu/mpc83xx/start.S
> +++ b/arch/powerpc/cpu/mpc83xx/start.S
> @@ -290,8 +290,6 @@ in_flash:
>   
>   	GET_GOT			/* initialize GOT access	*/
>   
> -	/* r3: IMMR */
> -	lis	r3, CONFIG_SYS_IMMR at h
>   	/* run low-level CPU init code (in Flash)*/
>   	bl	cpu_init_f
>   
> diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init.c b/arch/powerpc/cpu/mpc85xx/cpu_init.c
> index a3076d8d7100..2db8f1f91fe2 100644
> --- a/arch/powerpc/cpu/mpc85xx/cpu_init.c
> +++ b/arch/powerpc/cpu/mpc85xx/cpu_init.c
> @@ -435,7 +435,7 @@ void fsl_erratum_a007212_workaround(void)
>   }
>   #endif
>   
> -ulong cpu_init_f(void)
> +void cpu_init_f(void)
>   {
>   	extern void m8560_cpm_reset (void);
>   #ifdef CONFIG_SYS_DCSRBAR_PHYS
> @@ -507,8 +507,6 @@ ulong cpu_init_f(void)
>   #ifdef CONFIG_SYS_FSL_ERRATUM_A007212
>   	fsl_erratum_a007212_workaround();
>   #endif
> -
> -	return 0;
>   }
>   
>   /* Implement a dummy function for those platforms w/o SERDES */
> diff --git a/arch/powerpc/cpu/mpc8xx/cpu_init.c b/arch/powerpc/cpu/mpc8xx/cpu_init.c
> index dc601a12976f..c1cd2fac36f4 100644
> --- a/arch/powerpc/cpu/mpc8xx/cpu_init.c
> +++ b/arch/powerpc/cpu/mpc8xx/cpu_init.c
> @@ -19,8 +19,10 @@
>    * initialize a bunch of registers,
>    * initialize the UPM's
>    */
> -void cpu_init_f(immap_t __iomem *immr)
> +void cpu_init_f(void)
>   {
> +	volatile immap_t *immr = (void *)(CONFIG_SYS_IMMR);
> +
>   	memctl8xx_t __iomem *memctl = &immr->im_memctl;
>   	ulong reg;
>   
> diff --git a/arch/powerpc/cpu/mpc8xx/start.S b/arch/powerpc/cpu/mpc8xx/start.S
> index 202ea81ae498..f03bfe94f25b 100644
> --- a/arch/powerpc/cpu/mpc8xx/start.S
> +++ b/arch/powerpc/cpu/mpc8xx/start.S
> @@ -158,7 +158,6 @@ in_flash:
>   
>   	GET_GOT			/* initialize GOT access			*/
>   
> -	/* r3: IMMR */
>   	bl	cpu_init_f	/* run low-level CPU init code     (from Flash)	*/
>   
>   	bl	board_init_f	/* run 1st part of board init code (from Flash) */
> diff --git a/arch/powerpc/include/asm/ppc.h b/arch/powerpc/include/asm/ppc.h
> index 5e0aa08be936..615d7fda9324 100644
> --- a/arch/powerpc/include/asm/ppc.h
> +++ b/arch/powerpc/include/asm/ppc.h
> @@ -122,6 +122,7 @@ static inline void set_msr(unsigned long msr)
>   void print_reginfo(void);
>   #endif
>   
> +void cpu_init_f(void);
>   void interrupt_init_cpu(unsigned *);
>   void timer_interrupt_cpu(struct pt_regs *);
>   unsigned long search_exception_table(unsigned long addr);
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 1/2] powerpc: Rework interrupt_init_cpu()
  2017-08-14  2:44 [U-Boot] [PATCH 1/2] powerpc: Rework interrupt_init_cpu() Tom Rini
  2017-08-14  2:44 ` [U-Boot] [PATCH 2/2] powerpc: Rework cpu_init_f() to take no arguments Tom Rini
@ 2017-08-14  6:55 ` Mario Six
  2017-08-26 20:45 ` [U-Boot] [U-Boot,1/2] " Tom Rini
  2 siblings, 0 replies; 6+ messages in thread
From: Mario Six @ 2017-08-14  6:55 UTC (permalink / raw)
  To: u-boot

On Mon, Aug 14, 2017 at 4:44 AM, Tom Rini <trini@konsulko.com> wrote:
> The function interrupt_init_cpu() is given an int return type but does
> not return anything but 0.  Rework this to be a void function.
>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
>  arch/powerpc/cpu/mpc83xx/interrupts.c | 4 +---
>  arch/powerpc/cpu/mpc85xx/interrupts.c | 4 +---
>  arch/powerpc/cpu/mpc86xx/interrupts.c | 4 +---
>  arch/powerpc/cpu/mpc8xx/interrupts.c  | 4 +---
>  arch/powerpc/include/asm/ppc.h        | 2 +-
>  arch/powerpc/lib/interrupts.c         | 7 +------
>  6 files changed, 6 insertions(+), 19 deletions(-)
>
> diff --git a/arch/powerpc/cpu/mpc83xx/interrupts.c b/arch/powerpc/cpu/mpc83xx/interrupts.c
> index 668aa020889e..50503b4d2c0f 100644
> --- a/arch/powerpc/cpu/mpc83xx/interrupts.c
> +++ b/arch/powerpc/cpu/mpc83xx/interrupts.c
> @@ -20,7 +20,7 @@ struct irq_action {
>         ulong count;
>  };
>
> -int interrupt_init_cpu (unsigned *decrementer_count)
> +void interrupt_init_cpu (unsigned *decrementer_count)
>  {
>         volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
>
> @@ -29,8 +29,6 @@ int interrupt_init_cpu (unsigned *decrementer_count)
>         /* Enable e300 time base */
>
>         immr->sysconf.spcr |= 0x00400000;
> -
> -       return 0;
>  }
>
>
> diff --git a/arch/powerpc/cpu/mpc85xx/interrupts.c b/arch/powerpc/cpu/mpc85xx/interrupts.c
> index cf730c5c53cb..b92549000fbc 100644
> --- a/arch/powerpc/cpu/mpc85xx/interrupts.c
> +++ b/arch/powerpc/cpu/mpc85xx/interrupts.c
> @@ -20,7 +20,7 @@
>  #include <post.h>
>  #endif
>
> -int interrupt_init_cpu(unsigned *decrementer_count)
> +void interrupt_init_cpu(unsigned *decrementer_count)
>  {
>         ccsr_pic_t __iomem *pic = (void *)CONFIG_SYS_MPC8xxx_PIC_ADDR;
>
> @@ -77,8 +77,6 @@ int interrupt_init_cpu(unsigned *decrementer_count)
>  #ifdef CONFIG_POST
>         post_word_store(post_word);
>  #endif
> -
> -       return (0);
>  }
>
>  /* Install and free a interrupt handler. Not implemented yet. */
> diff --git a/arch/powerpc/cpu/mpc86xx/interrupts.c b/arch/powerpc/cpu/mpc86xx/interrupts.c
> index a6db0baab33f..81874790ff35 100644
> --- a/arch/powerpc/cpu/mpc86xx/interrupts.c
> +++ b/arch/powerpc/cpu/mpc86xx/interrupts.c
> @@ -23,7 +23,7 @@
>  #include <post.h>
>  #endif
>
> -int interrupt_init_cpu(unsigned *decrementer_count)
> +void interrupt_init_cpu(unsigned *decrementer_count)
>  {
>         volatile immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
>         volatile ccsr_pic_t *pic = &immr->im_pic;
> @@ -73,8 +73,6 @@ int interrupt_init_cpu(unsigned *decrementer_count)
>  #ifdef CONFIG_POST
>         post_word_store(post_word);
>  #endif
> -
> -       return 0;
>  }
>
>  /*
> diff --git a/arch/powerpc/cpu/mpc8xx/interrupts.c b/arch/powerpc/cpu/mpc8xx/interrupts.c
> index e8e287a13fa8..846148ab9867 100644
> --- a/arch/powerpc/cpu/mpc8xx/interrupts.c
> +++ b/arch/powerpc/cpu/mpc8xx/interrupts.c
> @@ -30,7 +30,7 @@ static void cpm_interrupt(void *regs);
>
>  /************************************************************************/
>
> -int interrupt_init_cpu(unsigned *decrementer_count)
> +void interrupt_init_cpu(unsigned *decrementer_count)
>  {
>         immap_t __iomem *immr = (immap_t __iomem *)CONFIG_SYS_IMMR;
>
> @@ -41,8 +41,6 @@ int interrupt_init_cpu(unsigned *decrementer_count)
>
>         /* Configure CPM interrupts */
>         cpm_interrupt_init();
> -
> -       return 0;
>  }
>
>  /************************************************************************/
> diff --git a/arch/powerpc/include/asm/ppc.h b/arch/powerpc/include/asm/ppc.h
> index 850fe93f9798..5e0aa08be936 100644
> --- a/arch/powerpc/include/asm/ppc.h
> +++ b/arch/powerpc/include/asm/ppc.h
> @@ -122,7 +122,7 @@ static inline void set_msr(unsigned long msr)
>  void print_reginfo(void);
>  #endif
>
> -int interrupt_init_cpu(unsigned *);
> +void interrupt_init_cpu(unsigned *);
>  void timer_interrupt_cpu(struct pt_regs *);
>  unsigned long search_exception_table(unsigned long addr);
>
> diff --git a/arch/powerpc/lib/interrupts.c b/arch/powerpc/lib/interrupts.c
> index 46fa18c63fb0..e8784aa16e9c 100644
> --- a/arch/powerpc/lib/interrupts.c
> +++ b/arch/powerpc/lib/interrupts.c
> @@ -63,13 +63,8 @@ int disable_interrupts (void)
>
>  int interrupt_init (void)
>  {
> -       int ret;
> -
>         /* call cpu specific function from $(CPU)/interrupts.c */
> -       ret = interrupt_init_cpu (&decrementer_count);
> -
> -       if (ret)
> -               return ret;
> +       interrupt_init_cpu (&decrementer_count);
>
>         set_dec (decrementer_count);
>
> --
> 1.9.1
>

Acked-by: Mario Six <mario.six@gdsys.cc>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 2/2] powerpc: Rework cpu_init_f() to take no arguments
  2017-08-14  6:20   ` Christophe LEROY
@ 2017-08-14  6:56     ` Mario Six
  0 siblings, 0 replies; 6+ messages in thread
From: Mario Six @ 2017-08-14  6:56 UTC (permalink / raw)
  To: u-boot

On Mon, Aug 14, 2017 at 8:20 AM, Christophe LEROY
<christophe.leroy@c-s.fr> wrote:
> Acked-by: Christophe Leroy <christophe.leroy@c-s.fr>
>
>
>
> Le 14/08/2017 à 04:44, Tom Rini a écrit :
>>
>> The function cpu_init_f() is called slightly differently on different
>> PowerPC platforms.  In some cases the function needs to make use of the
>> IMMR and in other cases it does not.  Rather than pass the IMMR location
>> as the function argument and then ignore it on some platforms, allow the
>> function to use the location as needed as it is a constant.
>>
>> Cc: Mario Six <mario.six@gdsys.cc>
>> Cc: Wolfgang Denk <wd@denx.de>
>> Cc: Christophe Leroy <christophe.leroy@c-s.fr>
>> Signed-off-by: Tom Rini <trini@konsulko.com>
>> ---
>>   arch/powerpc/cpu/mpc83xx/cpu_init.c    | 4 +++-
>>   arch/powerpc/cpu/mpc83xx/spl_minimal.c | 4 +++-
>>   arch/powerpc/cpu/mpc83xx/start.S       | 2 --
>>   arch/powerpc/cpu/mpc85xx/cpu_init.c    | 4 +---
>>   arch/powerpc/cpu/mpc8xx/cpu_init.c     | 4 +++-
>>   arch/powerpc/cpu/mpc8xx/start.S        | 1 -
>>   arch/powerpc/include/asm/ppc.h         | 1 +
>>   7 files changed, 11 insertions(+), 9 deletions(-)
>>
>> diff --git a/arch/powerpc/cpu/mpc83xx/cpu_init.c
>> b/arch/powerpc/cpu/mpc83xx/cpu_init.c
>> index 2a9db0c51b89..f09a96b9abff 100644
>> --- a/arch/powerpc/cpu/mpc83xx/cpu_init.c
>> +++ b/arch/powerpc/cpu/mpc83xx/cpu_init.c
>> @@ -46,8 +46,10 @@ static void config_qe_ioports(void)
>>    * initialize a bunch of registers,
>>    * initialize the UPM's
>>    */
>> -void cpu_init_f (volatile immap_t * im)
>> +void cpu_init_f (void)
>>   {
>> +       volatile immap_t *im = (void *)(CONFIG_SYS_IMMR);
>> +
>>         __be32 acr_mask =
>>   #ifdef CONFIG_SYS_ACR_PIPE_DEP /* Arbiter pipeline depth */
>>                 ACR_PIPE_DEP |
>> diff --git a/arch/powerpc/cpu/mpc83xx/spl_minimal.c
>> b/arch/powerpc/cpu/mpc83xx/spl_minimal.c
>> index 1c65e4cb78dd..ce751d3bdf9f 100644
>> --- a/arch/powerpc/cpu/mpc83xx/spl_minimal.c
>> +++ b/arch/powerpc/cpu/mpc83xx/spl_minimal.c
>> @@ -16,8 +16,10 @@ DECLARE_GLOBAL_DATA_PTR;
>>    * initialize a bunch of registers,
>>    * initialize the UPM's
>>    */
>> -void cpu_init_f (volatile immap_t * im)
>> +void cpu_init_f (void)
>>   {
>> +       volatile immap_t *im = (void *)(CONFIG_SYS_IMMR);
>> +
>>         /* Pointer is writable since we allocated a register for it */
>>         gd = (gd_t *) (CONFIG_SYS_INIT_RAM_ADDR +
>> CONFIG_SYS_GBL_DATA_OFFSET);
>>   diff --git a/arch/powerpc/cpu/mpc83xx/start.S
>> b/arch/powerpc/cpu/mpc83xx/start.S
>> index d2fced8aba86..8d10c50f6912 100644
>> --- a/arch/powerpc/cpu/mpc83xx/start.S
>> +++ b/arch/powerpc/cpu/mpc83xx/start.S
>> @@ -290,8 +290,6 @@ in_flash:
>>         GET_GOT                 /* initialize GOT access        */
>>   -     /* r3: IMMR */
>> -       lis     r3, CONFIG_SYS_IMMR at h
>>         /* run low-level CPU init code (in Flash)*/
>>         bl      cpu_init_f
>>   diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init.c
>> b/arch/powerpc/cpu/mpc85xx/cpu_init.c
>> index a3076d8d7100..2db8f1f91fe2 100644
>> --- a/arch/powerpc/cpu/mpc85xx/cpu_init.c
>> +++ b/arch/powerpc/cpu/mpc85xx/cpu_init.c
>> @@ -435,7 +435,7 @@ void fsl_erratum_a007212_workaround(void)
>>   }
>>   #endif
>>   -ulong cpu_init_f(void)
>> +void cpu_init_f(void)
>>   {
>>         extern void m8560_cpm_reset (void);
>>   #ifdef CONFIG_SYS_DCSRBAR_PHYS
>> @@ -507,8 +507,6 @@ ulong cpu_init_f(void)
>>   #ifdef CONFIG_SYS_FSL_ERRATUM_A007212
>>         fsl_erratum_a007212_workaround();
>>   #endif
>> -
>> -       return 0;
>>   }
>>     /* Implement a dummy function for those platforms w/o SERDES */
>> diff --git a/arch/powerpc/cpu/mpc8xx/cpu_init.c
>> b/arch/powerpc/cpu/mpc8xx/cpu_init.c
>> index dc601a12976f..c1cd2fac36f4 100644
>> --- a/arch/powerpc/cpu/mpc8xx/cpu_init.c
>> +++ b/arch/powerpc/cpu/mpc8xx/cpu_init.c
>> @@ -19,8 +19,10 @@
>>    * initialize a bunch of registers,
>>    * initialize the UPM's
>>    */
>> -void cpu_init_f(immap_t __iomem *immr)
>> +void cpu_init_f(void)
>>   {
>> +       volatile immap_t *immr = (void *)(CONFIG_SYS_IMMR);
>> +
>>         memctl8xx_t __iomem *memctl = &immr->im_memctl;
>>         ulong reg;
>>   diff --git a/arch/powerpc/cpu/mpc8xx/start.S
>> b/arch/powerpc/cpu/mpc8xx/start.S
>> index 202ea81ae498..f03bfe94f25b 100644
>> --- a/arch/powerpc/cpu/mpc8xx/start.S
>> +++ b/arch/powerpc/cpu/mpc8xx/start.S
>> @@ -158,7 +158,6 @@ in_flash:
>>         GET_GOT                 /* initialize GOT access
>> */
>>   -     /* r3: IMMR */
>>         bl      cpu_init_f      /* run low-level CPU init code     (from
>> Flash) */
>>         bl      board_init_f    /* run 1st part of board init code (from
>> Flash) */
>> diff --git a/arch/powerpc/include/asm/ppc.h
>> b/arch/powerpc/include/asm/ppc.h
>> index 5e0aa08be936..615d7fda9324 100644
>> --- a/arch/powerpc/include/asm/ppc.h
>> +++ b/arch/powerpc/include/asm/ppc.h
>> @@ -122,6 +122,7 @@ static inline void set_msr(unsigned long msr)
>>   void print_reginfo(void);
>>   #endif
>>   +void cpu_init_f(void);
>>   void interrupt_init_cpu(unsigned *);
>>   void timer_interrupt_cpu(struct pt_regs *);
>>   unsigned long search_exception_table(unsigned long addr);
>>
>

Acked-by: Mario Six <mario.six@gdsys.cc>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [U-Boot,1/2] powerpc: Rework interrupt_init_cpu()
  2017-08-14  2:44 [U-Boot] [PATCH 1/2] powerpc: Rework interrupt_init_cpu() Tom Rini
  2017-08-14  2:44 ` [U-Boot] [PATCH 2/2] powerpc: Rework cpu_init_f() to take no arguments Tom Rini
  2017-08-14  6:55 ` [U-Boot] [PATCH 1/2] powerpc: Rework interrupt_init_cpu() Mario Six
@ 2017-08-26 20:45 ` Tom Rini
  2 siblings, 0 replies; 6+ messages in thread
From: Tom Rini @ 2017-08-26 20:45 UTC (permalink / raw)
  To: u-boot

On Sun, Aug 13, 2017 at 10:44:37PM -0400, Tom Rini wrote:

> The function interrupt_init_cpu() is given an int return type but does
> not return anything but 0.  Rework this to be a void function.
> 
> Signed-off-by: Tom Rini <trini@konsulko.com>
> Acked-by: Mario Six <mario.six@gdsys.cc>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170826/fc4fa8a7/attachment.sig>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-08-26 20:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-14  2:44 [U-Boot] [PATCH 1/2] powerpc: Rework interrupt_init_cpu() Tom Rini
2017-08-14  2:44 ` [U-Boot] [PATCH 2/2] powerpc: Rework cpu_init_f() to take no arguments Tom Rini
2017-08-14  6:20   ` Christophe LEROY
2017-08-14  6:56     ` Mario Six
2017-08-14  6:55 ` [U-Boot] [PATCH 1/2] powerpc: Rework interrupt_init_cpu() Mario Six
2017-08-26 20:45 ` [U-Boot] [U-Boot,1/2] " Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.