* [PATCH 0/6] powerpc: Fix compiler warnings
@ 2020-09-15 7:02 Sascha Hauer
2020-09-15 7:03 ` [PATCH 1/6] powerpc: Add prototypes to header file Sascha Hauer
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Sascha Hauer @ 2020-09-15 7:02 UTC (permalink / raw)
To: Barebox List
powerpc currently has lots of -Wmissing-prototypes warnings. This series
fixes them.
Sascha Hauer (6):
powerpc: Add prototypes to header file
powerpc: Add missing includes
powerpc: Make locally used functions static
powerpc: Add prototypes for functions called from assembly
powerpc: Remove unused functions
powerpc: Add function prototypes for exception handlers
arch/powerpc/boards/freescale-p1010rdb/ddr.c | 4 +--
.../boards/freescale-p1010rdb/p1010rdb.c | 2 ++
arch/powerpc/boards/freescale-p1022ds/ddr.c | 4 +--
.../boards/freescale-p1022ds/p1022ds.c | 2 ++
arch/powerpc/boards/pcm030/pcm030.c | 3 ++
arch/powerpc/cpu-85xx/traps.c | 6 ++--
arch/powerpc/ddr-8xxx/ctrl_regs.c | 7 ++--
arch/powerpc/ddr-8xxx/ddr.h | 4 ---
arch/powerpc/ddr-8xxx/ddr2_dimm_params.c | 2 +-
arch/powerpc/include/asm/fsl_ddr_sdram.h | 8 +++++
arch/powerpc/include/asm/processor.h | 8 +++++
arch/powerpc/lib/board.c | 3 ++
arch/powerpc/mach-mpc5xxx/cpu.c | 24 -------------
arch/powerpc/mach-mpc5xxx/reginfo.c | 1 +
arch/powerpc/mach-mpc5xxx/speed.c | 3 +-
arch/powerpc/mach-mpc5xxx/time.c | 2 +-
arch/powerpc/mach-mpc5xxx/traps.c | 28 ++-------------
arch/powerpc/mach-mpc85xx/cpu.c | 4 +++
arch/powerpc/mach-mpc85xx/cpu_init.c | 13 ++++---
arch/powerpc/mach-mpc85xx/cpuid.c | 1 +
arch/powerpc/mach-mpc85xx/fsl_gpio.c | 35 -------------------
arch/powerpc/mach-mpc85xx/fsl_i2c.c | 1 +
arch/powerpc/mach-mpc85xx/speed.c | 9 -----
arch/powerpc/mach-mpc85xx/time.c | 2 +-
drivers/net/fec_mpc5200.c | 2 +-
25 files changed, 59 insertions(+), 119 deletions(-)
--
2.28.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/6] powerpc: Add prototypes to header file
2020-09-15 7:02 [PATCH 0/6] powerpc: Fix compiler warnings Sascha Hauer
@ 2020-09-15 7:03 ` Sascha Hauer
2020-09-15 7:03 ` [PATCH 2/6] powerpc: Add missing includes Sascha Hauer
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2020-09-15 7:03 UTC (permalink / raw)
To: Barebox List
This adds prototypes of the board specific functions
fsl_ddr_board_options() and fsl_ddr_board_info() to a header
file. Including this header file from the board files reveals
that the prototypes are different across the different implementations,
so harmonize them.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/powerpc/boards/freescale-p1010rdb/ddr.c | 4 +---
arch/powerpc/boards/freescale-p1022ds/ddr.c | 4 +---
arch/powerpc/ddr-8xxx/ddr.h | 4 ----
arch/powerpc/include/asm/fsl_ddr_sdram.h | 8 ++++++++
4 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/arch/powerpc/boards/freescale-p1010rdb/ddr.c b/arch/powerpc/boards/freescale-p1010rdb/ddr.c
index 18069f4df1..14fa426726 100644
--- a/arch/powerpc/boards/freescale-p1010rdb/ddr.c
+++ b/arch/powerpc/boards/freescale-p1010rdb/ddr.c
@@ -20,7 +20,7 @@
static const u8 spd_addr = 0x52;
-int fsl_ddr_board_info(struct ddr_board_info_s *info)
+void fsl_ddr_board_info(struct ddr_board_info_s *info)
{
p1010rdb_early_init();
@@ -34,8 +34,6 @@ int fsl_ddr_board_info(struct ddr_board_info_s *info)
info->i2c_speed = 400000;
info->i2c_base = IOMEM(I2C2_BASE_ADDR);
info->spd_i2c_addr = &spd_addr;
-
- return 0;
}
void fsl_ddr_board_options(struct memctl_options_s *popts,
diff --git a/arch/powerpc/boards/freescale-p1022ds/ddr.c b/arch/powerpc/boards/freescale-p1022ds/ddr.c
index 1944518c79..3a8298f928 100644
--- a/arch/powerpc/boards/freescale-p1022ds/ddr.c
+++ b/arch/powerpc/boards/freescale-p1022ds/ddr.c
@@ -19,7 +19,7 @@
static const u8 spd_addr = 0x51;
-int fsl_ddr_board_info(struct ddr_board_info_s *info)
+void fsl_ddr_board_info(struct ddr_board_info_s *info)
{
/*
* Early mapping is needed to access the clock
@@ -37,8 +37,6 @@ int fsl_ddr_board_info(struct ddr_board_info_s *info)
info->i2c_speed = 400000;
info->i2c_base = IOMEM(I2C2_BASE_ADDR);
info->spd_i2c_addr = &spd_addr;
-
- return 0;
}
struct board_specific_parameters {
diff --git a/arch/powerpc/ddr-8xxx/ddr.h b/arch/powerpc/ddr-8xxx/ddr.h
index 2ef87f2776..8560e37167 100644
--- a/arch/powerpc/ddr-8xxx/ddr.h
+++ b/arch/powerpc/ddr-8xxx/ddr.h
@@ -109,8 +109,4 @@ int fsl_ddr_get_spd(
struct ddr_board_info_s *binfo);
int fsl_ddr_set_memctl_regs(
const struct fsl_ddr_info_s *info);
-void fsl_ddr_board_options(
- struct memctl_options_s *popts,
- struct dimm_params_s *pdimm);
-void fsl_ddr_board_info(struct ddr_board_info_s *info);
#endif
diff --git a/arch/powerpc/include/asm/fsl_ddr_sdram.h b/arch/powerpc/include/asm/fsl_ddr_sdram.h
index f4732389f6..b6c0b4dd7a 100644
--- a/arch/powerpc/include/asm/fsl_ddr_sdram.h
+++ b/arch/powerpc/include/asm/fsl_ddr_sdram.h
@@ -184,4 +184,12 @@ struct memctl_options_s {
extern phys_size_t fsl_ddr_sdram(void);
extern phys_size_t fixed_sdram(void);
+
+struct dimm_params_s;
+
+void fsl_ddr_board_options(
+ struct memctl_options_s *popts,
+ struct dimm_params_s *pdimm);
+void fsl_ddr_board_info(struct ddr_board_info_s *info);
+
#endif
--
2.28.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/6] powerpc: Add missing includes
2020-09-15 7:02 [PATCH 0/6] powerpc: Fix compiler warnings Sascha Hauer
2020-09-15 7:03 ` [PATCH 1/6] powerpc: Add prototypes to header file Sascha Hauer
@ 2020-09-15 7:03 ` Sascha Hauer
2020-09-15 7:03 ` [PATCH 3/6] powerpc: Make locally used functions static Sascha Hauer
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2020-09-15 7:03 UTC (permalink / raw)
To: Barebox List
Add missing includes to avoid -Wmissing-prototypes warnings.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/powerpc/boards/freescale-p1010rdb/p1010rdb.c | 2 ++
arch/powerpc/boards/freescale-p1022ds/p1022ds.c | 2 ++
arch/powerpc/mach-mpc5xxx/reginfo.c | 1 +
arch/powerpc/mach-mpc5xxx/speed.c | 1 +
arch/powerpc/mach-mpc85xx/cpu.c | 1 +
arch/powerpc/mach-mpc85xx/cpuid.c | 1 +
arch/powerpc/mach-mpc85xx/fsl_i2c.c | 1 +
7 files changed, 9 insertions(+)
diff --git a/arch/powerpc/boards/freescale-p1010rdb/p1010rdb.c b/arch/powerpc/boards/freescale-p1010rdb/p1010rdb.c
index b163327597..f2f6d00b77 100644
--- a/arch/powerpc/boards/freescale-p1010rdb/p1010rdb.c
+++ b/arch/powerpc/boards/freescale-p1010rdb/p1010rdb.c
@@ -37,6 +37,8 @@
#include <mach/early_udelay.h>
#include <of.h>
+#include "p1010rdb.h"
+
static struct gfar_info_struct gfar_info[] = {
{
.phyaddr = 1,
diff --git a/arch/powerpc/boards/freescale-p1022ds/p1022ds.c b/arch/powerpc/boards/freescale-p1022ds/p1022ds.c
index d80c234ea9..956b830c5d 100644
--- a/arch/powerpc/boards/freescale-p1022ds/p1022ds.c
+++ b/arch/powerpc/boards/freescale-p1022ds/p1022ds.c
@@ -34,6 +34,8 @@
#include <mach/clock.h>
#include <mach/early_udelay.h>
+#include "p1022ds.h"
+
/* Define attributes for eTSEC1 and eTSEC2 */
static struct gfar_info_struct gfar_info[] = {
{
diff --git a/arch/powerpc/mach-mpc5xxx/reginfo.c b/arch/powerpc/mach-mpc5xxx/reginfo.c
index e41d235a5d..8b646e7d04 100644
--- a/arch/powerpc/mach-mpc5xxx/reginfo.c
+++ b/arch/powerpc/mach-mpc5xxx/reginfo.c
@@ -1,4 +1,5 @@
#include <stdio.h>
+#include <common.h>
#include <config.h>
#include <mach/mpc5xxx.h>
#include <asm/io.h>
diff --git a/arch/powerpc/mach-mpc5xxx/speed.c b/arch/powerpc/mach-mpc5xxx/speed.c
index 0cec9522e5..8aa20bd373 100644
--- a/arch/powerpc/mach-mpc5xxx/speed.c
+++ b/arch/powerpc/mach-mpc5xxx/speed.c
@@ -19,6 +19,7 @@
#include <init.h>
#include <asm/processor.h>
#include <types.h>
+#include <mach/clock.h>
/* Bus-to-Core Multipliers */
diff --git a/arch/powerpc/mach-mpc85xx/cpu.c b/arch/powerpc/mach-mpc85xx/cpu.c
index 7c8a59edc9..1d5a69c999 100644
--- a/arch/powerpc/mach-mpc85xx/cpu.c
+++ b/arch/powerpc/mach-mpc85xx/cpu.c
@@ -28,6 +28,7 @@
#include <asm-generic/memory_layout.h>
#include <mach/mmu.h>
#include <mach/immap_85xx.h>
+#include <mach/mpc85xx.h>
static void __noreturn mpc85xx_restart_soc(struct restart_handler *rst)
{
diff --git a/arch/powerpc/mach-mpc85xx/cpuid.c b/arch/powerpc/mach-mpc85xx/cpuid.c
index ae82e3fd3f..28f08ca292 100644
--- a/arch/powerpc/mach-mpc85xx/cpuid.c
+++ b/arch/powerpc/mach-mpc85xx/cpuid.c
@@ -23,6 +23,7 @@
#include <asm/cache.h>
#include <asm/io.h>
#include <mach/immap_85xx.h>
+#include <mach/mpc85xx.h>
struct cpu_type cpu_type_list[] = {
CPU_TYPE_ENTRY(8544, 8544, 1),
diff --git a/arch/powerpc/mach-mpc85xx/fsl_i2c.c b/arch/powerpc/mach-mpc85xx/fsl_i2c.c
index 51fcc64c26..8cf80713f6 100644
--- a/arch/powerpc/mach-mpc85xx/fsl_i2c.c
+++ b/arch/powerpc/mach-mpc85xx/fsl_i2c.c
@@ -21,6 +21,7 @@
#include <mach/clock.h>
#include <mach/immap_85xx.h>
#include <mach/early_udelay.h>
+#include <mach/fsl_i2c.h>
/* FSL I2C registers */
#define FSL_I2C_ADR 0x00
--
2.28.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/6] powerpc: Make locally used functions static
2020-09-15 7:02 [PATCH 0/6] powerpc: Fix compiler warnings Sascha Hauer
2020-09-15 7:03 ` [PATCH 1/6] powerpc: Add prototypes to header file Sascha Hauer
2020-09-15 7:03 ` [PATCH 2/6] powerpc: Add missing includes Sascha Hauer
@ 2020-09-15 7:03 ` Sascha Hauer
2020-09-15 7:03 ` [PATCH 4/6] powerpc: Add prototypes for functions called from assembly Sascha Hauer
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2020-09-15 7:03 UTC (permalink / raw)
To: Barebox List
Make only locally used functions static to avoid -Wmissing-prototypes
warnings.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/powerpc/cpu-85xx/traps.c | 6 +++---
arch/powerpc/ddr-8xxx/ctrl_regs.c | 7 ++++---
arch/powerpc/ddr-8xxx/ddr2_dimm_params.c | 2 +-
arch/powerpc/mach-mpc5xxx/speed.c | 2 +-
arch/powerpc/mach-mpc5xxx/time.c | 2 +-
arch/powerpc/mach-mpc5xxx/traps.c | 6 +++---
arch/powerpc/mach-mpc85xx/cpu_init.c | 10 +++++-----
arch/powerpc/mach-mpc85xx/time.c | 2 +-
drivers/net/fec_mpc5200.c | 2 +-
9 files changed, 20 insertions(+), 19 deletions(-)
diff --git a/arch/powerpc/cpu-85xx/traps.c b/arch/powerpc/cpu-85xx/traps.c
index 0a8862191f..51c85775fc 100644
--- a/arch/powerpc/cpu-85xx/traps.c
+++ b/arch/powerpc/cpu-85xx/traps.c
@@ -61,7 +61,7 @@ static inline unsigned long get_esr(void)
/*
* Trap & Exception support
*/
-void print_backtrace(unsigned long *sp)
+static void print_backtrace(unsigned long *sp)
{
int cnt = 0;
unsigned long i;
@@ -82,7 +82,7 @@ void print_backtrace(unsigned long *sp)
printf("\n");
}
-void show_regs(struct pt_regs *regs)
+static void show_regs(struct pt_regs *regs)
{
int i;
@@ -107,7 +107,7 @@ void show_regs(struct pt_regs *regs)
}
}
-void _exception(int signr, struct pt_regs *regs)
+static void _exception(int signr, struct pt_regs *regs)
{
show_regs(regs);
print_backtrace((unsigned long *)regs->gpr[1]);
diff --git a/arch/powerpc/ddr-8xxx/ctrl_regs.c b/arch/powerpc/ddr-8xxx/ctrl_regs.c
index e3d43ab09e..187f450c39 100644
--- a/arch/powerpc/ddr-8xxx/ctrl_regs.c
+++ b/arch/powerpc/ddr-8xxx/ctrl_regs.c
@@ -411,7 +411,8 @@ set_ddr_sdram_interval(struct fsl_ddr_cfg_regs_s *ddr,
ddr->ddr_sdram_interval = (((refint & 0xFFFF) << 16)
| ((bstopre & 0x3FFF) << 0));
}
-void set_ddr3_sdram_mode(struct fsl_ddr_cfg_regs_s *ddr,
+
+static void set_ddr3_sdram_mode(struct fsl_ddr_cfg_regs_s *ddr,
const struct memctl_options_s *popts,
const struct common_timing_params_s *dimm,
uint32_t cas_latency, uint32_t additive_latency)
@@ -508,7 +509,7 @@ void set_ddr3_sdram_mode(struct fsl_ddr_cfg_regs_s *ddr,
);
}
-void set_ddr2_sdram_mode(struct fsl_ddr_cfg_regs_s *ddr,
+static void set_ddr2_sdram_mode(struct fsl_ddr_cfg_regs_s *ddr,
const struct memctl_options_s *popts,
const struct common_timing_params_s *dimm,
uint32_t cas_latency, uint32_t additive_latency)
@@ -571,7 +572,7 @@ void set_ddr2_sdram_mode(struct fsl_ddr_cfg_regs_s *ddr,
| ((sdmode & 0xFFFF) << 0));
}
-void set_ddrx_sdram_mode(struct fsl_ddr_cfg_regs_s *ddr,
+static void set_ddrx_sdram_mode(struct fsl_ddr_cfg_regs_s *ddr,
const struct memctl_options_s *popts,
const struct common_timing_params_s *dimm,
uint32_t cas_latency, uint32_t additive_latency)
diff --git a/arch/powerpc/ddr-8xxx/ddr2_dimm_params.c b/arch/powerpc/ddr-8xxx/ddr2_dimm_params.c
index 22c05ca6da..3ae88b7c49 100644
--- a/arch/powerpc/ddr-8xxx/ddr2_dimm_params.c
+++ b/arch/powerpc/ddr-8xxx/ddr2_dimm_params.c
@@ -164,7 +164,7 @@ static uint32_t determine_refresh_rate_ps(const uint32_t spd_refresh)
/* CL2 CL3 CL4 CL5 CL6 CL7 */
uint16_t ddr2_speed_bins[] = { 0, 5000, 3750, 3000, 2500, 1875 };
-uint32_t compute_derated_DDR2_CAS_latency(uint32_t mclk_ps)
+static uint32_t compute_derated_DDR2_CAS_latency(uint32_t mclk_ps)
{
const uint32_t num_speed_bins = ARRAY_SIZE(ddr2_speed_bins);
uint32_t lowest_tCKmin_found = 0, lowest_tCKmin_CL = 0, i, x;
diff --git a/arch/powerpc/mach-mpc5xxx/speed.c b/arch/powerpc/mach-mpc5xxx/speed.c
index 8aa20bd373..760d923bcf 100644
--- a/arch/powerpc/mach-mpc5xxx/speed.c
+++ b/arch/powerpc/mach-mpc5xxx/speed.c
@@ -88,7 +88,7 @@ unsigned long get_timebase_clock(void)
return (get_bus_clock() + 3L) / 4L;
}
-int prt_mpc5xxx_clks (void)
+static int prt_mpc5xxx_clks (void)
{
printf(" Bus %ld MHz, IPB %ld MHz, PCI %ld MHz\n",
get_bus_clock() / 1000000, get_ipb_clock() / 1000000,
diff --git a/arch/powerpc/mach-mpc5xxx/time.c b/arch/powerpc/mach-mpc5xxx/time.c
index d1864673bd..8981b14eeb 100644
--- a/arch/powerpc/mach-mpc5xxx/time.c
+++ b/arch/powerpc/mach-mpc5xxx/time.c
@@ -20,7 +20,7 @@
#include <mach/clock.h>
#include <asm/common.h>
-uint64_t ppc_clocksource_read(void)
+static uint64_t ppc_clocksource_read(void)
{
return get_ticks();
}
diff --git a/arch/powerpc/mach-mpc5xxx/traps.c b/arch/powerpc/mach-mpc5xxx/traps.c
index 501a76252c..b3cb5f8318 100644
--- a/arch/powerpc/mach-mpc5xxx/traps.c
+++ b/arch/powerpc/mach-mpc5xxx/traps.c
@@ -41,7 +41,7 @@ int (*debugger_exception_handler)(struct pt_regs *) = 0;
* Trap & Exception support
*/
-void
+static void
print_backtrace(unsigned long *sp)
{
int cnt = 0;
@@ -62,7 +62,7 @@ print_backtrace(unsigned long *sp)
printf("\n");
}
-void show_regs(struct pt_regs * regs)
+static void show_regs(struct pt_regs * regs)
{
int i;
@@ -90,7 +90,7 @@ void show_regs(struct pt_regs * regs)
}
-void
+static void
_exception(int signr, struct pt_regs *regs)
{
show_regs(regs);
diff --git a/arch/powerpc/mach-mpc85xx/cpu_init.c b/arch/powerpc/mach-mpc85xx/cpu_init.c
index 4e13404aff..b9eadfadfd 100644
--- a/arch/powerpc/mach-mpc85xx/cpu_init.c
+++ b/arch/powerpc/mach-mpc85xx/cpu_init.c
@@ -34,7 +34,7 @@
/* NOR workaround for P1010 erratum A003399 */
#if defined(CONFIG_FSL_ERRATUM_P1010_A003549)
#define SRAM_BASE_ADDR 0x100
-void setup_ifc(void)
+static void setup_ifc(void)
{
u32 mas0, mas1, mas2, mas3, mas7;
phys_addr_t flash_phys = CFG_FLASH_BASE_PHYS;
@@ -89,7 +89,7 @@ void setup_ifc(void)
set_ifc_amask(0, CFG_IFC_AMASK0);
}
-void fsl_erratum_ifc_a003399(void)
+static void fsl_erratum_ifc_a003399(void)
{
u32 mas0, mas1, mas2, mas3, mas7;
void __iomem *l2cache = IOMEM(MPC85xx_L2_ADDR);
@@ -127,7 +127,7 @@ void fsl_erratum_ifc_a003399(void)
out_be32(l2cache + MPC85xx_L2_L2SRBAR0_OFFSET, 0x0);
}
#else
-void fsl_erratum_ifc_a003399(void) {}
+static void fsl_erratum_ifc_a003399(void) {}
#endif
int fsl_l2_cache_init(void)
@@ -173,7 +173,7 @@ int fsl_l2_cache_init(void)
}
#if defined(CONFIG_FSL_ERRATUM_P1010_A003549)
-void fsl_erratum_p1010_a003549(void)
+static void fsl_erratum_p1010_a003549(void)
{
void __iomem *guts = IOMEM(MPC85xx_GUTS_ADDR);
@@ -181,7 +181,7 @@ void fsl_erratum_p1010_a003549(void)
MPC85xx_PMUXCR_LCLK_IFC_CS3);
}
#else
-void fsl_erratum_p1010_a003549(void) {}
+static void fsl_erratum_p1010_a003549(void) {}
#endif
void cpu_init_early_f(void)
diff --git a/arch/powerpc/mach-mpc85xx/time.c b/arch/powerpc/mach-mpc85xx/time.c
index f0acd91a1d..067bce8ea6 100644
--- a/arch/powerpc/mach-mpc85xx/time.c
+++ b/arch/powerpc/mach-mpc85xx/time.c
@@ -20,7 +20,7 @@
#include <init.h>
#include <mach/clock.h>
-uint64_t ppc_clocksource_read(void)
+static uint64_t ppc_clocksource_read(void)
{
return get_ticks();
}
diff --git a/drivers/net/fec_mpc5200.c b/drivers/net/fec_mpc5200.c
index b47813aaed..4025664d0d 100644
--- a/drivers/net/fec_mpc5200.c
+++ b/drivers/net/fec_mpc5200.c
@@ -637,7 +637,7 @@ static int mpc5xxx_fec_recv(struct eth_device *dev)
return len;
}
-int mpc5xxx_fec_probe(struct device_d *dev)
+static int mpc5xxx_fec_probe(struct device_d *dev)
{
struct resource *iores;
struct fec_platform_data *pdata = dev->platform_data;
--
2.28.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 4/6] powerpc: Add prototypes for functions called from assembly
2020-09-15 7:02 [PATCH 0/6] powerpc: Fix compiler warnings Sascha Hauer
` (2 preceding siblings ...)
2020-09-15 7:03 ` [PATCH 3/6] powerpc: Make locally used functions static Sascha Hauer
@ 2020-09-15 7:03 ` Sascha Hauer
2020-09-15 7:03 ` [PATCH 5/6] powerpc: Remove unused functions Sascha Hauer
2020-09-15 7:03 ` [PATCH 6/6] powerpc: Add function prototypes for exception handlers Sascha Hauer
5 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2020-09-15 7:03 UTC (permalink / raw)
To: Barebox List
Some functions are called from assembly only. There's no prototype
for them so this leads to -Wmissing-prototypes warnings. Add a prototype
right aboce the functions to avoid these warnings.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/powerpc/boards/pcm030/pcm030.c | 3 +++
arch/powerpc/lib/board.c | 3 +++
arch/powerpc/mach-mpc85xx/cpu.c | 3 +++
arch/powerpc/mach-mpc85xx/cpu_init.c | 3 +++
4 files changed, 12 insertions(+)
diff --git a/arch/powerpc/boards/pcm030/pcm030.c b/arch/powerpc/boards/pcm030/pcm030.c
index 330d29868e..c603643d58 100644
--- a/arch/powerpc/boards/pcm030/pcm030.c
+++ b/arch/powerpc/boards/pcm030/pcm030.c
@@ -143,6 +143,9 @@ static void sdram_start (int hi_addr)
__asm__ volatile ("sync");
}
+/* Called from assembly */
+void initdram(int board_type);
+
void initdram (int board_type)
{
ulong dramsize = 0;
diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index 9031b37ada..a6111606b6 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -33,6 +33,9 @@
************************************************************************
*/
+/* Called from assembly */
+void board_init_r (ulong end_of_ram);
+
void board_init_r (ulong end_of_ram)
{
unsigned long malloc_end;
diff --git a/arch/powerpc/mach-mpc85xx/cpu.c b/arch/powerpc/mach-mpc85xx/cpu.c
index 1d5a69c999..a5241b82a7 100644
--- a/arch/powerpc/mach-mpc85xx/cpu.c
+++ b/arch/powerpc/mach-mpc85xx/cpu.c
@@ -49,6 +49,9 @@ static int restart_register_feature(void)
}
coredevice_initcall(restart_register_feature);
+/* Called from assembly */
+long int initdram(int board_type);
+
long int initdram(int board_type)
{
phys_size_t dram_size = 0;
diff --git a/arch/powerpc/mach-mpc85xx/cpu_init.c b/arch/powerpc/mach-mpc85xx/cpu_init.c
index b9eadfadfd..3259945fda 100644
--- a/arch/powerpc/mach-mpc85xx/cpu_init.c
+++ b/arch/powerpc/mach-mpc85xx/cpu_init.c
@@ -184,6 +184,9 @@ static void fsl_erratum_p1010_a003549(void)
static void fsl_erratum_p1010_a003549(void) {}
#endif
+/* Called from assembly */
+void cpu_init_early_f(void);
+
void cpu_init_early_f(void)
{
u32 mas0, mas1, mas2, mas3, mas7;
--
2.28.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 5/6] powerpc: Remove unused functions
2020-09-15 7:02 [PATCH 0/6] powerpc: Fix compiler warnings Sascha Hauer
` (3 preceding siblings ...)
2020-09-15 7:03 ` [PATCH 4/6] powerpc: Add prototypes for functions called from assembly Sascha Hauer
@ 2020-09-15 7:03 ` Sascha Hauer
2020-09-15 7:03 ` [PATCH 6/6] powerpc: Add function prototypes for exception handlers Sascha Hauer
5 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2020-09-15 7:03 UTC (permalink / raw)
To: Barebox List
Some functions are unused in the code base and do not have a prototype
in any header file. Remove them.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/powerpc/mach-mpc5xxx/cpu.c | 24 -------------------
arch/powerpc/mach-mpc5xxx/traps.c | 22 -----------------
arch/powerpc/mach-mpc85xx/fsl_gpio.c | 35 ----------------------------
arch/powerpc/mach-mpc85xx/speed.c | 9 -------
4 files changed, 90 deletions(-)
diff --git a/arch/powerpc/mach-mpc5xxx/cpu.c b/arch/powerpc/mach-mpc5xxx/cpu.c
index a85e1667bc..d8d4dfb2ce 100644
--- a/arch/powerpc/mach-mpc5xxx/cpu.c
+++ b/arch/powerpc/mach-mpc5xxx/cpu.c
@@ -33,30 +33,6 @@
#include <asm-generic/memory_layout.h>
#include <memory.h>
-int checkcpu (void)
-{
- ulong clock = get_cpu_clock();
- uint svr, pvr;
-
- puts ("CPU: ");
-
- svr = get_svr();
- pvr = get_pvr();
- switch (SVR_VER (svr)) {
- case SVR_MPC5200:
- printf ("MPC5200");
- break;
- default:
- printf ("MPC52?? (SVR %08x)", svr);
- break;
- }
-
- printf (" v%d.%d, Core v%d.%d", SVR_MJREV (svr), SVR_MNREV (svr),
- PVR_MAJ(pvr), PVR_MIN(pvr));
- printf (" at %ld Hz\n", clock);
- return 0;
-}
-
/* ------------------------------------------------------------------------- */
static int mpc5xxx_reserve_region(void)
diff --git a/arch/powerpc/mach-mpc5xxx/traps.c b/arch/powerpc/mach-mpc5xxx/traps.c
index b3cb5f8318..e93b5d6d75 100644
--- a/arch/powerpc/mach-mpc5xxx/traps.c
+++ b/arch/powerpc/mach-mpc5xxx/traps.c
@@ -168,19 +168,6 @@ ProgramCheckException(struct pt_regs *regs)
panic("Program Check Exception");
}
-void
-SoftEmuException(struct pt_regs *regs)
-{
-#ifdef CONFIG_KGDB
- if (debugger_exception_handler && (*debugger_exception_handler)(regs))
- return;
-#endif
- show_regs(regs);
- print_backtrace((unsigned long *)regs->gpr[1]);
- panic("Software Emulation Exception");
-}
-
-
void
UnknownException(struct pt_regs *regs)
{
@@ -207,12 +194,3 @@ DebugException(struct pt_regs *regs)
do_bedbug_breakpoint( regs );
#endif
}
-
-/* Probe an address by reading. If not present, return -1, otherwise
- * return 0.
- */
-int
-addr_probe(uint *addr)
-{
- return 0;
-}
diff --git a/arch/powerpc/mach-mpc85xx/fsl_gpio.c b/arch/powerpc/mach-mpc85xx/fsl_gpio.c
index 468c780ff8..85994dcf1b 100644
--- a/arch/powerpc/mach-mpc85xx/fsl_gpio.c
+++ b/arch/powerpc/mach-mpc85xx/fsl_gpio.c
@@ -28,39 +28,4 @@ void fsl_enable_gpiout(void)
out_be32(gpiocr, in_be32(gpiocr) | MPC85xx_GPIOCR_GPOUT);
}
-
-void gpio_set_value(unsigned gpio, int val)
-{
- void __iomem *gpout = IOMEM(MPC85xx_GUTS_ADDR + MPC85xx_GPOUTDR_OFFSET);
- int gpoutdr;
-
- if (gpio >= 8)
- return;
-
- gpoutdr = in_be32(gpout);
- if (val)
- gpoutdr |= MPC85xx_GPIOBIT(gpio);
- else
- gpoutdr &= ~MPC85xx_GPIOBIT(gpio);
- out_be32(gpout, gpoutdr);
-}
-#else
-int gpio_direction_output(unsigned gpio, int val)
-{
- void __iomem *gpior = IOMEM(MPC85xx_GPIO_ADDR);
-
- if (gpio >= 16)
- return -EINVAL;
-
- if (val)
- setbits_be32(gpior + MPC85xx_GPIO_GPDAT_OFFSET,
- 1 << (32 - gpio));
- else
- clrbits_be32(gpior + MPC85xx_GPIO_GPDAT_OFFSET,
- 1 << (32 - gpio));
-
- setbits_be32(gpior + MPC85xx_GPIO_GPDIR_OFFSET, 1 << (32 - gpio));
-
- return 0;
-}
#endif
diff --git a/arch/powerpc/mach-mpc85xx/speed.c b/arch/powerpc/mach-mpc85xx/speed.c
index 7f3cfc4dcd..16ce72d846 100644
--- a/arch/powerpc/mach-mpc85xx/speed.c
+++ b/arch/powerpc/mach-mpc85xx/speed.c
@@ -85,15 +85,6 @@ void fsl_get_sys_info(struct sys_info *sysInfo)
}
}
-unsigned long fsl_get_local_freq(void)
-{
- struct sys_info sys_info;
-
- fsl_get_sys_info(&sys_info);
-
- return sys_info.freqLocalBus;
-}
-
unsigned long fsl_get_bus_freq(ulong dummy)
{
struct sys_info sys_info;
--
2.28.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 6/6] powerpc: Add function prototypes for exception handlers
2020-09-15 7:02 [PATCH 0/6] powerpc: Fix compiler warnings Sascha Hauer
` (4 preceding siblings ...)
2020-09-15 7:03 ` [PATCH 5/6] powerpc: Remove unused functions Sascha Hauer
@ 2020-09-15 7:03 ` Sascha Hauer
5 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2020-09-15 7:03 UTC (permalink / raw)
To: Barebox List
The exception handlers lead to -Wmissing-prototypes warnings. Add
prototypes for them to avoid these warnings.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/powerpc/include/asm/processor.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h
index 39a89a9d15..f4677d11e1 100644
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -1109,6 +1109,14 @@ void ll_puts(const char *);
/* In misc.c */
void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val);
+void CritcalInputException(struct pt_regs *regs);
+void MachineCheckException(struct pt_regs *regs);
+void AlignmentException(struct pt_regs *regs);
+void ProgramCheckException(struct pt_regs *regs);
+void PITException(struct pt_regs *regs);
+void UnknownException(struct pt_regs *regs);
+void DebugException(struct pt_regs *regs);
+
#endif /* ndef ASSEMBLY*/
#ifdef CONFIG_MACH_SPECIFIC
--
2.28.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-09-15 7:03 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-15 7:02 [PATCH 0/6] powerpc: Fix compiler warnings Sascha Hauer
2020-09-15 7:03 ` [PATCH 1/6] powerpc: Add prototypes to header file Sascha Hauer
2020-09-15 7:03 ` [PATCH 2/6] powerpc: Add missing includes Sascha Hauer
2020-09-15 7:03 ` [PATCH 3/6] powerpc: Make locally used functions static Sascha Hauer
2020-09-15 7:03 ` [PATCH 4/6] powerpc: Add prototypes for functions called from assembly Sascha Hauer
2020-09-15 7:03 ` [PATCH 5/6] powerpc: Remove unused functions Sascha Hauer
2020-09-15 7:03 ` [PATCH 6/6] powerpc: Add function prototypes for exception handlers Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox