[U-Boot-Users] [ARM] TI DaVinci (TMS320DM644x) support [2/5]
Dirk Behme
dirk.behme at googlemail.com
Mon Aug 6 19:11:49 CEST 2007
ksi at koi8.net wrote:
> diff -purN u-boot.git.orig/include/linux/mtd/mtd.h
u-boot.git/include/linux/mtd/mtd.h
> --- u-boot.git.orig/include/linux/mtd/mtd.h 2007-02-12
10:41:27.000000000 -0800
> +++ u-boot.git/include/linux/mtd/mtd.h 2007-08-05
16:19:52.000000000 -0700
> @@ -11,6 +11,11 @@
> #include <linux/types.h>
> #include <linux/mtd/mtd-abi.h>
>
> +#if 0
> +#define CONFIG_MTD_DEBUG 1
> +#define CONFIG_MTD_DEBUG_VERBOSE 3
> +#endif
> +
> #define MAX_MTD_DEVICES 16
>
> #define MTD_ERASE_PENDING 0x01
> @@ -201,11 +206,19 @@ static inline void mtd_erase_callback(st
> #define MTD_DEBUG_LEVEL3 (3) /* Noisy */
>
> #ifdef CONFIG_MTD_DEBUG
> +#if 0
> #define DEBUG(n, args...) \
> do { \
> if (n <= CONFIG_MTD_DEBUG_VERBOSE) \
> printk(KERN_INFO args); \
> } while(0)
> +#else
> +#define DEBUG(n, args...) \
> + do { \
> + if (n <= CONFIG_MTD_DEBUG_VERBOSE) \
> + printf(args); \
> + } while(0)
> +#endif
> #else /* CONFIG_MTD_DEBUG */
> #define DEBUG(n, args...) do { } while(0)
>
...
> diff -purN u-boot.git.orig/drivers/nand/nand_bbt.c u-boot.git/drivers/nand/nand_bbt.c
> --- u-boot.git.orig/drivers/nand/nand_bbt.c 2007-02-12 10:41:27.000000000 -0800
> +++ u-boot.git/drivers/nand/nand_bbt.c 2007-08-05 16:19:52.000000000 -0700
> @@ -152,7 +152,7 @@ static int read_bbt (struct mtd_info *mt
> continue;
> if (reserved_block_code &&
> (tmp == reserved_block_code)) {
> - printk (KERN_DEBUG "nand_read_bbt: Reserved block at 0x%08x\n",
> + DEBUG(MTD_DEBUG_LEVEL0, "nand_read_bbt: Reserved block at 0x%08x\n",
> ((offs << 2) + (act >> 1)) << this->bbt_erase_shift);
> this->bbt[offs + (act >> 3)] |= 0x2 << (act & 0x06);
> continue;
> @@ -229,14 +229,14 @@ static int read_abs_bbts (struct mtd_inf
> if (td->options & NAND_BBT_VERSION) {
> nand_read_raw (mtd, buf, td->pages[0] << this->page_shift, mtd->oobblock, mtd->oobsize);
> td->version[0] = buf[mtd->oobblock + td->veroffs];
> - printk (KERN_DEBUG "Bad block table at page %d, version 0x%02X\n", td->pages[0], td->version[0]);
> + DEBUG(MTD_DEBUG_LEVEL0, "Bad block table at page %d, version 0x%02X\n", td->pages[0], td->version[0]);
> }
>
> /* Read the mirror version, if available */
> if (md && (md->options & NAND_BBT_VERSION)) {
> nand_read_raw (mtd, buf, md->pages[0] << this->page_shift, mtd->oobblock, mtd->oobsize);
> md->version[0] = buf[mtd->oobblock + md->veroffs];
> - printk (KERN_DEBUG "Bad block table at page %d, version 0x%02X\n", md->pages[0], md->version[0]);
> + DEBUG(MTD_DEBUG_LEVEL0, "Bad block table at page %d, version 0x%02X\n", md->pages[0], md->version[0]);
> }
>
> return 1;
> @@ -375,7 +375,7 @@ static int search_bbt (struct mtd_info *
> if (td->pages[i] == -1)
> printk (KERN_WARNING "Bad block table not found for chip %d\n", i);
> else
> - printk (KERN_DEBUG "Bad block table found at page %d, version 0x%02X\n", td->pages[i], td->version[i]);
> + DEBUG(MTD_DEBUG_LEVEL0, "Bad block table found at page %d, version 0x%02X\n", td->pages[i], td->version[i]);
> }
> return 0;
> }
> @@ -569,7 +569,7 @@ write:
> printk (KERN_WARNING "nand_bbt: Error while writing bad block table %d\n", res);
> return res;
> }
> - printk (KERN_DEBUG "Bad block table written to 0x%08x, version 0x%02X\n",
> + DEBUG(MTD_DEBUG_LEVEL0, "Bad block table written to 0x%08x, version 0x%02X\n",
> (unsigned int) to, td->version[chip]);
>
> /* Mark it as used */
- Do we really need this? If yes, please check if you hit all "printk
(KERN_DEBUG, .." statements. It looked to me that there was still one
"printk (KERN_DEBUG, .." after applying your patch.
- Can anybody please check if patches [2/5] and [5/5] apply cleanly?
I'm not sure whether I made anything wrong while saving the patches,
but patch 2 and 5, which are modify existing files, have rejects for me.
So unfortunately, I can't actually compile DaVinci patches because
(a) recent git fails compiling for me in drivers/bios_emulator
(b) patch [2/5] and [5/5] have rejects for me I have to resolve manually
(c) if (a) and (b) is fixed, davinci.h needs changes for most recent git
So all comments from review only. Hope this helps at least a little.
Best regards
Dirk
More information about the U-Boot
mailing list