xloader: Panda - clean compile warnings
authorAndy Green <andy.green@linaro.org>
Wed, 9 Feb 2011 14:42:15 +0000 (14:42 +0000)
committerAnand Gadiyar <gadiyar@ti.com>
Mon, 14 Mar 2011 07:15:53 +0000 (12:45 +0530)
Visit each warning during panda config clean build and
fix them. (This is true for gcc 4.5.1 compiler anyway)

Signed-off-by: Andy Green <andy.green@linaro.org>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
board/omap4430panda/clock.c
board/omap4430panda/omap4430panda.c
cpu/omap4/mmc.c
fs/fat/fat.c
include/common.h
lib/board.c

index 282e670..fe61f50 100644 (file)
@@ -248,8 +248,6 @@ static void configure_mpu_dpll(u32 clk_index)
        /* Lock the mpu dpll */
        sr32(CM_CLKMODE_DPLL_MPU, 0, 3, PLL_LOCK | 0x10);
        wait_on_value(BIT0, 1, CM_IDLEST_DPLL_MPU, LDELAY);
-
-       return;
 }
 
 static void configure_iva_dpll(u32 clk_index)
@@ -388,7 +386,10 @@ static void configure_usb_dpll(u32 clk_index)
        sr32(CM_CLKDCOLDO_DPLL_USB, 0, 32, 0x100);
 }
 
-static void configure_core_dpll(clk_index)
+#if 0
+
+/* to remove warning about unused function; will be deleted in decruft patch */
+static void configure_core_dpll(int clk_index)
 {
        struct dpll_param *dpll_param_p;
 
@@ -444,11 +445,11 @@ static void configure_core_dpll(clk_index)
        sr32(CM_CLKMODE_DPLL_CORE, 0, 3, PLL_LOCK);
        wait_on_value(BIT0, 1, CM_IDLEST_DPLL_CORE, LDELAY);
 }
-
+#endif
 
 void configure_core_dpll_no_lock(void)
 {
-       struct dpll_param *dpll_param_p;
+       struct dpll_param *dpll_param_p = NULL;
        u32 clk_index;
 
        /* Get the sysclk speed from cm_sys_clksel
@@ -476,6 +477,9 @@ void configure_core_dpll_no_lock(void)
        case OMAP4430_ES2_1:
                dpll_param_p = &core_dpll_param_ddr400[clk_index];
                break;
+       default:
+               /* we are screwed */
+               break;
        }
 
        /* Disable autoidle */
@@ -507,10 +511,10 @@ void lock_core_dpll(void)
 
 void lock_core_dpll_shadow(void)
 {
-       struct dpll_param *dpll_param_p;
+       struct dpll_param *dpll_param_p = NULL;
 
        /* Lock the core dpll using freq update method */
-       *(volatile int*)0x4A004120 = 10;        /* CM_CLKMODE_DPLL_CORE */
+       *(volatile int *)0x4A004120 = 10;       /* CM_CLKMODE_DPLL_CORE */
 
        switch (omap_revision()) {
        case OMAP4430_ES1_0:
@@ -522,6 +526,9 @@ void lock_core_dpll_shadow(void)
        case OMAP4430_ES2_1:
                dpll_param_p = &core_dpll_param_ddr400[6];
                break;
+       default:
+               /* we are screwed */
+               break;
        }
 
        /* CM_SHADOW_FREQ_CONFIG1: DLL_OVERRIDE = 1(hack), DLL_RESET = 1,
@@ -540,8 +547,6 @@ void lock_core_dpll_shadow(void)
 
 static void enable_all_clocks(void)
 {
-       volatile int regvalue = 0;
-
        /* Enable Ducati clocks */
        sr32(CM_DUCATI_DUCATI_CLKCTRL, 0, 32, 0x1);
        sr32(CM_DUCATI_CLKSTCTRL, 0, 32, 0x2);
index b00ec9e..1246924 100644 (file)
@@ -238,6 +238,11 @@ void big_delay(unsigned int count)
                delay(1);
 }
 
+void reset_phy(unsigned int base)
+{
+       *(volatile int *)(base + IODFT_TLGC) |= (1 << 10);
+}
+
 /* TODO: FREQ update method is not working so shadow registers programming
  * is just for same of completeness. This would be safer if auto
  * trasnitions are working
@@ -245,7 +250,7 @@ void big_delay(unsigned int count)
 static int emif_config(unsigned int base)
 {
        unsigned int reg_value, rev;
-       const struct ddr_regs *ddr_regs;
+       const struct ddr_regs *ddr_regs = NULL;
        rev = omap_revision();
 
        if (rev == OMAP4430_ES1_0)
@@ -254,6 +259,7 @@ static int emif_config(unsigned int base)
                ddr_regs = &ddr_regs_200_mhz_2cs;
        else if (rev >= OMAP4430_ES2_1)
                ddr_regs = &ddr_regs_400_mhz_2cs;
+
        /*
         * set SDRAM CONFIG register
         * EMIF_SDRAM_CONFIG[31:29] REG_SDRAM_TYPE = 4 for LPDDR2-S4
@@ -361,6 +367,7 @@ static int emif_config(unsigned int base)
        *(volatile int*)(base + EMIF_LPDDR2_MODE_REG_DATA) = 0;
        /* LPDDR2 init complete */
 
