From a686b7254799faacfc2f809e6276424546f0ec45 Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Thu, 28 Sep 2017 21:08:26 +0900 Subject: [PATCH 01/16] arm: sc8830: clock_test: remove clock_test.c file clock_teset.c doesn't need to build. Remove clock_teset.c file. Change-Id: Ie1c6bbddfe41990dbaab582dedce855c83238ad5 Signed-off-by: Jaehoon Chung --- arch/arm/cpu/armv7/sc8830/Makefile | 2 +- arch/arm/cpu/armv7/sc8830/clock_test.c | 121 --------------------------------- 2 files changed, 1 insertion(+), 122 deletions(-) delete mode 100644 arch/arm/cpu/armv7/sc8830/clock_test.c diff --git a/arch/arm/cpu/armv7/sc8830/Makefile b/arch/arm/cpu/armv7/sc8830/Makefile index 0b1e7d8..b44c389 100644 --- a/arch/arm/cpu/armv7/sc8830/Makefile +++ b/arch/arm/cpu/armv7/sc8830/Makefile @@ -24,7 +24,7 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(SOC).o -COBJS = generic.o timer.o reset.o ldo.o mfp_sprd.o mmu.o adc.o rtc-sprd.o sec_boot.o glb.o adi.o gpio.o gpio_phy.o clock.o clock_test.o check_reboot.o eic.o +COBJS = generic.o timer.o reset.o ldo.o mfp_sprd.o mmu.o adc.o rtc-sprd.o sec_boot.o glb.o adi.o gpio.o gpio_phy.o clock.o check_reboot.o eic.o ifneq ($(CONFIG_ADIE_SC2723)$(CONFIG_ADIE_SC2723S),) COBJS += vibrator_sc2723.o diff --git a/arch/arm/cpu/armv7/sc8830/clock_test.c b/arch/arm/cpu/armv7/sc8830/clock_test.c deleted file mode 100644 index 788e43e..0000000 --- a/arch/arm/cpu/armv7/sc8830/clock_test.c +++ /dev/null @@ -1,121 +0,0 @@ -#include -#include -#include - -extern const u32 __clkinit0 __clkinit_begin; -extern const u32 __clkinit2 __clkinit_end; - -static unsigned int get_clock_rate(const char *clk_name) -{ - unsigned int rate; - struct clk *clk; - - clk =clk_get(0, clk_name); - - if (clk == NULL) - { - printf("%s can't find!\r\n"); - return 0; - } - - if (clk->ops) - { - rate = clk->ops->get_rate(clk); - } - else - { - rate = clk->rate; - } - printf("%s : %d\r\n", clk_name, rate); - return rate; -} - -static unsigned int change_clock_rate(const *clk_name, unsigned int rate) -{ - struct clk *clk; - - clk =clk_get(0, clk_name); - - if (clk == NULL) - { - printf("%s can't find!\r\n"); - return -1; - } - - if (clk->ops) - { - if (clk->ops->set_rate) - { - clk->ops->set_rate(clk, rate); - } - else - { - return -1; - } - } - else - { - return -1; - } - printf("%s ==> %d\r\n", clk_name, rate); - return 0; -} - -void clock_test() -{ - struct clk *clk; - - sci_clock_init(); - - printf("clock_test, __clkinit_begin:%08X (%08X), __clkinit_end:%08X (%08X)\r\n\r\n", - &__clkinit_begin, __clkinit_begin, &__clkinit_end, __clkinit_end); - - { - struct clk_lookup *cl = (struct clk_lookup *)(&__clkinit_begin + 1); - while (cl < (struct clk_lookup *)&__clkinit_end) - { - clk =clk_get(0, cl->con_id); - if (clk != ERR_PTR(-2)) - { - if (clk->ops) - { - printf("1.clk: %s, rate: %d\r\n", cl->con_id, clk->ops->get_rate(clk)); - } - else - { - printf("2.clk: %s, rate: %d\r\n", cl->con_id, clk->rate); - } - } - else - { - printf("get %s error!\r\n", cl->con_id); - } - cl++; - } - } - printf("---------------------------------------\r\n"); - get_clock_rate("clk_arm"); - get_clock_rate("clk_axi"); - get_clock_rate("clk_ahb"); - get_clock_rate("clk_apb"); - - get_clock_rate("clk_emmc"); - change_clock_rate("clk_emmc", 192000000); - get_clock_rate("clk_emmc"); - - get_clock_rate("clk_apb"); - change_clock_rate("clk_apb", 100000000); - get_clock_rate("clk_apb"); - - - get_clock_rate("clk_emc"); - change_clock_rate("clk_emc", 100000000); - get_clock_rate("clk_emc"); - - get_clock_rate("clk_dbg"); - change_clock_rate("clk_dbg", 200000000); - get_clock_rate("clk_dbg"); - - printf("clock test end!\r\n"); -} - -- 2.7.4 From 379d0d81236b4b8ffcdacd577fb1e71082d5791b Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Thu, 28 Sep 2017 21:19:15 +0900 Subject: [PATCH 02/16] i2c: i2c_phy_v0: remove the debug message These messages aren't displayed. Remove the unnecessary debug message for fixing compile warning. Change-Id: If7474ae0f06c8a39ffd3b734f4fdb2267c866569 Signed-off-by: Jaehoon Chung --- drivers/i2c/v0/i2c_phy_v0.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/i2c/v0/i2c_phy_v0.c b/drivers/i2c/v0/i2c_phy_v0.c index 568b5ab..408590d 100644 --- a/drivers/i2c/v0/i2c_phy_v0.c +++ b/drivers/i2c/v0/i2c_phy_v0.c @@ -246,8 +246,7 @@ LOCAL ERR_I2C_E I2C_PHY_ControlInit_V0 (uint32 phy_id, uint32 freq, uint32 port) //Clear I2C int //CHIP_REG_OR (I2C_CMD, I2CCMD_INT_ACK); ptr->cmd &= ~ (I2CCMD_INT_ACK); - - IIC_PRINT ("[IIC DRV:]I2C_PHY_ControlInit_V0: freq=%d, port=%d", freq, port); + return ERR_I2C_NONE; } @@ -280,7 +279,6 @@ LOCAL ERR_I2C_E I2C_PHY_StartBus_V0 (uint32 phy_id, uint8 addr, BOOLEAN rw, BOOL } cmd = cmd | I2CCMD_START | I2CCMD_WRITE; - IIC_PRINT ("[IIC DRV:]I2C_PHY_StartBus_V0: cmd=%x", cmd); ptr->cmd = cmd; I2C_WAIT_INT I2C_CLEAR_INT @@ -323,7 +321,6 @@ LOCAL ERR_I2C_E I2C_PHY_WriteBytes_V0 (uint32 phy_id, uint8 *pCmd, uint32 len, B } ptr->cmd = cmd; - IIC_PRINT ("[IIC DRV:]I2C_PHY_WriteBytes_V0: cmd=%x", cmd); I2C_WAIT_INT I2C_CLEAR_INT @@ -366,7 +363,6 @@ LOCAL ERR_I2C_E I2C_PHY_ReadBytes_V0 (uint32 phy_id, uint8 *pCmd, uint32 len, BO } ptr->cmd = cmd; - IIC_PRINT ("[IIC DRV:]I2C_PHY_ReadBytes_V0: cmd=%x", cmd); I2C_WAIT_INT I2C_CLEAR_INT pCmd[i] = (uint8) ( (ptr->cmd) >>8); -- 2.7.4 From 8425d14bc2e8a8c60d189ee4534eb5e7bcc76de8 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 22 Apr 2012 06:59:06 +0000 Subject: [PATCH 03/16] image/fit: drop inline markings on parser code Putting "inline" on extern funcs makes no sense, so drop them. Signed-off-by: Mike Frysinger [jh80.chung: cherry-pick from u-boot mainline to remove build warning] Signed-off-by: Jaehoon Chung Change-Id: I27f1f80aaa6d6212ea9390ad7fa697cf993fe133 --- common/image.c | 4 ++-- include/image.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/image.c b/common/image.c index 42f5b79..c652d67 100644 --- a/common/image.c +++ b/common/image.c @@ -1687,7 +1687,7 @@ static int fit_parse_spec (const char *spec, char sepc, ulong addr_curr, * addr and conf_name are set accordingly * 0 otherwise */ -inline int fit_parse_conf (const char *spec, ulong addr_curr, +int fit_parse_conf(const char *spec, ulong addr_curr, ulong *addr, const char **conf_name) { return fit_parse_spec (spec, '#', addr_curr, addr, conf_name); @@ -1713,7 +1713,7 @@ inline int fit_parse_conf (const char *spec, ulong addr_curr, * addr and image_name are set accordingly * 0 otherwise */ -inline int fit_parse_subimage (const char *spec, ulong addr_curr, +int fit_parse_subimage(const char *spec, ulong addr_curr, ulong *addr, const char **image_name) { return fit_parse_spec (spec, ':', addr_curr, addr, image_name); diff --git a/include/image.h b/include/image.h index 49d6280..fab37e9 100644 --- a/include/image.h +++ b/include/image.h @@ -546,9 +546,9 @@ static inline int image_check_target_arch (const image_header_t *hdr) #define FIT_MAX_HASH_LEN 20 /* max(crc32_len(4), sha1_len(20)) */ /* cmdline argument format parsing */ -inline int fit_parse_conf (const char *spec, ulong addr_curr, +int fit_parse_conf(const char *spec, ulong addr_curr, ulong *addr, const char **conf_name); -inline int fit_parse_subimage (const char *spec, ulong addr_curr, +int fit_parse_subimage(const char *spec, ulong addr_curr, ulong *addr, const char **image_name); void fit_print_contents (const void *fit); -- 2.7.4 From 853a0f62d969a6f33f3e9a2162ad2bb1cd305394 Mon Sep 17 00:00:00 2001 From: Jeroen Hofstee Date: Thu, 10 Jul 2014 20:12:45 +0200 Subject: [PATCH 04/16] lib:sha1: remove unused constant This prevents a clang warning. Signed-off-by: Jeroen Hofstee [sw0312.kim: cherry-pick from mainline commit 6b13f0c050c7 to fix build warning] Signed-off-by: Seung-Woo Kim Change-Id: I288fa12a608c09194a5165070fa4bbc011b0a1a3 --- lib/sha1.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/sha1.c b/lib/sha1.c index da5bc16..49b1f4c 100644 --- a/lib/sha1.c +++ b/lib/sha1.c @@ -386,8 +386,6 @@ void sha1_hmac (unsigned char *key, int keylen, memset (&ctx, 0, sizeof (sha1_context)); } -static const char _sha1_src[] = "_sha1_src"; - #ifdef SELF_TEST /* * FIPS-180-1 test vectors -- 2.7.4 From 448a8edaa6a75ad4632e4b65c7bf4101b7d0c69d Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Mon, 26 Sep 2011 02:26:06 +0200 Subject: [PATCH 05/16] GCC4.6: Squash warning in cmd_mem.c MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit cmd_mem.c: In function ‘do_mem_loop’: cmd_mem.c:474:25: warning: variable ‘junk’ set but not used [-Wunused-but-set-variable] The assigned variable can be removed because the pointers are volatile so accesses to their addresses are always generated. Signed-off-by: Marek Vasut [sw0312.kim: cherry-pick from mainline commit f3b3c3df189f to fix build warning] Signed-off-by: Seung-Woo Kim Change-Id: I20e93f08dc0e7fbc73fbfdf213781948f9737eb7 --- common/cmd_mem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/cmd_mem.c b/common/cmd_mem.c index f7a442a..369abff 100644 --- a/common/cmd_mem.c +++ b/common/cmd_mem.c @@ -474,7 +474,7 @@ int do_mem_base (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) int do_mem_loop (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { - ulong addr, length, i, junk; + ulong addr, length, i; int size; volatile uint *longp; volatile ushort *shortp; @@ -521,7 +521,7 @@ int do_mem_loop (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) longp = (uint *)addr; i = length; while (i-- > 0) - junk = *longp++; + *longp++; } } if (size == 2) { @@ -529,14 +529,14 @@ int do_mem_loop (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) shortp = (ushort *)addr; i = length; while (i-- > 0) - junk = *shortp++; + *shortp++; } } for (;;) { cp = (u_char *)addr; i = length; while (i-- > 0) - junk = *cp++; + *cp++; } } -- 2.7.4 From ae0db780f0d51cd4350d6236e105f2b430d6ec6a Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Mon, 26 Sep 2011 02:26:03 +0200 Subject: [PATCH 06/16] GCC4.6: Squash warning in cmd_nvedit.c MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit cmd_nvedit.c: In function ‘do_env_edit’: cmd_nvedit.c:463:6: warning: variable ‘len’ set but not used [-Wunused-but-set-variable] Signed-off-by: Marek Vasut [sw0312.kim: cherry-pick from mainline commit 7fcd9bbd6f0a6 to fix build warning] Signed-off-by: Seung-Woo Kim Change-Id: I241ecf6c472b6fc43ccc2254abaa38434767586c --- common/cmd_nvedit.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index dcc93c1..d92b94d 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -424,7 +424,6 @@ int do_env_edit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char buffer[CONFIG_SYS_CBSIZE]; char *init_val; - int len; if (argc < 2) return cmd_usage(cmdtp); @@ -432,7 +431,7 @@ int do_env_edit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) /* Set read buffer to initial value or empty sting */ init_val = getenv(argv[1]); if (init_val) - len = sprintf(buffer, "%s", init_val); + sprintf(buffer, "%s", init_val); else buffer[0] = '\0'; -- 2.7.4 From 481d935dea3ca1307013593099e30178e44d91cf Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Mon, 26 Sep 2011 02:26:04 +0200 Subject: [PATCH 07/16] GCC4.6: Squash warnings in lcd.c MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit lcd.c: In function ‘lcd_drawchars’: lcd.c:214:9: warning: variable ‘off’ set but not used [-Wunused-but-set-variable] lcd.c: In function ‘lcd_display_bitmap’: lcd.c:617:16: warning: variable ‘compression’ set but not used [-Wunused-but-set-variable] Signed-off-by: Marek Vasut [sw0312.kim: cherry-pick from mainline commit be547c6db32d to fix build warning] Signed-off-by: Seung-Woo Kim Change-Id: I09ae696ae78c82a8761b4ef15befa6f55eddbcc4 --- common/lcd.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/common/lcd.c b/common/lcd.c index ad334ce..134004f 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -221,10 +221,13 @@ void lcd_printf(const char *fmt, ...) static void lcd_drawchars (ushort x, ushort y, uchar *str, int count) { uchar *dest; - ushort off, row; + ushort row; + +#if LCD_BPP == LCD_MONOCHROME + ushort off = x * (1 << LCD_BPP) % 8; +#endif dest = (uchar *)(lcd_base + y * lcd_line_length + x * (1 << LCD_BPP) / 8); - off = x * (1 << LCD_BPP) % 8; for (row=0; row < VIDEO_FONT_HEIGHT; ++row, dest += lcd_line_length) { uchar *s = str; @@ -706,7 +709,6 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) unsigned long width, height, byte_width; unsigned long pwidth = panel_info.vl_col; unsigned colors, bpix, bmp_bpix; - unsigned long compression; #if defined CONFIG_PXA250 || defined CONFIG_PXA27X || defined CONFIG_CPU_MONAHANS struct pxafb_info *fbi = &panel_info.pxa; #elif defined(CONFIG_MPC823) @@ -724,7 +726,6 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) height = le32_to_cpu (bmp->header.height); bmp_bpix = le16_to_cpu(bmp->header.bit_count); colors = 1 << bmp_bpix; - compression = le32_to_cpu (bmp->header.compression); bpix = NBITS(panel_info.vl_bpix); -- 2.7.4 From 0e5d03f1c119a7d9981f5af1ed16385444d4dd03 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Wed, 8 Nov 2017 16:43:24 +0900 Subject: [PATCH 08/16] ARM: SPRD: fix build warnings for sc8830 Fix build warnings including implicit function, unused variable and incompatible pointer in sc8830 directory. It also removes not used ldo functions causing building. Change-Id: I6fcda323d28437ee5ba41ad9022eb465fc86df83 Signed-off-by: Seung-Woo Kim --- arch/arm/cpu/armv7/sc8830/ldo.c | 101 +---------------------------------- arch/arm/cpu/armv7/sc8830/mfp_sprd.c | 3 +- arch/arm/cpu/armv7/sc8830/mmu.c | 3 +- arch/arm/cpu/armv7/sc8830/reset.c | 1 + arch/arm/cpu/armv7/sc8830/rtc-sprd.c | 1 - arch/arm/cpu/armv7/sc8830/sec_boot.c | 2 +- arch/arm/lib/board.c | 3 ++ 7 files changed, 10 insertions(+), 104 deletions(-) diff --git a/arch/arm/cpu/armv7/sc8830/ldo.c b/arch/arm/cpu/armv7/sc8830/ldo.c index 416ea11..342b290 100644 --- a/arch/arm/cpu/armv7/sc8830/ldo.c +++ b/arch/arm/cpu/armv7/sc8830/ldo.c @@ -40,33 +40,6 @@ } \ }while(0) -struct ldo_ctl_info { -/** - need config area - */ - LDO_ID_E id; - unsigned int bp_reg; - unsigned int bp_bits; - unsigned int bp_rst_reg; - unsigned int bp_rst;//bits - - unsigned int level_reg_b0; - unsigned int b0; - unsigned int b0_rst; - - unsigned int level_reg_b1; - unsigned int b1; - unsigned int b1_rst; - - unsigned int init_level; -/** - not need config area - */ - int ref; - int current_status; - int current_volt_level; -}; - #if defined(CONFIG_SPX15) || defined(CONFIG_ADIE_SC2723) || defined(CONFIG_ADIE_SC2723S) struct { LDO_ID_E id; @@ -114,7 +87,7 @@ struct { }; struct s_ldo_ctl_info { - SLP_LDO_E id; + LDO_ID_E id; unsigned int reg; unsigned int bit; }; @@ -154,6 +127,7 @@ const char* __LDO_NAME(LDO_ID_E ldo_id) int LDO_Init(void) { + extern int regulator_init(void); return regulator_init(); } @@ -207,77 +181,6 @@ LDO_ERR_E LDO_TurnOnLDO(LDO_ID_E ldo_id) #endif } -static struct ldo_ctl_info* LDO_GetLdoCtl(LDO_ID_E ldo_id) -{ - int i = 0; - struct ldo_ctl_info* ctl = NULL; - - for ( i = 0; i < ARRAY_SIZE(s_ldo_ctl_data); ++i) - { - if (s_ldo_ctl_data[i].id == ldo_id) - { - ctl = &s_ldo_ctl_data[i]; - break; - } - } - - SCI_PASSERT(ctl != NULL, ("ldo_id = %d", ldo_id)); - return ctl; -} - -LDO_ERR_E LDO_SetVoltLevel(LDO_ID_E ldo_id, LDO_VOLT_LEVEL_E volt_level) -{ - unsigned short reg_data; - struct ldo_ctl_info* ctl = NULL; - - ctl = LDO_GetLdoCtl(ldo_id); - SCI_PASSERT(ctl != NULL, ("ldo_id = %d", ldo_id)); - - if (ctl->level_reg_b0 == LDO_INVALID_REG_ADDR) - { - goto Err_Exit; - } - - if (ctl->level_reg_b0 != ctl->level_reg_b1) - { - printf("ldo_id:%d, level_reg_b0:%08x, level_reg_b1:%08x\r\n", ldo_id, ctl->level_reg_b0, ctl->level_reg_b1); - goto Err_Exit; - } - - switch (volt_level) - { - case LDO_VOLT_LEVEL0: - ANA_REG_AND(ctl->level_reg_b0, (~(ctl->b0|ctl->b1))); - break; - - case LDO_VOLT_LEVEL1: - reg_data = ANA_REG_GET(ctl->level_reg_b0); - reg_data &=~ctl->b1; - reg_data |= ctl->b0; - ANA_REG_SET(ctl->level_reg_b0, reg_data); - break; - - case LDO_VOLT_LEVEL2: - reg_data = ANA_REG_GET(ctl->level_reg_b0); - reg_data &=~ctl->b0; - reg_data |= ctl->b1; - ANA_REG_SET(ctl->level_reg_b0, reg_data); - break; - - case LDO_VOLT_LEVEL3: - ANA_REG_OR (ctl->level_reg_b0, (ctl->b0|ctl->b1)); - break; - - default: - goto Err_Exit; - } - - ctl->current_volt_level = volt_level; - return LDO_ERR_OK; -Err_Exit: - return LDO_ERR_ERR; -} - #else struct ldo_ctl_info { diff --git a/arch/arm/cpu/armv7/sc8830/mfp_sprd.c b/arch/arm/cpu/armv7/sc8830/mfp_sprd.c index ac080b9..51d8617 100644 --- a/arch/arm/cpu/armv7/sc8830/mfp_sprd.c +++ b/arch/arm/cpu/armv7/sc8830/mfp_sprd.c @@ -41,6 +41,7 @@ const static unsigned long pin_gpio_map[MFP_PIN_MAX] = { unsigned long mfp_to_gpio(int pin) { BUG_ON(1); + return 0; } static int __mfp_validate(unsigned long c) @@ -108,8 +109,6 @@ static int __mfp_config_pin(unsigned long c) return 0; } -static unsigned long spi_cs1_gpio_cfg = MFP_CFG_X(SPI_CSN0, GPIO, DS1, F_PULL_NONE, S_PULL_DOWN, IO_NONE); - void sprd_mfp_config(unsigned long *mfp_cfgs, int num) { unsigned long *c; diff --git a/arch/arm/cpu/armv7/sc8830/mmu.c b/arch/arm/cpu/armv7/sc8830/mmu.c index 8c4d12b..828af8a 100644 --- a/arch/arm/cpu/armv7/sc8830/mmu.c +++ b/arch/arm/cpu/armv7/sc8830/mmu.c @@ -1,6 +1,7 @@ #include extern void MMU_EnableIDCM (void); +extern void MMU_InvalideICACHEALL(void); /********************************************************************** Section Descriptor: 31 20 19 12 11 10 9 8 5 4 3 2 1 0 @@ -52,7 +53,7 @@ void MMU_Init (unsigned pageBaseAddr) int i; // 15Mb physical addr for page table - g_mmu_page_table = const_MMUTableStartAddr; + g_mmu_page_table = (unsigned int *)const_MMUTableStartAddr; // Create page table 1mb entries for (i = 0; i < 0x1000; i++) diff --git a/arch/arm/cpu/armv7/sc8830/reset.c b/arch/arm/cpu/armv7/sc8830/reset.c index e2aceda..82541ba 100644 --- a/arch/arm/cpu/armv7/sc8830/reset.c +++ b/arch/arm/cpu/armv7/sc8830/reset.c @@ -43,6 +43,7 @@ */ void reset_cpu (ulong ignored) { + extern void start_watchdog(uint32_t init_time_ms); start_watchdog(5); while (1) ; } diff --git a/arch/arm/cpu/armv7/sc8830/rtc-sprd.c b/arch/arm/cpu/armv7/sc8830/rtc-sprd.c index 528be9b..95f9138 100644 --- a/arch/arm/cpu/armv7/sc8830/rtc-sprd.c +++ b/arch/arm/cpu/armv7/sc8830/rtc-sprd.c @@ -180,7 +180,6 @@ void sprd_rtc_set_alarm_sec(unsigned long secs) int sprd_clean_rtc(void) { - int err; ANA_REG_AND(ANA_RTC_INT_EN, ~(RTC_INT_ALL_MSK)); // disable all interrupt ANA_REG_OR(ANA_REG_GLB_ARM_MODULE_EN, BIT_ANA_RTC_EN); //rtc enable diff --git a/arch/arm/cpu/armv7/sc8830/sec_boot.c b/arch/arm/cpu/armv7/sc8830/sec_boot.c index 6c08c73..c6c5412 100644 --- a/arch/arm/cpu/armv7/sc8830/sec_boot.c +++ b/arch/arm/cpu/armv7/sc8830/sec_boot.c @@ -295,7 +295,7 @@ int harshVerify(uint8_t * data, uint32_t data_len, uint8_t * data_hash, uint8_t bsc_info = (bsc_info_t *) data_key; SHA1Reset_32(&sha); SHA1Input_32(&sha, (uint32_t *) data, data_len >> 2); - SHA1Result_32(&sha, soft_hash_data); + SHA1Result_32(&sha, (unsigned char *)soft_hash_data); memcpy(hash_copy, vlr_info->hash, sizeof(vlr_info->hash)); RSA_Decrypt(hash_copy, bsc_info->key.m, bsc_info->key.r2, (unsigned char *)(&bsc_info->key.e)); diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c index e91a131..ff02661 100644 --- a/arch/arm/lib/board.c +++ b/arch/arm/lib/board.c @@ -680,6 +680,7 @@ void board_init_r (gd_t *id, ulong dest_addr) #ifdef SPRD_EVM_TAG_ON SPRD_EVM_TAG(11); #endif + extern void MMU_Init (unsigned pageBaseAddr); MMU_Init(CONFIG_MMU_TABLE_ADDR); #if !defined(CONFIG_FPGA) @@ -696,6 +697,7 @@ void board_init_r (gd_t *id, ulong dest_addr) #if defined(CONFIG_SC8830) || defined(CONFIG_SC9630) if (sprdbat_get_vbatauxadc_caltype() != 0) { + extern int DCDC_Cal_ArmCore(void); DCDC_Cal_ArmCore(); performance_debug("6:"); } @@ -703,6 +705,7 @@ void board_init_r (gd_t *id, ulong dest_addr) #endif #endif + extern void board_keypad_init(void); board_keypad_init(); boot_pwr_check(); -- 2.7.4 From 7e23307745f6050790da9d14c0dae8b1565503be Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Thu, 28 Dec 2017 17:38:21 +0900 Subject: [PATCH 09/16] logo: remove meaningless packed attributte The logo image is not in struct, so packed attribute has no meaning. Remove the meaning less packed attribute to fix build warnings. Change-Id: I35d118600c44af1fcfbd59b6ad59d7601e1bec9a Signed-off-by: Seung-Woo Kim --- include/charge_bmp_logo.h | 6 +++--- include/normal_mode.h | 6 ++---- include/prog_end_logo.h | 6 +++--- include/prog_mid_logo.h | 6 +++--- include/prog_start_logo.h | 6 +++--- include/sp_bmp_logo.h | 6 +++--- include/thor_bmp_logo.h | 6 +++--- 7 files changed, 20 insertions(+), 22 deletions(-) diff --git a/include/charge_bmp_logo.h b/include/charge_bmp_logo.h index 005a603..aeb7a40 100644 --- a/include/charge_bmp_logo.h +++ b/include/charge_bmp_logo.h @@ -1,8 +1,8 @@ -unsigned short __attribute__((packed, aligned(4))) charge_palette[] = { +unsigned short __attribute__((aligned(4))) charge_palette[] = { 0x0, 0x222, 0x444, 0x666, 0x888, 0xaaa, 0xccc, 0xeee, 0x111, 0x333, 0x555, 0x777, 0x999, 0xbbb, 0xddd, 0xfff, }; -unsigned short __attribute__((packed, aligned(4))) charge_bitmap[] = { +unsigned short __attribute__((aligned(4))) charge_bitmap[] = { 0x0, 0x8, 0x9, 0x8, 0x0, 0x1, 0x2, 0x1, 0x0, 0x1, 0x2, 0x9, 0x2, 0x9, 0x2, 0x1, 0x0, 0x1, 0x2, 0x9, 0x2, 0x8, 0x0, 0x1, 0x2, 0x9, 0x2, 0x8, 0x0, 0x1, @@ -378,7 +378,7 @@ unsigned short __attribute__((packed, aligned(4))) charge_bitmap[] = { 0x0, 0x9, 0x2, 0x9, 0x0, 0x9, 0x2, 0x9, 0x0, 0x1, 0x9, 0x1, 0x0, }; -unsigned int __attribute__((packed, aligned(4))) charge_num_bitmap[] = { +unsigned int __attribute__((aligned(4))) charge_num_bitmap[] = { 3213, 1, 50, 1, 133, 1, 50, 1, 133, 1, 5, 1, 38, 1, 5, 1, 133, 1, 2, 46, 2, 1, 133, 1, 2, 46, 2, 1, 133, 1, diff --git a/include/normal_mode.h b/include/normal_mode.h index 21d955e..ffe8c93 100644 --- a/include/normal_mode.h +++ b/include/normal_mode.h @@ -23,8 +23,6 @@ #include #endif -extern unsigned spl_data_buf[0x2000] __attribute__((align(4))); -extern unsigned harsh_data_buf[8]__attribute__((align(4))); extern void *spl_data; extern void *harsh_data; extern unsigned char raw_header[8192]; @@ -210,10 +208,10 @@ typedef struct _NV_HEADER { void set_vibrator(int on); void vibrator_hw_init(void); void MMU_InvalideICACHEALL(void); -int read_spldata(); +int read_spldata(void); void lcd_display_logo(int backlight_set,ulong bmp_image,size_t size); int creat_cmdline(char * cmdline,boot_img_hdr *hdr); -void vlx_entry(); +void vlx_entry(void); extern char* get_product_sn(void); extern char *calibration_cmd_buf; void set_recovery_mode(unsigned int recovery_mode); diff --git a/include/prog_end_logo.h b/include/prog_end_logo.h index e165253..6a452a4 100644 --- a/include/prog_end_logo.h +++ b/include/prog_end_logo.h @@ -1,4 +1,4 @@ -unsigned short __attribute__((packed, aligned(4))) prog_end_palette[] = { +unsigned short __attribute__((aligned(4))) prog_end_palette[] = { 0x0, 0x1, 0x2, 0x8ab, 0x269, 0x356, 0x7cf, 0x589, 0x68a, 0x357, 0x379, 0x6ad, 0x258, 0x12, 0x13, 0x368, 0x9be, 0x79a, 0x79b, 0x69c, 0x59d, 0xacf, 0x245, 0x23, 0x123, 0x24, 0x146, 0x59c, 0x469, 0x7ab, @@ -9,7 +9,7 @@ unsigned short __attribute__((packed, aligned(4))) prog_end_palette[] = { 0x112, 0x78a, 0x8bd, 0x8ce, 0x568, 0x8ac, 0x89b, 0x7be, 0x477, 0x478, 0x479, 0x37a, 0x6bf, 0x6be, }; -unsigned short __attribute__((packed, aligned(4))) prog_end_bitmap[] = { +unsigned short __attribute__((aligned(4))) prog_end_bitmap[] = { 0x5, 0x38, 0x39, 0x38, 0x2d, 0x26, 0x18, 0xd, 0x1, 0x0, 0x4e, 0x4f, 0x50, 0x44, 0x9, 0x5, 0x16, 0x22, 0x18, 0xd, 0x0, 0x11, 0x1d, 0x1e, 0x12, 0x8, 0x7, 0x35, 0x28, 0x22, @@ -34,7 +34,7 @@ unsigned short __attribute__((packed, aligned(4))) prog_end_bitmap[] = { 0x21, 0x19, 0xe, 0xd, 0x2, 0x1, 0x0, 0x19, 0x3d, 0x19, 0xe, 0xd, 0x1, 0x0, }; -unsigned int __attribute__((packed, aligned(4))) prog_end_num_bitmap[] = { +unsigned int __attribute__((aligned(4))) prog_end_num_bitmap[] = { 1, 6, 1, 1, 1, 2, 1, 1, 1, 2, 1, 6, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 4, 2, 1, 1, 1, 1, 1, 1, diff --git a/include/prog_mid_logo.h b/include/prog_mid_logo.h index 9147264..9d78e86 100644 --- a/include/prog_mid_logo.h +++ b/include/prog_mid_logo.h @@ -1,13 +1,13 @@ -unsigned short __attribute__((packed, aligned(4))) prog_mid_palette[] = { +unsigned short __attribute__((aligned(4))) prog_mid_palette[] = { 0x7cf, 0x69d, 0x7bf, 0x246, 0x147, 0x468, 0x8cf, 0x25, 0x7be, 0x59d, 0xadf, 0x37a, 0x79b, 0x6bf, 0x9be, 0x9df, }; -unsigned short __attribute__((packed, aligned(4))) prog_mid_bitmap[] = { +unsigned short __attribute__((aligned(4))) prog_mid_bitmap[] = { 0x3, 0x5, 0xc, 0xe, 0xa, 0xf, 0x6, 0x0, 0x2, 0xd, 0x2, 0x8, 0x1, 0x9, 0x1, 0x9, 0x1, 0x9, 0xb, 0x4, 0x7, }; -unsigned int __attribute__((packed, aligned(4))) prog_mid_num_bitmap[] = { +unsigned int __attribute__((aligned(4))) prog_mid_num_bitmap[] = { 6, 6, 6, 6, 12, 6, 12, 6, 12, 18, 12, 6, 1, 1, 1, 1, 1, 1, 6, 6, 6, }; diff --git a/include/prog_start_logo.h b/include/prog_start_logo.h index 9776441..fffe297 100644 --- a/include/prog_start_logo.h +++ b/include/prog_start_logo.h @@ -1,4 +1,4 @@ -unsigned short __attribute__((packed, aligned(4))) prog_start_palette[] = { +unsigned short __attribute__((aligned(4))) prog_start_palette[] = { 0x0, 0x1, 0x2, 0x3, 0x8ad, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x21, 0x22, 0x25, 0x32, 0x33, 0x234, 0x235, 0x244, 0x245, 0x246, 0x247, 0x255, 0x256, 0x267, 0x468, 0x469, 0x467, 0x7bd, 0x9be, @@ -10,7 +10,7 @@ unsigned short __attribute__((packed, aligned(4))) prog_start_palette[] = { 0x346, 0x7ab, 0x7ac, 0x7ad, 0x7ae, 0x9bd, 0x7be, 0x7bf, 0x9cd, 0x7ce, 0x7cf, 0x9df, }; -unsigned short __attribute__((packed, aligned(4))) prog_start_bitmap[] = { +unsigned short __attribute__((aligned(4))) prog_start_bitmap[] = { 0x0, 0x1, 0x7, 0x34, 0x12, 0x3b, 0x13, 0x16, 0x0, 0x1, 0x34, 0x10, 0x3d, 0x41, 0x1b, 0x1f, 0x1e, 0x0, 0x1, 0x7, 0x34, 0x50, 0x1b, 0x46, 0x23, 0x25, 0x26, 0x4e, 0x4d, 0x1, @@ -34,7 +34,7 @@ unsigned short __attribute__((packed, aligned(4))) prog_start_bitmap[] = { 0xe, 0xf, 0x4c, 0x3b, 0x3a, 0x0, 0x5, 0x6, 0xb, 0xc, 0xe, 0xf, 0xe, 0xc, }; -unsigned int __attribute__((packed, aligned(4))) prog_start_num_bitmap[] = { +unsigned int __attribute__((aligned(4))) prog_start_num_bitmap[] = { 4, 1, 1, 1, 1, 1, 2, 6, 4, 1, 1, 1, 2, 1, 1, 2, 4, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 2, diff --git a/include/sp_bmp_logo.h b/include/sp_bmp_logo.h index 447ff73..80383cc 100644 --- a/include/sp_bmp_logo.h +++ b/include/sp_bmp_logo.h @@ -1,4 +1,4 @@ -unsigned short __attribute__((packed, aligned(4))) sp_palette[] = { +unsigned short __attribute__((aligned(4))) sp_palette[] = { 0x0, 0x1, 0x6ab, 0x269, 0x156, 0x44, 0x133, 0xbde, 0x3ad, 0xad, 0x10, 0x11, 0x12, 0x13, 0x211, 0xae, 0x9a, 0x59, 0x78, 0x1af, 0x233, 0x455, 0x221, 0x22, 0x23, 0x24, 0x289, 0x677, 0x799, 0x232, @@ -23,7 +23,7 @@ unsigned short __attribute__((packed, aligned(4))) sp_palette[] = { 0xbce, 0xddc, 0xddd, 0xdde, 0xbc, 0xade, 0xded, 0xfee, 0xfef, 0xcee, 0x27a, 0xff, 0x8aa, 0xffe, 0xfff, }; -unsigned short __attribute__((packed, aligned(4))) sp_bitmap[] = { +unsigned short __attribute__((aligned(4))) sp_bitmap[] = { 0x0, 0x40, 0x7b, 0x6c, 0x18, 0x0, 0x18, 0x6c, 0x87, 0x83, 0x87, 0x74, 0x0, 0x32, 0x83, 0x87, 0x83, 0x17, 0x0, 0xb, 0x58, 0x87, 0x83, 0x17, 0x0, 0x1f, 0x74, 0x87, 0x83, 0x17, @@ -788,7 +788,7 @@ unsigned short __attribute__((packed, aligned(4))) sp_bitmap[] = { 0xa3, 0x7a, 0x0, 0x8d, 0x0, 0xb, 0x3f, 0x12, 0x40, 0x3f, 0x33, 0x3f, 0x33, 0x4, 0x9e, 0x1f, 0x8f, 0x8d, 0x0, }; -unsigned int __attribute__((packed, aligned(4))) sp_num_bitmap[] = { +unsigned int __attribute__((aligned(4))) sp_num_bitmap[] = { 6786, 1, 1, 1, 1, 508, 1, 1, 1, 1, 1, 1, 507, 1, 1, 1, 4, 1, 504, 1, 1, 1, 6, 1, 503, 1, 1, 1, 7, 1, diff --git a/include/thor_bmp_logo.h b/include/thor_bmp_logo.h index e207187..12af40b 100644 --- a/include/thor_bmp_logo.h +++ b/include/thor_bmp_logo.h @@ -1,4 +1,4 @@ -unsigned short __attribute__((packed, aligned(4))) thor_palette[] = { +unsigned short __attribute__((aligned(4))) thor_palette[] = { 0x0, 0x1, 0x2, 0x3, 0xaac, 0x10, 0x11, 0x12, 0x13, 0x14, 0x22, 0x23, 0x24, 0x25, 0x26, 0x33, 0x34, 0x35, 0x36, 0x37, 0x45, 0x46, 0x47, 0x57, 0x6a, 0x6b, 0x6c, 0xabd, 0xabe, 0x877, @@ -41,7 +41,7 @@ unsigned short __attribute__((packed, aligned(4))) thor_palette[] = { 0x78a, 0x78b, 0x79a, 0x79b, 0x79c, 0x29a, 0x7aa, 0x7ab, 0x7ac, 0x7bc, 0x7bd, 0x7be, 0x7cd, 0x7ce, 0xfee, 0xfef, 0xffe, 0xfff, }; -unsigned short __attribute__((packed, aligned(4))) thor_bitmap[] = { +unsigned short __attribute__((aligned(4))) thor_bitmap[] = { 0x0, 0x1, 0x6, 0x7, 0x6, 0x0, 0x1, 0x8, 0x8c, 0xcd, 0x105, 0xcd, 0x4e, 0xb, 0x6, 0x0, 0x1, 0x7, 0x47, 0xce, 0x13d, 0x189, 0x18e, 0x18d, 0x10a, 0x8c, 0xa, 0x1, 0x0, 0x1, @@ -2905,7 +2905,7 @@ unsigned short __attribute__((packed, aligned(4))) thor_bitmap[] = { 0xc, 0x7, 0x6, 0x1, 0x0, 0x1, 0x7, 0x46, 0x88, 0x4a, 0xb, 0x1, 0x0, 0x1, 0x2, 0x1, 0x0, }; -unsigned int __attribute__((packed, aligned(4))) thor_num_bitmap[] = { +unsigned int __attribute__((aligned(4))) thor_num_bitmap[] = { 1320, 3, 2, 2, 1, 367, 4, 1, 1, 1, 1, 1, 1, 1, 1, 365, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 361, 5, -- 2.7.4 From df8dde92f49793a4ad21811252f47acf7776c370 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Wed, 27 Dec 2017 13:45:34 +0900 Subject: [PATCH 10/16] arm: sc8830: fix redefined macro warnings There are several redefied macro warnings. Remove the warnings with NOTE: some macro value are different from previous define, so it changes to use #undef when the macro is defined. Change-Id: I54284b2de3d26c2385d5e1ae356882a4507754c0 Signed-off-by: Seung-Woo Kim --- arch/arm/include/asm/arch-sc8830/analog_reg_v3.h | 6 +++--- arch/arm/include/asm/arch-sc8830/chip_x30g/__hardware-sc8830.h | 6 ++++++ arch/arm/include/asm/arch-sc8830/gpio_reg_v0.h | 6 ++++++ arch/arm/include/asm/arch-sc8830/ldo.h | 9 +++++++++ arch/arm/include/asm/arch-sc8830/regs_adi.h | 3 +++ arch/arm/include/asm/arch-sc8830/regs_ahb.h | 9 +++++++++ arch/arm/include/asm/arch-sc8830/regs_global.h | 3 +++ arch/arm/include/asm/arch-sc8830/rtc_reg_v3.h | 3 +++ arch/arm/include/asm/arch-sc8830/secure_boot.h | 1 - arch/arm/include/asm/arch-sc8830/sprd_reg_base.h | 3 +++ arch/arm/include/asm/arch-sc8830/sys_timer_reg_v0.h | 3 +++ arch/arm/include/asm/arch-sc8830/watchdog_reg_v3.h | 3 +++ 12 files changed, 51 insertions(+), 4 deletions(-) diff --git a/arch/arm/include/asm/arch-sc8830/analog_reg_v3.h b/arch/arm/include/asm/arch-sc8830/analog_reg_v3.h index 0a87fb3..b684122 100644 --- a/arch/arm/include/asm/arch-sc8830/analog_reg_v3.h +++ b/arch/arm/include/asm/arch-sc8830/analog_reg_v3.h @@ -109,9 +109,9 @@ extern "C" #define ANA_APB_ARM_MF_REG (ANA_REGS_GLB_PHYS + 0x110) #define ANA_APB_AFUSE_CTL (ANA_REGS_GLB_PHYS + 0x114) #define ANA_APB_AFUSE_OUT0 (ANA_REGS_GLB_PHYS + 0x118) -#define ANA_APB_AFUSE_OUT0 (ANA_REGS_GLB_PHYS + 0x11C) -#define ANA_APB_AFUSE_OUT0 (ANA_REGS_GLB_PHYS + 0x120) -#define ANA_APB_AFUSE_OUT0 (ANA_REGS_GLB_PHYS + 0x124) +#define ANA_APB_AFUSE_OUT1 (ANA_REGS_GLB_PHYS + 0x11C) +#define ANA_APB_AFUSE_OUT2 (ANA_REGS_GLB_PHYS + 0x120) +#define ANA_APB_AFUSE_OUT3 (ANA_REGS_GLB_PHYS + 0x124) #define ANA_APB_ARCH_EN (ANA_REGS_GLB_PHYS + 0x128) #define ANA_APB_MCU_WR_PROT_VAL (ANA_REGS_GLB_PHYS + 0x12C) #define ANA_APB_DCDC_CORE (ANA_REGS_GLB_PHYS + 0x160) diff --git a/arch/arm/include/asm/arch-sc8830/chip_x30g/__hardware-sc8830.h b/arch/arm/include/asm/arch-sc8830/chip_x30g/__hardware-sc8830.h index 2df05e1..73187b3 100644 --- a/arch/arm/include/asm/arch-sc8830/chip_x30g/__hardware-sc8830.h +++ b/arch/arm/include/asm/arch-sc8830/chip_x30g/__hardware-sc8830.h @@ -223,6 +223,9 @@ #define SPRD_KPD_PHYS 0X40250000 #define SPRD_KPD_SIZE SZ_4K +#ifdef SPRD_PWM_BASE +#undef SPRD_PWM_BASE +#endif #define SPRD_PWM_BASE SCI_IOMAP(0x20a000) #define SPRD_PWM_PHYS 0X40260000 #define SPRD_PWM_SIZE SZ_4K @@ -465,6 +468,9 @@ #define ANA_CTL_GLB_BASE ( SPRD_MISC_BASE + 0x8800 ) +#ifdef ADC_BASE +#undef ADC_BASE +#endif #define ADC_BASE ((unsigned int)SPRD_ADI_BASE + 0x8300) #ifndef REGS_AHB_BASE diff --git a/arch/arm/include/asm/arch-sc8830/gpio_reg_v0.h b/arch/arm/include/asm/arch-sc8830/gpio_reg_v0.h index fe14904..87bea2f 100644 --- a/arch/arm/include/asm/arch-sc8830/gpio_reg_v0.h +++ b/arch/arm/include/asm/arch-sc8830/gpio_reg_v0.h @@ -29,7 +29,13 @@ extern "C" /**---------------------------------------------------------------------------* ** Micro Define ** **---------------------------------------------------------------------------*/ +#ifdef ANA_GPIO_BASE +#undef ANA_GPIO_BASE +#endif #define ANA_GPIO_BASE SPRD_ANA_GPIO_PHYS +#ifdef GPIO_BASE +#undef GPIO_BASE +#endif #define GPIO_BASE SPRD_GPIO_PHYS //GPIO_OFFSET #define GPIO_DATA 0x0000 //GPIO data register diff --git a/arch/arm/include/asm/arch-sc8830/ldo.h b/arch/arm/include/asm/arch-sc8830/ldo.h index 24e7089..2d9f34c 100644 --- a/arch/arm/include/asm/arch-sc8830/ldo.h +++ b/arch/arm/include/asm/arch-sc8830/ldo.h @@ -18,6 +18,9 @@ #include /* set or clear the bit of register in reg_addr address */ +#ifdef REG_SETCLRBIT +#undef REG_SETCLRBIT +#endif #define REG_SETCLRBIT(_reg_addr, _set_bit, _clr_bit) \ do { \ unsigned int reg_val = 0; \ @@ -31,6 +34,9 @@ #define REG_SETBIT(_reg_addr, _bit_mask, _bit_set) ANA_REG_MSK_OR(_reg_addr, _bit_set, _bit_mask); /* macro used to get voltage level(one bit level) */ +#ifdef GET_LEVELBIT +#undef GET_LEVELBIT +#endif #define GET_LEVELBIT(_reg_addr, _bit_mask, _bit_set, _level_var) \ do { \ (_level_var) |= \ @@ -38,6 +44,9 @@ } while (0) /* macro used to get voltage level */ +#ifdef GET_LEVEL +#undef GET_LEVEL +#endif #define GET_LEVEL(_reg_addr, _bit0_mask, _bit1_mask, _level_var) \ do { \ (_level_var) |= \ diff --git a/arch/arm/include/asm/arch-sc8830/regs_adi.h b/arch/arm/include/asm/arch-sc8830/regs_adi.h index f7d9be7..e2547af 100644 --- a/arch/arm/include/asm/arch-sc8830/regs_adi.h +++ b/arch/arm/include/asm/arch-sc8830/regs_adi.h @@ -17,6 +17,9 @@ #include #include +#ifdef SPRD_ADI_BASE +#undef SPRD_ADI_BASE +#endif #define SPRD_ADI_BASE SPRD_MISC_PHYS #define ADI_CTL_REG (SPRD_ADI_BASE + 0x4 ) diff --git a/arch/arm/include/asm/arch-sc8830/regs_ahb.h b/arch/arm/include/asm/arch-sc8830/regs_ahb.h index 2a2294d..eabfd15 100644 --- a/arch/arm/include/asm/arch-sc8830/regs_ahb.h +++ b/arch/arm/include/asm/arch-sc8830/regs_ahb.h @@ -23,6 +23,9 @@ #define CHIP_TYPE 0x209003FC #define AHB_CTL0 (AHB_REG_BASE + 0x00) +#ifdef AHB_SOFT_RST +#undef AHB_SOFT_RST +#endif #define AHB_SOFT_RST (AHB_REG_BASE + 0x04) #define AHB_PAUSE (AHB_REG_BASE + 0x14) #define AHB_REMAP (AHB_REG_BASE + 0x18) @@ -35,9 +38,15 @@ #define DSP_BOOT_VEC (AHB_REG_BASE + 0x88) #define DSP_RST (AHB_REG_BASE + 0x8C) #define AHB_ENDIAN_EN (AHB_REG_BASE + 0x90) +#ifdef USB_PHY_CTRL +#undef USB_PHY_CTRL +#endif #define USB_PHY_CTRL (AHB_REG_BASE + 0xA0) #define USB_SPR_REG (AHB_REG_BASE + 0xC0) +#ifdef CHIP_ID +#undef CHIP_ID +#endif #define CHIP_ID (AHB_REG_BASE + 0x1FC) #define AHB_DSP_BOOT_EN (AHB_REG_BASE + 0x84) diff --git a/arch/arm/include/asm/arch-sc8830/regs_global.h b/arch/arm/include/asm/arch-sc8830/regs_global.h index 5ba2e9d..159052b 100644 --- a/arch/arm/include/asm/arch-sc8830/regs_global.h +++ b/arch/arm/include/asm/arch-sc8830/regs_global.h @@ -18,6 +18,9 @@ #include /*----------Global Registers----------*/ +#ifdef GREG_BASE +#undef GREG_BASE +#endif #define GREG_BASE 0x4B000000 #define GR_GEN0 (GREG_BASE + 0x0008) diff --git a/arch/arm/include/asm/arch-sc8830/rtc_reg_v3.h b/arch/arm/include/asm/arch-sc8830/rtc_reg_v3.h index b3693ab..88c994f 100644 --- a/arch/arm/include/asm/arch-sc8830/rtc_reg_v3.h +++ b/arch/arm/include/asm/arch-sc8830/rtc_reg_v3.h @@ -31,6 +31,9 @@ extern "C" //// /*----------Real Timer Counter Register----------*/ /// +#ifdef RTC_BASE +#undef RTC_BASE +#endif #define RTC_BASE SPRD_ANA_RTC_PHYS #define ANA_RTC_SEC_CNT (RTC_BASE + 0x00) #define ANA_RTC_MIN_CNT (RTC_BASE + 0x04) diff --git a/arch/arm/include/asm/arch-sc8830/secure_boot.h b/arch/arm/include/asm/arch-sc8830/secure_boot.h index e299c7b..8f48701 100644 --- a/arch/arm/include/asm/arch-sc8830/secure_boot.h +++ b/arch/arm/include/asm/arch-sc8830/secure_boot.h @@ -4,7 +4,6 @@ #define KEY_INFO_SIZ (512) #define CUSTOM_DATA_SIZ (1024) #define VLR_INFO_SIZ (512) -#define VLR_INFO_OFF (512) #if defined(CONFIG_SPX30G) #define INTER_RAM_BEGIN 0x50003000 diff --git a/arch/arm/include/asm/arch-sc8830/sprd_reg_base.h b/arch/arm/include/asm/arch-sc8830/sprd_reg_base.h index 599664d..b5c67ad 100644 --- a/arch/arm/include/asm/arch-sc8830/sprd_reg_base.h +++ b/arch/arm/include/asm/arch-sc8830/sprd_reg_base.h @@ -214,6 +214,9 @@ extern "C" #define EFUSE_BASE CTL_BASE_EFUSE #define GPIO_BASE CTL_BASE_GPIO #define PWM_BASE CTL_BASE_PWM +#ifdef GREG_BASE +#undef GREG_BASE +#endif #define GREG_BASE CTL_BASE_GLB_REG #define WDG_BASE 0x40038040 //CHGR_WDG:0x820003C0 WDG:0x82000040 diff --git a/arch/arm/include/asm/arch-sc8830/sys_timer_reg_v0.h b/arch/arm/include/asm/arch-sc8830/sys_timer_reg_v0.h index 3855ed3..03f5ddb 100644 --- a/arch/arm/include/asm/arch-sc8830/sys_timer_reg_v0.h +++ b/arch/arm/include/asm/arch-sc8830/sys_timer_reg_v0.h @@ -30,6 +30,9 @@ extern "C" /*----------System Count----------*/ #include "sprd_reg.h" +#ifdef SYSTIMER_BASE +#undef SYSTIMER_BASE +#endif #define SYSTIMER_BASE (SPRD_SYSCNT_PHYS) #define SYS_ALM (SYSTIMER_BASE + 0x0000) diff --git a/arch/arm/include/asm/arch-sc8830/watchdog_reg_v3.h b/arch/arm/include/asm/arch-sc8830/watchdog_reg_v3.h index 7d70738..7497326 100644 --- a/arch/arm/include/asm/arch-sc8830/watchdog_reg_v3.h +++ b/arch/arm/include/asm/arch-sc8830/watchdog_reg_v3.h @@ -30,6 +30,9 @@ extern "C" /*----------Watchdog Timer Counter Register----------*/ #include "sprd_reg.h" +#ifdef WDG_BASE +#undef WDG_BASE +#endif #define WDG_BASE (SPRD_ANA_WDG_PHYS) #define WDG_LOAD_LOW (WDG_BASE + 0x00) #define WDG_LOAD_HIGH (WDG_BASE + 0x04) -- 2.7.4 From 2b427c722a66bd4766e19a897c1ce81b184d41e8 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Thu, 28 Dec 2017 14:30:33 +0900 Subject: [PATCH 11/16] arm: sc8830: remove build warnings Remove build warnings from sc8830 arch bsp code. Change-Id: I253660a28de843f9f0e61ce7d5bd0a75cf05a86b Signed-off-by: Seung-Woo Kim --- arch/arm/cpu/armv7/sc8830/Tshark_boot_cp.c | 4 +- arch/arm/cpu/armv7/sc8830/adi.c | 2 +- arch/arm/cpu/armv7/sc8830/ana_efuse.c | 4 -- arch/arm/cpu/armv7/sc8830/check_reboot.c | 46 ++++++++++++---------- .../arm/cpu/armv7/sc8830/chip_x30g/chip_phy_x30g.c | 17 ++++---- arch/arm/cpu/armv7/sc8830/clock.c | 33 ++++++---------- arch/arm/cpu/armv7/sc8830/dcdc_cal_sc2723.c | 6 +-- arch/arm/cpu/armv7/sc8830/eic.c | 14 ++----- arch/arm/cpu/armv7/sc8830/glb.c | 1 - arch/arm/cpu/armv7/sc8830/gpio.c | 11 ------ arch/arm/cpu/armv7/sc8830/misc.c | 45 ++++++++++++--------- arch/arm/cpu/armv7/sc8830/otp-helper.c | 3 ++ arch/arm/cpu/armv7/sc8830/watchdog.c | 8 ++++ arch/arm/cpu/armv7/sc8830/watchdog_hal.c | 21 ++++------ arch/arm/cpu/armv7/sc8830/watchdog_phy_v3.c | 6 +-- arch/arm/include/asm/arch-sc8830/boot_drvapi.h | 2 +- arch/arm/include/asm/arch-sc8830/gpio_phy.h | 7 ++++ 17 files changed, 111 insertions(+), 119 deletions(-) diff --git a/arch/arm/cpu/armv7/sc8830/Tshark_boot_cp.c b/arch/arm/cpu/armv7/sc8830/Tshark_boot_cp.c index db67971..d823155 100644 --- a/arch/arm/cpu/armv7/sc8830/Tshark_boot_cp.c +++ b/arch/arm/cpu/armv7/sc8830/Tshark_boot_cp.c @@ -6,7 +6,7 @@ static u32 state; void boot_cp0(void) { u32 m_data[3] = {0xe59f0000, 0xe12fff10, MODEM_ADR}; - memcpy(CP0_CODE_COPY_ADR, m_data, sizeof(m_data)); /* copy cp0 source code */ + memcpy((u32 *)CP0_CODE_COPY_ADR, m_data, sizeof(m_data)); /* copy cp0 source code */ *((volatile u32*)COOPERATE_PMU_CTRL0_ADDR) &= ~BIT_25; /* open cp0 pmu controller*/ msleep(50); @@ -32,7 +32,7 @@ void boot_cp1(void); void boot_cp2(void) { u32 wcndata[3] = {0xe59f0000, 0xe12fff10, WCNMODEM_ADR}; - memcpy(CP2_CODE_COPY_ADR, wcndata, sizeof(wcndata)); /* copy cp2 source code */ + memcpy((u32 *)CP2_CODE_COPY_ADR, wcndata, sizeof(wcndata)); /* copy cp2 source code */ *((volatile u32*)COOPERATE_PMU_CTRL2_ADDR) &= ~BIT_25; /* open cp2 pmu controller*/ msleep(50); diff --git a/arch/arm/cpu/armv7/sc8830/adi.c b/arch/arm/cpu/armv7/sc8830/adi.c index d86400f..f4cacda 100644 --- a/arch/arm/cpu/armv7/sc8830/adi.c +++ b/arch/arm/cpu/armv7/sc8830/adi.c @@ -169,7 +169,7 @@ static inline int __adi_read(u32 regPddr) if (cnt + 1 <= 0){ while(1){ - printf("[0x%s]: ADI READ timeout!!! reg = 0x%x, value = 0x%x\n", __func__, regPddr, val); + printf("[0x%s]: ADI READ timeout!!! reg = 0x%x, value = 0x%lx\n", __func__, regPddr, val); udelay(1000000); } } diff --git a/arch/arm/cpu/armv7/sc8830/ana_efuse.c b/arch/arm/cpu/armv7/sc8830/ana_efuse.c index 8fff484..080c4ef 100644 --- a/arch/arm/cpu/armv7/sc8830/ana_efuse.c +++ b/arch/arm/cpu/armv7/sc8830/ana_efuse.c @@ -82,10 +82,6 @@ static void adie_efuse_unlock(void) { } -static void adie_efuse_reset(void) -{ -} - static void __adie_efuse_power_on(void) { sci_adi_set(ANA_REG_GLB_ARM_MODULE_EN, BIT_ANA_EFS_EN); diff --git a/arch/arm/cpu/armv7/sc8830/check_reboot.c b/arch/arm/cpu/armv7/sc8830/check_reboot.c index f751d8f..7a936e4 100644 --- a/arch/arm/cpu/armv7/sc8830/check_reboot.c +++ b/arch/arm/cpu/armv7/sc8830/check_reboot.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -36,15 +37,20 @@ #define debugf(fmt, args...) #endif - extern int hw_watchdog_rst_pending(void); -extern inline int is_7s_reset(void); +extern int is_7s_reset(void); extern int is_7s_reset_for_systemdump(void); -extern inline int is_hw_smpl_enable(void); +extern int is_hw_smpl_enable(void); __attribute__ ((gnu_inline))inline int is_smpl_bootup(void); +extern void reset_cpu(ulong ignored); +extern void power_down_cpu(ulong ignored); +extern int sci_glb_set(u32 reg, u32 bit); +extern int sprd_eic_get(unsigned offset); +extern int sprd_eic_request(unsigned offset); + unsigned check_reboot_mode(void) { - unsigned val, rst_mode= 0; + unsigned rst_mode= 0; unsigned hw_rst_mode = ANA_REG_GET(ANA_REG_GLB_POR_SRC_FLAG); debugf("hw_rst_mode==%x\n", hw_rst_mode); @@ -120,7 +126,22 @@ unsigned check_reboot_mode(void) } -int get_mode_from_gpio() +int charger_connected(void) +{ + sprd_eic_request(EIC_CHG_INT); + udelay(3000); + debugf("eica status %x\n", sprd_eic_get(EIC_CHG_INT)); +#ifdef CONFIG_SHARK_PAD_HW_V102 + sprd_eic_request(EIC_USB_DETECT); + udelay(3000); + debugf("eica status %x\n", sprd_eic_get(EIC_USB_DETECT)); + return (!!sprd_eic_get(EIC_USB_DETECT)) ||(!!sprd_eic_get(EIC_CHG_INT)); +#else + return !!sprd_eic_get(EIC_CHG_INT); +#endif +} + +int get_mode_from_gpio(void) { int ret = 0; unsigned hw_rst_mode; @@ -187,21 +208,6 @@ int power_button_pressed(void) } -int charger_connected(void) -{ - sprd_eic_request(EIC_CHG_INT); - udelay(3000); - debugf("eica status %x\n", sprd_eic_get(EIC_CHG_INT)); -#ifdef CONFIG_SHARK_PAD_HW_V102 - sprd_eic_request(EIC_USB_DETECT); - udelay(3000); - debugf("eica status %x\n", sprd_eic_get(EIC_USB_DETECT)); - return (!!sprd_eic_get(EIC_USB_DETECT)) ||(!!sprd_eic_get(EIC_CHG_INT)); -#else - return !!sprd_eic_get(EIC_CHG_INT); -#endif -} - int alarm_triggered(void) { //printf("ANA_RTC_INT_RSTS is 0x%x\n", ANA_RTC_INT_RSTS); diff --git a/arch/arm/cpu/armv7/sc8830/chip_x30g/chip_phy_x30g.c b/arch/arm/cpu/armv7/sc8830/chip_x30g/chip_phy_x30g.c index 57c5639..de834a1 100644 --- a/arch/arm/cpu/armv7/sc8830/chip_x30g/chip_phy_x30g.c +++ b/arch/arm/cpu/armv7/sc8830/chip_x30g/chip_phy_x30g.c @@ -18,6 +18,7 @@ /**---------------------------------------------------------------------------* ** Dependencies * **---------------------------------------------------------------------------*/ +#include #include #include "asm/arch/sc_reg.h" #include "asm/arch/adi_hal_internal.h" @@ -56,6 +57,8 @@ struct dcdc_core_ds_step_info{ /**---------------------------------------------------------------------------* ** Function Definitions * **---------------------------------------------------------------------------*/ +extern int calibrate_register_callback(void *callback_fun); + /*****************************************************************************/ // Description : This function is used to reset MCU. // Global resource dependence : @@ -200,7 +203,7 @@ PUBLIC void CHIP_PHY_SetWDGHWFlag (WDG_HW_FLAG_T type, uint32 val) // Author: Jeff.Li // Note: Do nothing. There are 32KB internal ram dedicated for ARM. /*****************************************************************************/ -PUBLIC void CHIP_PHY_BootIramEn () +PUBLIC void CHIP_PHY_BootIramEn (void) { } @@ -233,7 +236,7 @@ PUBLIC BOOLEAN CHIP_PHY_IsWDGRstByMCU (uint32 flag) // Note : | 11 10 9 8 | 7 6 5 4 | 3 2 1 0 | // |ALL_HRST_MONITOR | POR_HRST_MONITOR| WDG_HRST_MONITOR | /*****************************************************************************/ -PUBLIC BOOLEAN CHIP_PHY_IsResetByPowerUp() +PUBLIC BOOLEAN CHIP_PHY_IsResetByPowerUp(void) { if ((CHIP_PHY_GetANAReg () & 0xF0) == 0x0) { @@ -252,7 +255,7 @@ PUBLIC BOOLEAN CHIP_PHY_IsResetByPowerUp() // Note : | 11 10 9 8 | 7 6 5 4 | 3 2 1 0 | // |ALL_HRST_MONITOR | POR_HRST_MONITOR| WDG_HRST_MONITOR | /*****************************************************************************/ -PUBLIC BOOLEAN CHIP_PHY_IsResetByWatchDog() +PUBLIC BOOLEAN CHIP_PHY_IsResetByWatchDog(void) { if ((CHIP_PHY_GetANAReg () & 0xF) == 0x0) { @@ -717,9 +720,9 @@ static void dcdc_optimize_config(unsigned int para) static void dcdc_core_ds_config(unsigned int para) { #if defined(CONFIG_ADIE_SC2723S) || defined(CONFIG_ADIE_SC2723) +#if 0 uint32 dcdc_core_ctl_adi = 0; uint32 reg_val = 0; -#if 0 uint32 dcdc_core_ctl_ds = -1; uint32 dcdc_core_cal_adi = 0; uint32 reg_val_cal = 0; @@ -843,9 +846,9 @@ struct ddr_phy_lp_reg_ctrl lp_cfg= 0x00000007, #endif 0x99998888, - 0x402b006c, + {0x402b006c, 0x402b0140, - 0x402b0144 + 0x402b0144} }; static unsigned int dmc_phy_is_auto_pd(unsigned int is_auto_pd) { @@ -865,8 +868,6 @@ static unsigned int dmc_phy_is_auto_pd(unsigned int is_auto_pd) static void setup_ap_cp_sync_sleep_code(unsigned int start_addr) { #ifndef CONFIG_SPX20 - unsigned int *sa = (unsigned int*)start_addr; - dmc_phy_is_auto_pd(lp_cfg.is_auto_pd); #endif /*enable cp2 can access 0x50001800*/ diff --git a/arch/arm/cpu/armv7/sc8830/clock.c b/arch/arm/cpu/armv7/sc8830/clock.c index 2496a67..6a25432 100644 --- a/arch/arm/cpu/armv7/sc8830/clock.c +++ b/arch/arm/cpu/armv7/sc8830/clock.c @@ -17,10 +17,6 @@ #define __ffs(x) (ffs(x) - 1) -#define DEFINE_SPINLOCK(...) -#define spin_lock_irqsave(...) -#define spin_unlock_irqrestore(...) - #include #include #include @@ -36,7 +32,11 @@ const u32 __clkinit2 __clkinit_end = &CLK_LK_clk_mpll; //#define debug0 printf -DEFINE_SPINLOCK(clocks_lock); +extern void clkdev_add(struct clk_lookup *cl); +extern int sci_glb_set(u32 reg, u32 bit); +extern int sci_glb_clr(u32 reg, u32 bit); +extern u32 sci_glb_read(u32 reg, u32 msk); +extern int sci_glb_write(u32 reg, u32 val, u32 msk); int clk_enable(struct clk *clk) { @@ -46,10 +46,8 @@ int clk_enable(struct clk *clk) clk_enable(clk->parent); - spin_lock_irqsave(&clocks_lock, flags); if ((clk->usage++) == 0 && clk->enable) (clk->enable) (clk, 1, &flags); - spin_unlock_irqrestore(&clocks_lock, flags); debug0("clk %p, usage %d\n", clk, clk->usage); return 0; } @@ -62,16 +60,13 @@ void clk_disable(struct clk *clk) if (IS_ERR_OR_NULL(clk)) return; - spin_lock_irqsave(&clocks_lock, flags); if ((--clk->usage) == 0 && clk->enable) (clk->enable) (clk, 0, &flags); if (WARN(clk->usage < 0, "warning: clock (%s) usage (%d)\n", clk->regs->name, clk->usage)) { clk->usage = 0; /* force reset clock refcnt */ - spin_unlock_irqrestore(&clocks_lock, flags); return; } - spin_unlock_irqrestore(&clocks_lock, flags); debug0("clk %p, usage %d\n", clk, clk->usage); clk_disable(clk->parent); } @@ -135,7 +130,6 @@ EXPORT_SYMBOL(clk_round_rate); int clk_set_rate(struct clk *clk, unsigned long rate) { int ret; - unsigned long flags; debug0("clk %p, rate %lu\n", clk, rate); if (IS_ERR_OR_NULL(clk) || rate == 0) return -EINVAL; @@ -150,9 +144,7 @@ int clk_set_rate(struct clk *clk, unsigned long rate) if (clk->ops == NULL || clk->ops->set_rate == NULL) return -EINVAL; - spin_lock_irqsave(&clocks_lock, flags); ret = (clk->ops->set_rate) (clk, rate); - spin_unlock_irqrestore(&clocks_lock, flags); return ret; } @@ -168,7 +160,6 @@ EXPORT_SYMBOL(clk_get_parent); int clk_set_parent(struct clk *clk, struct clk *parent) { int ret = -EACCES; - unsigned long flags; #if defined(CONFIG_DEBUG_FS) struct clk *old_parent = clk_get_parent(clk); debug0("clk %p, parent %p <<< %p\n", clk, parent, old_parent); @@ -176,10 +167,8 @@ int clk_set_parent(struct clk *clk, struct clk *parent) if (IS_ERR_OR_NULL(clk) || IS_ERR(parent)) return -EINVAL; - spin_lock_irqsave(&clocks_lock, flags); if (clk->ops && clk->ops->set_parent) ret = (clk->ops->set_parent) (clk, parent); - spin_unlock_irqrestore(&clocks_lock, flags); #if defined(CONFIG_DEBUG_FS) /* FIXME: call debugfs_rename() out of spin lock, @@ -209,14 +198,10 @@ static int sci_clk_enable(struct clk *c, int enable, unsigned long *pflags) enable = !enable; if (!c->regs->enb.mask) { /* enable matrix clock */ - if (pflags) - spin_unlock_irqrestore(&clocks_lock, *pflags); if (enable) clk_enable((struct clk *)c->regs->enb.reg); else clk_disable((struct clk *)c->regs->enb.reg); - if (pflags) - spin_lock_irqsave(&clocks_lock, *pflags); } else { if (enable) sci_glb_set(c->regs->enb.reg & ~1, c->regs->enb.mask); @@ -449,6 +434,7 @@ int __init sci_clk_register(struct clk_lookup *cl) return 0; } +#ifdef CONFIG_NKERNEL static int __init sci_clock_dump(void) { struct clk_lookup *cl = (struct clk_lookup *)(&__clkinit_begin + 1); @@ -464,8 +450,10 @@ static int __init sci_clock_dump(void) } return 0; } +#endif -static int __clk_cpufreq_notifier(struct notifier_block *nb, unsigned long val, void *data) +#if 0 +static int __clk_cpufreq_notifier(struct notifier_block nb, unsigned long val, void *data) { struct cpufreq_freqs *freq = data; @@ -479,6 +467,7 @@ static int __clk_cpufreq_notifier(struct notifier_block *nb, unsigned long val, static struct notifier_block __clk_cpufreq_notifier_block = { .notifier_call = __clk_cpufreq_notifier }; +#endif int __init sci_clock_init(void) { @@ -514,7 +503,7 @@ int __init sci_clock_init(void) return 0; } -#ifndef CONFIG_NKERNEL +#ifdef CONFIG_NKERNEL arch_initcall(sci_clock_init); late_initcall_sync(sci_clock_dump); #endif diff --git a/arch/arm/cpu/armv7/sc8830/dcdc_cal_sc2723.c b/arch/arm/cpu/armv7/sc8830/dcdc_cal_sc2723.c index 2c2babe..01aa8d6 100644 --- a/arch/arm/cpu/armv7/sc8830/dcdc_cal_sc2723.c +++ b/arch/arm/cpu/armv7/sc8830/dcdc_cal_sc2723.c @@ -782,11 +782,11 @@ typedef struct { }vol_para_t; #if defined(CONFIG_FDL2_BUILD) -vol_para_t **ppvol_para = 0x50000020; +vol_para_t **ppvol_para = (vol_para_t **)0x50000020; #elif defined(CONFIG_SPL_32K) -vol_para_t **ppvol_para = 0x50003C20; +vol_para_t **ppvol_para = (vol_para_t **)0x50003C20; #else -vol_para_t **ppvol_para = 0x50003C20; +vol_para_t **ppvol_para = (vol_para_t **)0x50003C20; #endif static int get_vol_para_num(void) diff --git a/arch/arm/cpu/armv7/sc8830/eic.c b/arch/arm/cpu/armv7/sc8830/eic.c index 7b8a94a..65f5949 100644 --- a/arch/arm/cpu/armv7/sc8830/eic.c +++ b/arch/arm/cpu/armv7/sc8830/eic.c @@ -11,6 +11,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include #include #include #include @@ -22,9 +23,7 @@ #define KERN_WARNING "" #define WARN(nmu, fmt...) printf(fmt) #define WARN_ON(num) -#define BUG_ON(__cond__) if(__cond__) printf("%s line: %d bug on\n", __FUNCTION__, __LINE__) #define pr_err(fmt...) printf(fmt) -#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0])) #define pr_debug(fmt...) printf(fmt) //#define DEBUG @@ -76,10 +75,6 @@ enum eic_die { static void __get_eic_base_info (u32 eic_id, struct eic_info *info) { - int i = 0; - u32 table_size = 0; - struct gpio_section *section_table; - if (eic_id>=SPRD_ADIE_EIC_START && eic_id<=SPRD_ADIE_EIC_END) { info->base_addr= SPRD_ANA_EIC_PHYS; @@ -105,7 +100,6 @@ static void __get_eic_base_info (u32 eic_id, struct eic_info *info) static int __eic_get_pin_data (struct eic_info *info) { - u32 offset_addr = 0; u32 reg_addr = 0, reg_data; if (info->base_addr == INVALID_REG) @@ -126,7 +120,6 @@ static int __eic_get_pin_data (struct eic_info *info) static int __eic_get_data_mask (struct eic_info *info) { - u32 offset_addr = 0; u32 reg_addr = 0, reg_data; if (info->base_addr == INVALID_REG) @@ -150,7 +143,6 @@ static int __eic_get_data_mask (struct eic_info *info) */ static void __eic_set_data_mask (struct eic_info *info, int b_on) { - u32 offset_addr = 0; u32 reg_addr = 0, reg_data; reg_addr = info->base_addr + EIC_MASK; @@ -223,6 +215,7 @@ int sprd_eic_request(unsigned offset) return 0; } +#if 0 static void sprd_eic_free(unsigned offset) { unsigned eic_id = offset; @@ -232,6 +225,7 @@ static void sprd_eic_free(unsigned offset) __eic_set_data_mask (&gpio_info, 0); return; } +#endif void sprd_eic_init(void) { @@ -241,7 +235,7 @@ void sprd_eic_init(void) ANA_REG_OR(ANA_REG_GLB_RTC_CLK_EN, BIT_RTC_EIC_EN); } -int get_volumn_down_status2() +int get_volumn_down_status2(void) { int temp_cnt = 600; int status = 0; diff --git a/arch/arm/cpu/armv7/sc8830/glb.c b/arch/arm/cpu/armv7/sc8830/glb.c index 6e666a2..c5ee2a2 100644 --- a/arch/arm/cpu/armv7/sc8830/glb.c +++ b/arch/arm/cpu/armv7/sc8830/glb.c @@ -37,7 +37,6 @@ u32 sci_glb_read(u32 reg, u32 msk) int sci_glb_write(u32 reg, u32 val, u32 msk) { - unsigned long flags, hw_flags; __raw_writel((__raw_readl(reg) & ~msk) | val, reg); return 0; } diff --git a/arch/arm/cpu/armv7/sc8830/gpio.c b/arch/arm/cpu/armv7/sc8830/gpio.c index 3ea3b1e..dd6b536 100644 --- a/arch/arm/cpu/armv7/sc8830/gpio.c +++ b/arch/arm/cpu/armv7/sc8830/gpio.c @@ -80,7 +80,6 @@ static void __gpio_set_dir (struct gpio_info * info, int dir) { int value = !!dir; u32 reg_addr = 0; - unsigned long flags; reg_addr = info->base_addr; @@ -106,7 +105,6 @@ static void __gpio_set_dir (struct gpio_info * info, int dir) return; } - //local_irq_save(flags); value = gpio_reg_get(reg_addr, info->die); if (dir) @@ -114,8 +112,6 @@ static void __gpio_set_dir (struct gpio_info * info, int dir) else value &= ~(1 << info->bit_num); gpio_reg_set(reg_addr, info->die, value); - - //local_irq_restore(flags); } /* @@ -244,7 +240,6 @@ static void __gpio_set_pin_data (struct gpio_info *info ,int b_on) u32 offset_addr; u32 reg_addr; int value; - unsigned long flags; reg_addr = info->base_addr; @@ -254,15 +249,12 @@ static void __gpio_set_pin_data (struct gpio_info *info ,int b_on) reg_addr += offset_addr; - //local_irq_save(flags); - value = gpio_reg_get(reg_addr, info->die); if (b_on) value |= 1 << info->bit_num; else value &= ~(1 << info->bit_num); gpio_reg_set(reg_addr, info->die, value); - //local_irq_restore(flags); } /* @@ -273,21 +265,18 @@ static void __gpio_set_data_mask (struct gpio_info *info, int b_on) int value; u32 reg_addr; u32 offset_addr; - unsigned long flags; reg_addr = info->base_addr; offset_addr = __gpio_get_data_mask_reg_offs(info); if (offset_addr != INVALID_REG) { reg_addr += offset_addr; - //local_irq_save(flags); value = gpio_reg_get(reg_addr, info->die); if (b_on) value |= 1 << info->bit_num; else value &= ~(1 << info->bit_num); gpio_reg_set(reg_addr, info->die, value); - //local_irq_restore(flags); GPIO_DBG("After setting gpio_addr %x data mask :%x\r\n", reg_addr, gpio_reg_get(reg_addr, info->die)); diff --git a/arch/arm/cpu/armv7/sc8830/misc.c b/arch/arm/cpu/armv7/sc8830/misc.c index fbe348f..e3559e4 100644 --- a/arch/arm/cpu/armv7/sc8830/misc.c +++ b/arch/arm/cpu/armv7/sc8830/misc.c @@ -3,6 +3,9 @@ #include #include #include + +extern void __raw_bits_or(unsigned int v, unsigned int a); + /* REG_AON_APB_BOND_OPT0 ==> romcode set REG_AON_APB_BOND_OPT1 ==> set it later @@ -20,7 +23,7 @@ * 1 : enable jtag success * * 0 : enable jtag fail * *************************************************/ -int sprd_jtag_enable() +int sprd_jtag_enable(void) { if (*((volatile unsigned int *)(REG_AON_APB_BOND_OPT0)) & 1) { @@ -35,7 +38,7 @@ int sprd_jtag_enable() * 1 : disable jtag success * * 0 : disable jtag fail * *************************************************/ -int sprd_jtag_disable() +int sprd_jtag_disable(void) { if (!(*((volatile unsigned int *)(REG_AON_APB_BOND_OPT0)) & 1)) { @@ -51,42 +54,44 @@ int sprd_jtag_disable() } } -static void ap_slp_cp_dbg_cfg() +static void ap_slp_cp_dbg_cfg(void) { *((volatile unsigned int *)(REG_AP_AHB_MCU_PAUSE)) |= BIT_MCU_SLEEP_FOLLOW_CA7_EN; //when ap sleep, cp can continue debug } -static void ap_cpll_rel_cfg() +static void ap_cpll_rel_cfg(void) { *((volatile unsigned int *)(REG_PMU_APB_CPLL_REL_CFG)) |= BIT_CPLL_AP_SEL; } -static void bb_bg_auto_en() -{ - *((volatile unsigned int *)(REG_AON_APB_RES_REG0)) |= 1<<8; -} - - -static void ap_close_wpll_en() +#if 0 +static void ap_close_wpll_en(void) { *((volatile unsigned int *)(REG_PMU_APB_CGM_AP_EN)) &= ~BIT_CGM_WPLL_AP_EN; } -static void ap_close_cpll_en() +static void ap_close_cpll_en(void) { *((volatile unsigned int *)(REG_PMU_APB_CGM_AP_EN)) &= ~BIT_CGM_CPLL_AP_EN; } -static void ap_close_wifipll_en() +static void ap_close_wifipll_en(void) { *((volatile unsigned int *)(REG_PMU_APB_CGM_AP_EN)) &= ~BIT_CGM_WIFIPLL1_AP_EN; } +#endif +#ifndef CONFIG_SPX30G +static void bb_bg_auto_en(void) +{ + *((volatile unsigned int *)(REG_AON_APB_RES_REG0)) |= 1<<8; +} -static void bb_ldo_auto_en() +static void bb_ldo_auto_en(void) { *((volatile unsigned int *)(REG_AON_APB_RES_REG0)) |= 1<<9; -} +} +#endif #ifdef CONFIG_PBINT_7S_RESET_V1 @@ -407,7 +412,9 @@ static void vbat_crash_vol_set(void) void pmic_init(void) { +#ifndef CONFIG_TIZEN u32 val; +#endif pbint_7s_rst_cfg(CONFIG_7S_RST_MODULE_EN, CONFIG_7S_RST_SW_MODE, CONFIG_7S_RST_SHORT_MODE); @@ -458,12 +465,12 @@ int tizen_reboot_recovery_check(void) #endif #define REG32(x) (*((volatile uint32 *)(x))) -void gpu_clk_auto_gate_disable() +void gpu_clk_auto_gate_disable(void) { REG32(REG_PMU_APB_CGM_GPU_MM_AUTO_GATE_EN) &= ~(0x7F); } -void misc_init() +void misc_init(void) { scx35_pmu_reconfig(); ap_slp_cp_dbg_cfg(); @@ -505,11 +512,11 @@ typedef struct mem_cs_info }mem_cs_info_t; PUBLIC int get_dram_cs_number(void) { - mem_cs_info_t *cs_info_ptr = 0x1C00; + mem_cs_info_t *cs_info_ptr = (mem_cs_info_t *)0x1C00; return cs_info_ptr->cs_number; } PUBLIC int get_dram_cs0_size(void) { - mem_cs_info_t *cs_info_ptr = 0x1C00; + mem_cs_info_t *cs_info_ptr = (mem_cs_info_t *)0x1C00; return cs_info_ptr->cs0_size; } diff --git a/arch/arm/cpu/armv7/sc8830/otp-helper.c b/arch/arm/cpu/armv7/sc8830/otp-helper.c index f98db8c..9c2a64e 100644 --- a/arch/arm/cpu/armv7/sc8830/otp-helper.c +++ b/arch/arm/cpu/armv7/sc8830/otp-helper.c @@ -35,6 +35,9 @@ #define VOL_P1 4200 #define ADC_DATA_OFFSET 128 +extern int __ddie_efuse_prog(int blk_index, u32 val); +extern u32 __adie_efuse_read(int blk_index); + u32 efuse_read(int id,int blk_index) { return __ddie_efuse_read(blk_index); diff --git a/arch/arm/cpu/armv7/sc8830/watchdog.c b/arch/arm/cpu/armv7/sc8830/watchdog.c index e4de885..5e7bf39 100644 --- a/arch/arm/cpu/armv7/sc8830/watchdog.c +++ b/arch/arm/cpu/armv7/sc8830/watchdog.c @@ -2,8 +2,16 @@ #include #include #include +#include #include +extern void WDG_ClockOn(void); +extern void WDG_ResetMCU(void); +extern void WDG_TimerInit(void); +extern void WDG_TimerStop(void); +extern void WDG_TimerLoad(uint32 time_ms); +extern uint32 WDG_PHY_RST_INT_ON(void); + void start_watchdog(uint32_t init_time_ms) { WDG_ClockOn(); diff --git a/arch/arm/cpu/armv7/sc8830/watchdog_hal.c b/arch/arm/cpu/armv7/sc8830/watchdog_hal.c index 8a0629c..c232703 100644 --- a/arch/arm/cpu/armv7/sc8830/watchdog_hal.c +++ b/arch/arm/cpu/armv7/sc8830/watchdog_hal.c @@ -19,6 +19,7 @@ /**---------------------------------------------------------------------------* ** Dependencies * **---------------------------------------------------------------------------*/ +#include #include #include #include @@ -44,7 +45,6 @@ PUBLIC void WDG_TimerStop ) { WDG_CONFIG_T config; - int32 ret; WDG_TRACE ("Watch Dog Trace: WDG_TimerStop"); WDG_PHY_INT_CLR(); @@ -53,7 +53,7 @@ PUBLIC void WDG_TimerStop config.mode = WDG_TIMEOUT_MODE_RESET; config.val = WDG_MAX_COUNT; - ret = WDG_PHY_CONFIG (&config); + WDG_PHY_CONFIG (&config); return; } @@ -70,7 +70,6 @@ PUBLIC void WDG_TimerStart ) { WDG_CONFIG_T config; - int32 ret; WDG_TRACE ("Watch Dog Trace: WDG_TimerStart"); @@ -78,7 +77,7 @@ PUBLIC void WDG_TimerStart config.mode = WDG_TIMEOUT_MODE_RESET; config.val = init_val; - ret = WDG_PHY_CONFIG (&config); + WDG_PHY_CONFIG (&config); } @@ -100,8 +99,6 @@ PUBLIC void WDG_TimerHandler (uint32 int_num) PUBLIC void WDG_TimerInit (void) { WDG_CONFIG_T config; - uint32 status; - int32 ret; WDG_TRACE ("Watch Dog Trace: WDG_TimerInit"); @@ -109,7 +106,7 @@ PUBLIC void WDG_TimerInit (void) config.mode = WDG_TIMEOUT_MODE_RESET; config.val = WDG_INIT_COUNT; - ret = WDG_PHY_CONFIG (&config); + WDG_PHY_CONFIG (&config); } /*****************************************************************************/ @@ -120,14 +117,13 @@ PUBLIC void WDG_TimerInit (void) PUBLIC void WDG_ResetMCU (void) { WDG_CONFIG_T config; - int32 ret; WDG_TRACE ("Watch Dog Trace: WDG_ResetMCU"); config.state = WDG_TIMER_STATE_START ; config.mode = WDG_TIMEOUT_MODE_RESET; config.val = 0x50; - ret = WDG_PHY_CONFIG (&config); + WDG_PHY_CONFIG (&config); } /*****************************************************************************/ @@ -138,15 +134,14 @@ PUBLIC void WDG_ResetMCU (void) PUBLIC void WDG_TimerLoad (uint32 time_ms) { WDG_CONFIG_T config; - int32 ret; - WDG_TRACE ("Watch Dog Trace: WDG_TimerLoad %d", time_ms); + WDG_TRACE ("Watch Dog Trace: WDG_TimerLoad %lu", time_ms); config.state = WDG_TIMER_STATE_KEEP ; config.mode = WDG_TIMEOUT_MODE_KEEP ; config.val = (time_ms * 1000) / 30; - ret = WDG_PHY_CONFIG (&config); + WDG_PHY_CONFIG (&config); } PUBLIC uint32 WDG_PHY_RST_INT_ON(void) @@ -154,7 +149,7 @@ PUBLIC uint32 WDG_PHY_RST_INT_ON(void) uint32 ret = 0; uint32 val = 0; val = WDG_PHY_RST_RAW_INT(); - printf("hw watchdog int raw status 0x%x\n", val); + printf("hw watchdog int raw status 0x%lx\n", val); ret = val & WDG_INT_RST_BIT; WDG_PHY_INT_CLR(); return ret; diff --git a/arch/arm/cpu/armv7/sc8830/watchdog_phy_v3.c b/arch/arm/cpu/armv7/sc8830/watchdog_phy_v3.c index 9b843ec..35c2a88 100644 --- a/arch/arm/cpu/armv7/sc8830/watchdog_phy_v3.c +++ b/arch/arm/cpu/armv7/sc8830/watchdog_phy_v3.c @@ -16,6 +16,7 @@ /**---------------------------------------------------------------------------* ** Dependencies * **---------------------------------------------------------------------------*/ +#include #include #include #include @@ -37,7 +38,7 @@ extern "C" uint32 cnt = 0;\ while((ANA_REG_GET(WDG_INT_RAW) & WDG_LD_BUSY_BIT) && ( cnt < ANA_WDG_LOAD_TIMEOUT_NUM )) cnt++;\ ANA_REG_SET( WDG_LOAD_HIGH, (uint16)(((value) >> 16 ) & 0xffff));\ - ANA_REG_SET( WDG_LOAD_LOW , (uint16)((value) & 0xffff) );\ + ANA_REG_SET( WDG_LOAD_LOW , (uint16)((value) & 0xffff) );\ }while(0) #define CLEAR_WDG_INT(msk) \ @@ -61,9 +62,6 @@ extern "C" /*****************************************************************************/ PUBLIC int32 WDG_PHY_CONFIG (WDG_CONFIG_T *cfg) { - uint32 ctrl = 0; - uint32 val = 0; - ///WDG_TRACE("Watch Dog Trace: Watch Dog Value 0x%8.8x", CHIP_REG_GET(WDG_VALUE)); ANA_REG_SET (WDG_LOCK, WDG_UNLOCK_KEY); diff --git a/arch/arm/include/asm/arch-sc8830/boot_drvapi.h b/arch/arm/include/asm/arch-sc8830/boot_drvapi.h index 5eff94c..7f0836b 100644 --- a/arch/arm/include/asm/arch-sc8830/boot_drvapi.h +++ b/arch/arm/include/asm/arch-sc8830/boot_drvapi.h @@ -76,7 +76,7 @@ PUBLIC uint32 BOOT_GetResetFlag (WDG_HW_FLAG_T type); // Author: Jeff.Li // Note: /*****************************************************************************/ -PUBLIC void BOOT_ResetHWFlag (); +PUBLIC void BOOT_ResetHWFlag (void); /*****************************************************************************/ // Description: Get HW Flag diff --git a/arch/arm/include/asm/arch-sc8830/gpio_phy.h b/arch/arm/include/asm/arch-sc8830/gpio_phy.h index 6a3bbc1..4e6495a 100644 --- a/arch/arm/include/asm/arch-sc8830/gpio_phy.h +++ b/arch/arm/include/asm/arch-sc8830/gpio_phy.h @@ -9,6 +9,13 @@ #include #define GPIO_DBG(fmt...) printf(fmt) +#ifndef WARN +#define WARN(nmu, fmt...) printf(fmt) +#endif + +void __raw_bits_and(unsigned int v, unsigned int a); +void __raw_bits_or(unsigned int v, unsigned int a); + enum gpio_section_type { GPIO_SECTION_GPI = 0x0, GPIO_SECTION_GPO, -- 2.7.4 From 873f878d0a0bf77bc599c7c857eb78bf9a811992 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Thu, 28 Dec 2017 14:36:10 +0900 Subject: [PATCH 12/16] board: tizen_tm1: remove build warnings Remove build warnings from tizen_tm1 board bsp code. Change-Id: I2f89ef18bc5f35c2f29aa885f10d98f0496ea06c Signed-off-by: Seung-Woo Kim --- board/spreadtrum/tizen_tm1/ldo_sleep.c | 1 + board/spreadtrum/tizen_tm1/openphone.c | 32 ++++++++++++++++++++------------ board/spreadtrum/tizen_tm1/sprd_kp.c | 6 ++++-- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/board/spreadtrum/tizen_tm1/ldo_sleep.c b/board/spreadtrum/tizen_tm1/ldo_sleep.c index 7e167d6..75af0fe 100644 --- a/board/spreadtrum/tizen_tm1/ldo_sleep.c +++ b/board/spreadtrum/tizen_tm1/ldo_sleep.c @@ -771,5 +771,6 @@ void init_ldo_sleep_gr(void) ); /*chip service package init*/ + extern void CSP_Init(unsigned int gen_para); CSP_Init(0); } diff --git a/board/spreadtrum/tizen_tm1/openphone.c b/board/spreadtrum/tizen_tm1/openphone.c index 5dfcb0a..2a92d48 100644 --- a/board/spreadtrum/tizen_tm1/openphone.c +++ b/board/spreadtrum/tizen_tm1/openphone.c @@ -19,10 +19,18 @@ extern void ADI_init (void); extern int LDO_Init(void); extern void ADC_Init(void); extern int sound_init(void); +extern void misc_init(void); +extern int pin_init(void); +extern void sprd_eic_init(void); +extern void init_ldo_sleep_gr(void); +extern int sprd_gpio_request(struct gpio_chip *chip, unsigned offset); +extern int sprd_gpio_direction_input(struct gpio_chip *chip, unsigned offset); +extern int sprd_gpio_get(struct gpio_chip *chip, unsigned offset); +extern void sprd_gpio_free(struct gpio_chip *chip, unsigned offset); #ifdef CONFIG_GENERIC_MMC int mv_sdh_init(u32 regbase, u32 max_clk, u32 min_clk, u32 quirks); -int mmc_sdcard_init(); +int mmc_sdcard_init(void); int board_mmc_init(bd_t *bd) { @@ -39,7 +47,7 @@ int board_mmc_init(bd_t *bd) extern struct eic_gpio_resource sprd_gpio_resource[]; /*enable aon timer2 for udelay functions*/ -void aon_26M_timer2_enable() +void aon_26M_timer2_enable(void) { REG32(REG_AON_APB_APB_EB0) |= BIT_AON_TMR_EB; } @@ -64,7 +72,16 @@ int get_hw_rev(void) return hw_revision; } -int board_init() +void check_smpl(void) +{ +#ifdef CONFIG_SMPL_MODE + if(is_real_battery() == 0){ + sci_adi_write_fast(ANA_REG_GLB_SMPL_CTRL0,0x0,1); + } +#endif +} + +int board_init(void) { gd->bd->bi_arch_number = 0x7df; gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x02000100; @@ -88,15 +105,6 @@ int board_init() return 0; } -void check_smpl(void) -{ -#ifdef CONFIG_SMPL_MODE - if(is_real_battery() == 0){ - sci_adi_write_fast(ANA_REG_GLB_SMPL_CTRL0,0x0,1); - } -#endif -} - int dram_init(void) { gd->ram_size = get_ram_size((volatile void *)PHYS_SDRAM_1, diff --git a/board/spreadtrum/tizen_tm1/sprd_kp.c b/board/spreadtrum/tizen_tm1/sprd_kp.c index 3ede70e..facf65e 100644 --- a/board/spreadtrum/tizen_tm1/sprd_kp.c +++ b/board/spreadtrum/tizen_tm1/sprd_kp.c @@ -11,8 +11,6 @@ struct key_map_info * sprd_key_map = 0; void board_keypad_init(void) { - unsigned int key_type; - sprd_key_map = malloc(sizeof(struct key_map_info)); if(NULL == sprd_key_map){ @@ -79,6 +77,10 @@ unsigned char board_key_scan(void) uint32_t s_key_status = REG_KPD_KEY_STATUS; uint32_t scan_code = 0; uint32_t key_code =0; + + extern int sprd_eic_request(unsigned offset); + extern int sprd_eic_get(unsigned offset); + #ifdef KEYPAD_DEBUG printf("key operation flags is %08x, key %08x\n", REG_KPD_INT_RAW_STATUS, REG_KPD_KEY_STATUS); #endif -- 2.7.4 From b4cbdd0e102e74e0891c7d488f2989aee2c83d31 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Wed, 27 Dec 2017 15:22:57 +0900 Subject: [PATCH 13/16] usb: gadget: remove duplicated print macro There are duplicated print macros. Remove the macros. Change-Id: I26cfa53689c39d661e64eb1a61e381f8baf30ac4 Signed-off-by: Seung-Woo Kim --- drivers/usb/gadget/serial.c | 2 -- include/linux/usb/composite.h | 4 ---- 2 files changed, 6 deletions(-) diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c index 61a694a..72c7662 100644 --- a/drivers/usb/gadget/serial.c +++ b/drivers/usb/gadget/serial.c @@ -54,8 +54,6 @@ #include "f_serial.c" #include "u_serial.c" -#define pr_warning(args...) printf(##args) - /*-------------------------------------------------------------------------*/ /* Thanks to NetChip Technologies for donating this product ID. diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index b200ef7..9359360 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h @@ -363,8 +363,6 @@ extern int usb_string_id(struct usb_composite_dev *c); /* messaging utils */ #ifdef DEBUG -#define pr_warning(args...) printf(##args) -#define pr_debug(args...) printf(#args) #define DBG(d, fmt, args...) \ printf(fmt, ##args) #define VDBG(d, fmt, args...) \ @@ -376,8 +374,6 @@ extern int usb_string_id(struct usb_composite_dev *c); #define INFO(d, fmt, args...) \ printf(fmt, ##args) #else -#define pr_warning(args...) -#define pr_debug(args...) #define DBG(d, fmt, args...) #define VDBG(d, fmt, args...) #define ERROR(d, fmt, args...) \ -- 2.7.4 From 3d31e8c499ad7cd8054fcb4d6e8bfcb5e62ce541 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Wed, 27 Dec 2017 16:52:54 +0900 Subject: [PATCH 14/16] bootmode: normal: remove duplicated macro There is duplicated macro, and it causes build warning. Remove the duplication. Change-Id: I05b23aba350bbefb6e95a952a1d24a57bed960fe Signed-off-by: Seung-Woo Kim --- property/normal_mode.c | 1 - 1 file changed, 1 deletion(-) diff --git a/property/normal_mode.c b/property/normal_mode.c index 0e4cd49..f1dbf0a 100644 --- a/property/normal_mode.c +++ b/property/normal_mode.c @@ -402,7 +402,6 @@ void set_recovery_mode(unsigned int recovery_mode) void lcd_display_logo(int backlight_set, ulong bmp_img, size_t size) { -#define mdelay(t) ({unsigned long msec=(t); while (msec--) { udelay(1000);}}) //LiWei add #ifdef CONFIG_SPLASH_SCREEN extern int lcd_display_bitmap(ulong bmp_image, int x, int y); extern void lcd_display(void); -- 2.7.4 From 4221f77f501213ce31f46c74bf991ab86faa7b4b Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Fri, 29 Dec 2017 11:31:33 +0900 Subject: [PATCH 15/16] fdt: remove build warnings caused by sprd bsp Remove build warnings caused by sprd bsp. Change-Id: I8989a6fdbac336354feb5736db2ea815ec19e95e Signed-off-by: Seung-Woo Kim --- common/fdt_support.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/common/fdt_support.c b/common/fdt_support.c index 7c389d5..a7253df 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -37,6 +37,7 @@ extern PUBLIC phys_size_t get_dram_size_from_gd(void); extern char* get_calibration_parameter(void); extern bool is_calibration_by_uart(void); +extern int poweron_by_calibration(void); /** * fdt_getprop_u32_default - Find a node and return it's property or a default @@ -219,7 +220,6 @@ int fdt_initrd_norsvmem(void *fdt, ulong initrd_start, ulong initrd_end, int for int err; u32 tmp; const char *path; - uint64_t addr, size; /* Find the "chosen" node. */ nodeoffset = fdt_path_offset (fdt, "/chosen"); @@ -332,8 +332,8 @@ int fdt_chosen_bootargs_replace(void *fdt, char *old_args, char *new_args) { int nodeoffset; int err, i; - char *str, *src, *dst; - const char *path; + char *str, *dst; + const char *src, *path; char *strargs; if (!old_args || !new_args) @@ -468,7 +468,7 @@ int fdt_chosen_bootargs_append(void *fdt, char* append_args,int force) int fdt_fixup_lcdid(void *fdt) { char buf[16]; - extern uint32_t load_lcd_id_to_kernel(); + extern uint32_t load_lcd_id_to_kernel(void); uint32_t lcd_id = 0; int str_len; int ret; @@ -498,7 +498,7 @@ int fdt_fixup_lcdbase(void *fdt) //add lcd frame buffer base, length should be lcd w*h*2(RGB565) sprintf(buf, "lcd_base="); str_len = strlen(buf); - sprintf(&buf[str_len], "%x",lcd_base); + sprintf(&buf[str_len], "%lx",(unsigned long)lcd_base); str_len = strlen(buf); buf[str_len] = '\0'; @@ -625,13 +625,12 @@ int fdt_fixup_adc_calibration_data(void *fdt) { //extern unsigned int *adc_data_to_transfer; unsigned int *adc_data = malloc(64); - int ret = read_adc_calibration_data(adc_data,48); + int ret = read_adc_calibration_data((void *)adc_data,48); if (ret) { char buf[64]; int str_len; - int ret; memset(buf, 0, 64); if(((adc_data[2]&0xffff) < 4500 )&&((adc_data[2]&0xffff) > 3000)&& @@ -1680,11 +1679,10 @@ void fdt_debug_print_prop(void *fdt, const char *node_path, const char *name) int nodeoffset; int err; const char *path; - char *strargs; int len; int i = 0; - printf("fdt addr: 0x%x\n", fdt); + printf("fdt addr: 0x%lx\n", (unsigned long)fdt); err = fdt_check_header(fdt); if (err < 0) { -- 2.7.4 From 0b5a99446a699980f92a803591cd9443967c620d Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Fri, 29 Dec 2017 11:32:30 +0900 Subject: [PATCH 16/16] console: remove build warning in ram console Remove build warning in ram console. Change-Id: I1b783345c081fbd9d24c727fc1ec00f9d16eb38c Signed-off-by: Seung-Woo Kim --- common/console.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/console.c b/common/console.c index 31146cc..aca0d77 100644 --- a/common/console.c +++ b/common/console.c @@ -207,7 +207,7 @@ void ram_puts(const char* s) uint *p = NULL; uint wlen = strlen(s); - p = (unsigned char*)CONFIG_RAM_CONSOLE_START + used_size; + p = (uint *)CONFIG_RAM_CONSOLE_START + used_size; if (used_size >= CONFIG_RAM_CONSOLE_SIZE) { serial_puts("ram console: space overflow!\n"); -- 2.7.4