summaryrefslogtreecommitdiff
path: root/arch/powerpc
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-12-02 22:05:35 -0500
committerTom Rini <trini@konsulko.com>2019-12-02 22:05:35 -0500
commita4ef0657e3075d0f951d78cc1398cb7e05af648a (patch)
tree9a4387de5845e6fd1331f0af32bfd82fac9eb039 /arch/powerpc
parent357040645f9f56b33909520483df9f840be7e181 (diff)
parentcb3ef6810a27c8ddf5db8694bcef9337f27d12ce (diff)
Merge branch '2019-12-02-master-imports'
- A large series of clean-ups to reduce common.h contents
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/cpu/mpc83xx/cpu.c5
-rw-r--r--arch/powerpc/cpu/mpc83xx/ecc.c1
-rw-r--r--arch/powerpc/cpu/mpc83xx/interrupts.c7
-rw-r--r--arch/powerpc/cpu/mpc83xx/spd_sdram.c2
-rw-r--r--arch/powerpc/cpu/mpc83xx/speed.c1
-rw-r--r--arch/powerpc/cpu/mpc85xx/cpu.c3
-rw-r--r--arch/powerpc/cpu/mpc85xx/cpu_init.c1
-rw-r--r--arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c1
-rw-r--r--arch/powerpc/cpu/mpc85xx/interrupts.c1
-rw-r--r--arch/powerpc/cpu/mpc85xx/mp.c1
-rw-r--r--arch/powerpc/cpu/mpc85xx/speed.c1
-rw-r--r--arch/powerpc/cpu/mpc85xx/traps.c1
-rw-r--r--arch/powerpc/cpu/mpc86xx/cpu.c2
-rw-r--r--arch/powerpc/cpu/mpc86xx/interrupts.c3
-rw-r--r--arch/powerpc/cpu/mpc86xx/mp.c1
-rw-r--r--arch/powerpc/cpu/mpc8xx/cache.c1
-rw-r--r--arch/powerpc/cpu/mpc8xx/cpu.c132
-rw-r--r--arch/powerpc/cpu/mpc8xx/interrupts.c1
-rw-r--r--arch/powerpc/cpu/mpc8xxx/cpu.c1
-rw-r--r--arch/powerpc/cpu/mpc8xxx/fdt.c1
-rw-r--r--arch/powerpc/cpu/mpc8xxx/srio.c1
-rw-r--r--arch/powerpc/lib/bootm.c1
-rw-r--r--arch/powerpc/lib/cache.c1
-rw-r--r--arch/powerpc/lib/interrupts.c24
-rw-r--r--arch/powerpc/lib/time.c1
25 files changed, 107 insertions, 88 deletions
diff --git a/arch/powerpc/cpu/mpc83xx/cpu.c b/arch/powerpc/cpu/mpc83xx/cpu.c
index 3048ecf34ad..c3e25978a80 100644
--- a/arch/powerpc/cpu/mpc83xx/cpu.c
+++ b/arch/powerpc/cpu/mpc83xx/cpu.c
@@ -10,6 +10,9 @@
*/
#include <common.h>
+#include <cpu_func.h>
+#include <irq_func.h>
+#include <vsprintf.h>
#include <watchdog.h>
#include <command.h>
#include <mpc83xx.h>
@@ -194,7 +197,7 @@ void watchdog_reset (void)
immr->wdt.swsrr = 0xaa39;
if (re_enable)
- enable_interrupts ();
+ enable_interrupts();
}
#endif
diff --git a/arch/powerpc/cpu/mpc83xx/ecc.c b/arch/powerpc/cpu/mpc83xx/ecc.c
index 10e9b96add1..a6eb7cb97cb 100644
--- a/arch/powerpc/cpu/mpc83xx/ecc.c
+++ b/arch/powerpc/cpu/mpc83xx/ecc.c
@@ -7,6 +7,7 @@
*/
#include <common.h>
+#include <irq_func.h>
#include <mpc83xx.h>
#include <command.h>
diff --git a/arch/powerpc/cpu/mpc83xx/interrupts.c b/arch/powerpc/cpu/mpc83xx/interrupts.c
index 520c2c363e3..e83895deabb 100644
--- a/arch/powerpc/cpu/mpc83xx/interrupts.c
+++ b/arch/powerpc/cpu/mpc83xx/interrupts.c
@@ -8,6 +8,7 @@
#include <common.h>
#include <command.h>
+#include <irq_func.h>
#include <mpc83xx.h>
#include <asm/processor.h>
@@ -35,7 +36,7 @@ void interrupt_init_cpu (unsigned *decrementer_count)
* Handle external interrupts
*/
-void external_interrupt (struct pt_regs *regs)
+void external_interrupt(struct pt_regs *regs)
{
}
@@ -45,12 +46,12 @@ void external_interrupt (struct pt_regs *regs)
*/
void
-irq_install_handler (int irq, interrupt_handler_t * handler, void *arg)
+irq_install_handler(int irq, interrupt_handler_t * handler, void *arg)
{
}
-void irq_free_handler (int irq)
+void irq_free_handler(int irq)
{
}
diff --git a/arch/powerpc/cpu/mpc83xx/spd_sdram.c b/arch/powerpc/cpu/mpc83xx/spd_sdram.c
index 8b5ecdb9ad1..a14a438b02d 100644
--- a/arch/powerpc/cpu/mpc83xx/spd_sdram.c
+++ b/arch/powerpc/cpu/mpc83xx/spd_sdram.c
@@ -13,6 +13,8 @@
#ifndef CONFIG_MPC83XX_SDRAM
#include <common.h>
+#include <cpu_func.h>
+#include <vsprintf.h>
#include <asm/processor.h>
#include <asm/io.h>
#include <i2c.h>
diff --git a/arch/powerpc/cpu/mpc83xx/speed.c b/arch/powerpc/cpu/mpc83xx/speed.c
index e118a10fa8b..93af7f495fd 100644
--- a/arch/powerpc/cpu/mpc83xx/speed.c
+++ b/arch/powerpc/cpu/mpc83xx/speed.c
@@ -11,6 +11,7 @@
#include <common.h>
#include <mpc83xx.h>
#include <command.h>
+#include <vsprintf.h>
#include <asm/processor.h>
DECLARE_GLOBAL_DATA_PTR;
diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c b/arch/powerpc/cpu/mpc85xx/cpu.c
index bf48836036b..18556629c3d 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu.c
@@ -10,6 +10,9 @@
#include <config.h>
#include <common.h>
+#include <cpu_func.h>
+#include <irq_func.h>
+#include <vsprintf.h>
#include <watchdog.h>
#include <command.h>
#include <fsl_esdhc.h>
diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init.c b/arch/powerpc/cpu/mpc85xx/cpu_init.c
index 13691f38366..a9f39dc5838 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu_init.c
@@ -11,6 +11,7 @@
#include <common.h>
#include <env.h>
+#include <init.h>
#include <watchdog.h>
#include <asm/processor.h>
#include <ioports.h>
diff --git a/arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c b/arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c
index fcfa7302334..ebdcd29c13d 100644
--- a/arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c
+++ b/arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <env.h>
+#include <time.h>
#ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8
#include <hwconfig.h>
#endif
diff --git a/arch/powerpc/cpu/mpc85xx/interrupts.c b/arch/powerpc/cpu/mpc85xx/interrupts.c
index b5a6ead8bde..e767573193f 100644
--- a/arch/powerpc/cpu/mpc85xx/interrupts.c
+++ b/arch/powerpc/cpu/mpc85xx/interrupts.c
@@ -11,6 +11,7 @@
*/
#include <common.h>
+#include <irq_func.h>
#include <watchdog.h>
#include <command.h>
#include <asm/processor.h>
diff --git a/arch/powerpc/cpu/mpc85xx/mp.c b/arch/powerpc/cpu/mpc85xx/mp.c
index 3882c95f92e..9757bffe025 100644
--- a/arch/powerpc/cpu/mpc85xx/mp.c
+++ b/arch/powerpc/cpu/mpc85xx/mp.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <cpu_func.h>
#include <env.h>
#include <asm/processor.h>
#include <env.h>
diff --git a/arch/powerpc/cpu/mpc85xx/speed.c b/arch/powerpc/cpu/mpc85xx/speed.c
index acc2f2bb818..15b05fcc513 100644
--- a/arch/powerpc/cpu/mpc85xx/speed.c
+++ b/arch/powerpc/cpu/mpc85xx/speed.c
@@ -10,6 +10,7 @@
*/
#include <common.h>
+#include <cpu_func.h>
#include <ppc_asm.tmpl>
#include <linux/compiler.h>
#include <asm/processor.h>
diff --git a/arch/powerpc/cpu/mpc85xx/traps.c b/arch/powerpc/cpu/mpc85xx/traps.c
index e1d492f05a9..804788d0507 100644
--- a/arch/powerpc/cpu/mpc85xx/traps.c
+++ b/arch/powerpc/cpu/mpc85xx/traps.c
@@ -21,6 +21,7 @@
#include <common.h>
#include <command.h>
+#include <irq_func.h>
#include <kgdb.h>
#include <asm/processor.h>
diff --git a/arch/powerpc/cpu/mpc86xx/cpu.c b/arch/powerpc/cpu/mpc86xx/cpu.c
index c023d0684f8..bb14444a2e7 100644
--- a/arch/powerpc/cpu/mpc86xx/cpu.c
+++ b/arch/powerpc/cpu/mpc86xx/cpu.c
@@ -6,6 +6,8 @@
*/
#include <common.h>
+#include <cpu_func.h>
+#include <vsprintf.h>
#include <watchdog.h>
#include <command.h>
#include <asm/cache.h>
diff --git a/arch/powerpc/cpu/mpc86xx/interrupts.c b/arch/powerpc/cpu/mpc86xx/interrupts.c
index ed780a599d1..0f930fcd9e1 100644
--- a/arch/powerpc/cpu/mpc86xx/interrupts.c
+++ b/arch/powerpc/cpu/mpc86xx/interrupts.c
@@ -15,6 +15,7 @@
*/
#include <common.h>
+#include <irq_func.h>
#include <mpc86xx.h>
#include <command.h>
#include <asm/processor.h>
@@ -108,5 +109,5 @@ int do_irqinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
*/
void external_interrupt(struct pt_regs *regs)
{
- puts("external_interrupt (oops!)\n");
+ puts("external_interrupt(oops!)\n");
}
diff --git a/arch/powerpc/cpu/mpc86xx/mp.c b/arch/powerpc/cpu/mpc86xx/mp.c
index ce300eac5b0..07c4c079df3 100644
--- a/arch/powerpc/cpu/mpc86xx/mp.c
+++ b/arch/powerpc/cpu/mpc86xx/mp.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <cpu_func.h>
#include <asm/processor.h>
#include <asm/mmu.h>
#include <ioports.h>
diff --git a/arch/powerpc/cpu/mpc8xx/cache.c b/arch/powerpc/cpu/mpc8xx/cache.c
index 8051d3e8d23..41559009cac 100644
--- a/arch/powerpc/cpu/mpc8xx/cache.c
+++ b/arch/powerpc/cpu/mpc8xx/cache.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <cpu_func.h>
#include <asm/processor.h>
#include <asm/ppc.h>
#include <asm/io.h>
diff --git a/arch/powerpc/cpu/mpc8xx/cpu.c b/arch/powerpc/cpu/mpc8xx/cpu.c
index 798eabdc21c..0604433e726 100644
--- a/arch/powerpc/cpu/mpc8xx/cpu.c
+++ b/arch/powerpc/cpu/mpc8xx/cpu.c
@@ -17,6 +17,8 @@
*/
#include <common.h>
+#include <cpu_func.h>
+#include <vsprintf.h>
#include <watchdog.h>
#include <command.h>
#include <mpc8xx.h>
@@ -33,70 +35,6 @@
DECLARE_GLOBAL_DATA_PTR;
-static int check_CPU(long clock, uint pvr, uint immr)
-{
- immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
- uint k;
- char buf[32];
-
- /* the highest 16 bits should be 0x0050 for a 860 */
-
- if (PVR_VER(pvr) != PVR_VER(PVR_8xx))
- return -1;
-
- k = (immr << 16) |
- in_be16(&immap->im_cpm.cp_dparam16[PROFF_REVNUM / sizeof(u16)]);
-
- /*
- * Some boards use sockets so different CPUs can be used.
- * We have to check chip version in run time.
- */
- switch (k) {
- /* MPC866P/MPC866T/MPC859T/MPC859DSL/MPC852T */
- case 0x08010004: /* Rev. A.0 */
- printf("MPC866xxxZPnnA");
- break;
- case 0x08000003: /* Rev. 0.3 */
- printf("MPC866xxxZPnn");
- break;
- case 0x09000000: /* 870/875/880/885 */
- puts("MPC885ZPnn");
- break;
-
- default:
- printf("unknown MPC86x (0x%08x)", k);
- break;
- }
-
- printf(" at %s MHz: ", strmhz(buf, clock));
-
- print_size(checkicache(), " I-Cache ");
- print_size(checkdcache(), " D-Cache");
-
- /* do we have a FEC (860T/P or 852/859/866/885)? */
-
- out_be32(&immap->im_cpm.cp_fec.fec_addr_low, 0x12345678);
- if (in_be32(&immap->im_cpm.cp_fec.fec_addr_low) == 0x12345678)
- printf(" FEC present");
-
- putc('\n');
-
- return 0;
-}
-
-/* ------------------------------------------------------------------------- */
-
-int checkcpu(void)
-{
- ulong clock = gd->cpu_clk;
- uint immr = get_immr(); /* Return full IMMR contents */
- uint pvr = get_pvr();
-
- puts("CPU: ");
-
- return check_CPU(clock, pvr, immr);
-}
-
/* ------------------------------------------------------------------------- */
/* L1 i-cache */
@@ -141,7 +79,7 @@ int checkicache(void)
/* L1 d-cache */
/* call with cache disabled */
-int checkdcache(void)
+static int checkdcache(void)
{
immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
memctl8xx_t __iomem *memctl = &immap->im_memctl;
@@ -173,6 +111,70 @@ int checkdcache(void)
return lines << 4;
};
+static int check_CPU(long clock, uint pvr, uint immr)
+{
+ immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
+ uint k;
+ char buf[32];
+
+ /* the highest 16 bits should be 0x0050 for a 860 */
+
+ if (PVR_VER(pvr) != PVR_VER(PVR_8xx))
+ return -1;
+
+ k = (immr << 16) |
+ in_be16(&immap->im_cpm.cp_dparam16[PROFF_REVNUM / sizeof(u16)]);
+
+ /*
+ * Some boards use sockets so different CPUs can be used.
+ * We have to check chip version in run time.
+ */
+ switch (k) {
+ /* MPC866P/MPC866T/MPC859T/MPC859DSL/MPC852T */
+ case 0x08010004: /* Rev. A.0 */
+ printf("MPC866xxxZPnnA");
+ break;
+ case 0x08000003: /* Rev. 0.3 */
+ printf("MPC866xxxZPnn");
+ break;
+ case 0x09000000: /* 870/875/880/885 */
+ puts("MPC885ZPnn");
+ break;
+
+ default:
+ printf("unknown MPC86x (0x%08x)", k);
+ break;
+ }
+
+ printf(" at %s MHz: ", strmhz(buf, clock));
+
+ print_size(checkicache(), " I-Cache ");
+ print_size(checkdcache(), " D-Cache");
+
+ /* do we have a FEC (860T/P or 852/859/866/885)? */
+
+ out_be32(&immap->im_cpm.cp_fec.fec_addr_low, 0x12345678);
+ if (in_be32(&immap->im_cpm.cp_fec.fec_addr_low) == 0x12345678)
+ printf(" FEC present");
+
+ putc('\n');
+
+ return 0;
+}
+
+/* ------------------------------------------------------------------------- */
+
+int checkcpu(void)
+{
+ ulong clock = gd->cpu_clk;
+ uint immr = get_immr(); /* Return full IMMR contents */
+ uint pvr = get_pvr();
+
+ puts("CPU: ");
+
+ return check_CPU(clock, pvr, immr);
+}
+
/* ------------------------------------------------------------------------- */
void upmconfig(uint upm, uint *table, uint size)
diff --git a/arch/powerpc/cpu/mpc8xx/interrupts.c b/arch/powerpc/cpu/mpc8xx/interrupts.c
index 26aa7a56455..6ee6088fa8a 100644
--- a/arch/powerpc/cpu/mpc8xx/interrupts.c
+++ b/arch/powerpc/cpu/mpc8xx/interrupts.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <irq_func.h>
#include <mpc8xx.h>
#include <mpc8xx_irq.h>
#include <asm/cpm_8xx.h>
diff --git a/arch/powerpc/cpu/mpc8xxx/cpu.c b/arch/powerpc/cpu/mpc8xxx/cpu.c
index 467eac4a2e2..ed482a9c098 100644
--- a/arch/powerpc/cpu/mpc8xxx/cpu.c
+++ b/arch/powerpc/cpu/mpc8xxx/cpu.c
@@ -10,6 +10,7 @@
#include <config.h>
#include <common.h>
#include <command.h>
+#include <cpu_func.h>
#include <tsec.h>
#include <fm_eth.h>
#include <netdev.h>
diff --git a/arch/powerpc/cpu/mpc8xxx/fdt.c b/arch/powerpc/cpu/mpc8xxx/fdt.c
index 0d877c43be8..485c2d4feb0 100644
--- a/arch/powerpc/cpu/mpc8xxx/fdt.c
+++ b/arch/powerpc/cpu/mpc8xxx/fdt.c
@@ -8,6 +8,7 @@
*/
#include <common.h>
+#include <cpu_func.h>
#include <linux/libfdt.h>
#include <fdt_support.h>
#include <asm/mp.h>
diff --git a/arch/powerpc/cpu/mpc8xxx/srio.c b/arch/powerpc/cpu/mpc8xxx/srio.c
index ea7dac6e668..a1f94035596 100644
--- a/arch/powerpc/cpu/mpc8xxx/srio.c
+++ b/arch/powerpc/cpu/mpc8xxx/srio.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <config.h>
+#include <time.h>
#include <asm/fsl_law.h>
#include <asm/fsl_serdes.h>
#include <asm/fsl_srio.h>
diff --git a/arch/powerpc/lib/bootm.c b/arch/powerpc/lib/bootm.c
index 84691b75546..f2e670eb6bf 100644
--- a/arch/powerpc/lib/bootm.c
+++ b/arch/powerpc/lib/bootm.c
@@ -8,6 +8,7 @@
#include <common.h>
+#include <cpu_func.h>
#include <env.h>
#include <watchdog.h>
#include <command.h>
diff --git a/arch/powerpc/lib/cache.c b/arch/powerpc/lib/cache.c
index 2d36c3aa082..3c3c470bbbd 100644
--- a/arch/powerpc/lib/cache.c
+++ b/arch/powerpc/lib/cache.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <cpu_func.h>
#include <asm/cache.h>
#include <watchdog.h>
diff --git a/arch/powerpc/lib/interrupts.c b/arch/powerpc/lib/interrupts.c
index 19682cfcfad..64ee0cc2102 100644
--- a/arch/powerpc/lib/interrupts.c
+++ b/arch/powerpc/lib/interrupts.c
@@ -8,6 +8,7 @@
*/
#include <common.h>
+#include <irq_func.h>
#include <asm/processor.h>
#include <watchdog.h>
#ifdef CONFIG_LED_STATUS
@@ -15,15 +16,6 @@
#endif
#ifndef CONFIG_MPC83XX_TIMER
-#ifdef CONFIG_SHOW_ACTIVITY
-void board_show_activity (ulong) __attribute__((weak, alias("__board_show_activity")));
-
-void __board_show_activity (ulong dummy)
-{
- return;
-}
-#endif /* CONFIG_SHOW_ACTIVITY */
-
#ifndef CONFIG_SYS_WATCHDOG_FREQ
#define CONFIG_SYS_WATCHDOG_FREQ (CONFIG_SYS_HZ / 2)
#endif
@@ -47,13 +39,13 @@ static __inline__ void set_dec (unsigned long val)
}
#endif /* !CONFIG_MPC83XX_TIMER */
-void enable_interrupts (void)
+void enable_interrupts(void)
{
set_msr (get_msr () | MSR_EE);
}
/* returns flag if MSR_EE was set before */
-int disable_interrupts (void)
+int disable_interrupts(void)
{
ulong msr = get_msr ();
@@ -62,7 +54,7 @@ int disable_interrupts (void)
}
#ifndef CONFIG_MPC83XX_TIMER
-int interrupt_init (void)
+int interrupt_init(void)
{
/* call cpu specific function from $(CPU)/interrupts.c */
interrupt_init_cpu (&decrementer_count);
@@ -76,7 +68,7 @@ int interrupt_init (void)
static volatile ulong timestamp = 0;
-void timer_interrupt (struct pt_regs *regs)
+void timer_interrupt(struct pt_regs *regs)
{
/* call cpu specific function from $(CPU)/interrupts.c */
timer_interrupt_cpu (regs);
@@ -92,12 +84,8 @@ void timer_interrupt (struct pt_regs *regs)
#endif /* CONFIG_WATCHDOG || CONFIG_HW_WATCHDOG */
#ifdef CONFIG_LED_STATUS
- status_led_tick (timestamp);
+ status_led_tick(timestamp);
#endif /* CONFIG_LED_STATUS */
-
-#ifdef CONFIG_SHOW_ACTIVITY
- board_show_activity (timestamp);
-#endif /* CONFIG_SHOW_ACTIVITY */
}
ulong get_timer (ulong base)
diff --git a/arch/powerpc/lib/time.c b/arch/powerpc/lib/time.c
index a22a73abfa5..e1494fa1292 100644
--- a/arch/powerpc/lib/time.c
+++ b/arch/powerpc/lib/time.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <time.h>
#include <asm/io.h>
/* ------------------------------------------------------------------------- */