+       return 0;
 }
 /*****************************************
  * Routine: ddr_init
@@ -549,16 +556,13 @@ void secure_unlock_mem(void)
  ***********************************************************/
 void try_unlock_memory(void)
 {
-       int mode;
-
        /* if GP device unlock device SRAM for general use */
        /* secure code breaks for Secure/Emulation device - HS/E/T*/
-       return;
 }
 
 
 #if defined(CONFIG_MPU_600) || defined(CONFIG_MPU_1000)
-static scale_vcores(void)
+static int scale_vcores(void)
 {
        unsigned int rev = omap_revision();
        /* For VC bypass only VCOREx_CGF_FORCE  is necessary and
@@ -609,6 +613,7 @@ static scale_vcores(void)
        /* PRM_IRQSTATUS_MPU */
        *(volatile int*)(0x4A306010) = *(volatile int*)(0x4A306010);
 
+       return 0;
 }
 #endif
 
@@ -1212,7 +1217,6 @@ int dram_init(void)
 void set_muxconf_regs(void)
 {
        MUX_DEFAULT_OMAP4();
-       return;
 }
 
 /******************************************************************************
@@ -1225,8 +1229,6 @@ void set_muxconf_regs(void)
 void update_mux(u32 btype, u32 mtype)
 {
        /* REVISIT  */
-       return;
-
 }
 
 /* optionally do something like blinking LED */
@@ -1240,7 +1242,3 @@ int nand_init(void)
 {
        return 0;
 }
-void reset_phy(unsigned int base)
-{
-       *(volatile int*)(base + IODFT_TLGC) |= (1 << 10);
-}
index 00d07da..bd64f44 100644 (file)
@@ -57,8 +57,6 @@ block_dev_desc_t *mmc_get_dev(int dev)
 
 unsigned char mmc_board_init(void)
 {
-       unsigned int value = 0;
-
        return 1;
 }
 
@@ -501,10 +499,10 @@ unsigned char configure_mmc(mmc_card_data *mmc_card_cur)
        return 1;
 }
 unsigned long mmc_bread(int dev_num, unsigned long blknr, lbaint_t blkcnt,
-                       void *dst)
+                       unsigned long *dst)
 {
        omap_mmc_read_sect(blknr, (blkcnt * MMCSD_SECTOR_SIZE), &cur_card_data,
-                          (unsigned long *) dst);
+                          dst);
        return 1;
 }
 
index 44ecb4a..9ff2503 100644 (file)
@@ -255,10 +255,9 @@ get_fatent(fsdata *mydata, __u32 entry)
        /* Read a new block of FAT entries into the cache. */
        if (bufnum != mydata->fatbufnum) {
                int getsize = FATBUFSIZE/FS_BLOCK_SIZE;
-               __u8 *bufptr = mydata->fatbuf;
+               __u8 *bufptr = (__u8 *)mydata->fatbuf;
                __u32 fatlength = mydata->fatlength;
                __u32 startblock = bufnum * FATBUFBLOCKS;
-               unsigned long i;
 
                fatlength *= SECTOR_SIZE;       /* We want it in bytes now */
                startblock += mydata->fat_sect; /* Offset from start of disk */
@@ -431,34 +430,6 @@ getit:
 
 
 #ifdef CONFIG_SUPPORT_VFAT
-/*
- * Extract the file name information from 'slotptr' into 'l_name',
- * starting at l_name[*idx].
- * Return 1 if terminator (zero byte) is found, 0 otherwise.
- */
-static int
-slot2str(dir_slot *slotptr, char *l_name, int *idx)
-{
-       int j;
-
-       for (j = 0; j <= 8; j += 2) {
-               l_name[*idx] = slotptr->name0_4[j];
-               if (l_name[*idx] == 0x00) return 1;
-               (*idx)++;
-       }
-       for (j = 0; j <= 10; j += 2) {
-               l_name[*idx] = slotptr->name5_10[j];
-               if (l_name[*idx] == 0x00) return 1;
-               (*idx)++;
-       }
-       for (j = 0; j <= 2; j += 2) {
-               l_name[*idx] = slotptr->name11_12[j];
-               if (l_name[*idx] == 0x00) return 1;
-               (*idx)++;
-       }
-
-       return 0;
-}
 
 /* Calculate short name checksum */
 static __u8
@@ -486,7 +457,7 @@ static dir_entry *get_dentfromdir (fsdata * mydata, int startsect,
                                   char *filename, dir_entry * retdent,
                                   int dols)
 {
-
+       return NULL;
 }
 
 #if 0
@@ -600,6 +571,7 @@ read_bootsectandvi(boot_sector *bs, volume_info *volinfo, int *fatsize)
 {
        __u8 block[FS_BLOCK_SIZE];
        volume_info *vistart;
+       char *p;
 
        printf("Reading boot sector\n");
 
@@ -636,7 +608,8 @@ read_bootsectandvi(boot_sector *bs, volume_info *volinfo, int *fatsize)
 
        /* Terminate fs_type string. Writing past the end of vistart
           is ok - it's just the buffer. */
-       vistart->fs_type[8] = '\0';
+       p = (char *)&vistart->fs_type[0];
+       p[8] = '\0';
 
        if (*fatsize == 32) {
                if (compare_sign(FAT32_SIGN, vistart->fs_type) == 0) {
@@ -661,8 +634,8 @@ read_bootsectandvi(boot_sector *bs, volume_info *volinfo, int *fatsize)
 __u8 do_fat_read_block[MAX_CLUSTSIZE];  /* Block buffer */
 #endif
 
-__u8 *fnamecopy = 0x80500000;
-__u8 *do_fat_read_block = 0x80500880;
+__u8 *fnamecopy = (__u8 *)0x80500000;
+__u8 *do_fat_read_block = (__u8 *)0x80500880;
 
 boot_sector bs;
 volume_info volinfo;
@@ -723,18 +696,18 @@ do_fat_read(const char *filename, void *buffer, unsigned long maxsize,
     while (ISDIRDELIM (*filename))
        filename++;
     /* Make a copy of the filename and convert it to lowercase */
-    strcpy (fnamecopy, filename);
-    downcase (fnamecopy);
+    strcpy ((char *)fnamecopy, filename);
+    downcase ((char *)fnamecopy);
     if (*fnamecopy == '\0') {
        if (!dols){
                printf("\n not there\n");
            return -1;
        }
        dols = LS_ROOT;
-    } else if ((idx = dirdelim (fnamecopy)) >= 0) {
+    } else if ((idx = dirdelim ((char *)fnamecopy)) >= 0) {
        isdir = 1;
        fnamecopy[idx] = '\0';
-       subname = fnamecopy + idx + 1;
+       subname = (char *)fnamecopy + idx + 1;
        /* Handle multiple delimiters */
        while (ISDIRDELIM (*subname))
            subname++;
@@ -804,7 +777,8 @@ do_fat_read(const char *filename, void *buffer, unsigned long maxsize,
                dentptr++;
                continue;
            }
-           if (strcmp (fnamecopy, s_name) && strcmp (fnamecopy, l_name)) {
+           if (strcmp ((char *)fnamecopy, s_name) &&
+                                          strcmp ((char *)fnamecopy, l_name)) {
                FAT_DPRINT ("RootMismatch: |%s|%s|\n", s_name, l_name);
                dentptr++;
                continue;
index 5a6f4c9..ffaf582 100644 (file)
@@ -107,4 +107,12 @@ int        nand_correct_data (u_char *dat, u_char *read_ecc, u_char *calc_ecc);
 
 /* lib/board.c */
 void   hang            (void) __attribute__ ((noreturn));
+
+extern int do_load_serial_bin (ulong offset, int baudrate);
+extern u32 get_mem_type(void);
+extern int mmc_init(int verbose);
+extern int misc_init_r(void);
+
+extern int sprintf (char *__s, const char *__format, ...);
+
 #endif /* __COMMON_H_ */
index 70cd17a..e3d1334 100644 (file)
@@ -46,15 +46,17 @@ int print_info(void)
        return 0;
 }
 
-static int init_func_i2c (void)
-{
+/* !!! why is I2C dependent on MMC? */
+
 #ifdef CONFIG_MMC
 #ifdef CONFIG_DRIVER_OMAP34XX_I2C
+static int init_func_i2c (void)
+{
        i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE);
-#endif
-#endif
        return 0;
 }
+#endif
+#endif
 
 typedef int (init_fnc_t) (void);
 
@@ -77,16 +79,13 @@ init_fnc_t *init_sequence[] = {
 void start_armboot (void)
 {
        init_fnc_t **init_fnc_ptr;
-       int i, size;
+       int size;
        uchar *buf;
        int *first_instruction;
-       block_dev_desc_t *dev_desc = NULL;
 
-       for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
-               if ((*init_fnc_ptr)() != 0) {
+       for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr)
+               if ((*init_fnc_ptr)())
                        hang ();
-               }
-       }
 
        misc_init_r();