[U-Boot] [PATCH] Add support for Indefia Nimbus Cloud Board

Wolfgang Denk
2010-01-17T23:17:47Z

Dear Semih Hazar,

In message <4B2A2E3A.4070908@indefia.com> you wrote:
>
> Nimbus Cloud is an AVR32 based single board computer with
> 256MiB NAND, 64MiB SDRAM, battery backed RTC, LCD/touch
> screen support, VGA Output, Ethernet and offers seamless
> integration with Indefia's Zigbee transceivers.
...
> diff --git a/board/indefia/nimbuscloud/flash.c b/board/indefia/nimbuscloud/flash.c
> new file mode 100644
> index 0000000..04e6974
> --- /dev/null
> +++ b/board/indefia/nimbuscloud/flash.c

Is ther e a chance to do without this file and use the CFI driver
instead?

> +unsigned long flash_init(void)
> +{
> + unsigned long addr;
> + unsigned int i;
> +
> + gd->bd->bi_flashstart = CONFIG_SYS_FLASH_BASE;
> + gd->bd->bi_flashsize = CONFIG_SYS_FLASH_SIZE;
> + gd->bd->bi_flashoffset = _edata - _text;
> +
> + flash_info[0].size = CONFIG_SYS_FLASH_SIZE;
> + flash_info[0].sector_count = CONFIG_SYS_MAX_FLASH_SECT;
> +
> + flash_identify(uncached((void *)CONFIG_SYS_FLASH_BASE), &flash_info[0]);
> +
> + // First 8 sectors are 8k

Please do not use C++ comments.

> + for (i = 0, addr = 0; i < 8; i++, addr += 0x2000)
> + flash_info[0].start[i] = addr;
> +
> + // Remaing are 64k

Ditto. Please fix globally.

> +int board_early_init_f(void)
> +{
> + /* Enable SDRAM in the EBI mux */
> + hmatrix_slave_write(EBI, SFR, HMATRIX_BIT(EBI_SDRAM_ENABLE));
> +
> + portmux_enable_ebi(32, 23, 0, PORTMUX_DRIVE_HIGH);
> + portmux_enable_usart1(PORTMUX_DRIVE_MIN);
> +
> + /* Enable GPIO on config swicthes */
> + portmux_select_gpio(PORTMUX_PORT_B, (1 << 13) | (1 << 14) | (1 << 15) | (1 << 16),

Line too long. Please fix globally.

> +phys_size_t initdram(int board_type)
> +{
> + unsigned long expected_size;
> + unsigned long actual_size;
> + void *sdram_base;
> +
> + sdram_base = map_physmem(EBI_SDRAM_BASE, EBI_SDRAM_SIZE, MAP_NOCACHE);
> +
> + expected_size = sdram_init(sdram_base, &sdram_config);
> + actual_size = get_ram_size(sdram_base, expected_size);
> +
> + unmap_physmem(sdram_base, EBI_SDRAM_SIZE);
> +
> + if (expected_size != actual_size)
> + printf("Warning: Only %lu of %lu MiB SDRAM is working\n",
> + actual_size >> 20, expected_size >> 20);
> +
> + printf("Indefia Nimbus Cloud - CPU@%d MHz, SDRAM %d MiB @%d MHz\n",
> + (int) (get_cpu_clk_rate()/1000000), (int) (actual_size >> 20), (int) (get_sdram_clk_rate()/1000000));

Line too long. And please use strmhz() to print clock frequencies.

Um... this print does not belong here at all. CPU init messages and
board initi messages have no place in initdram() at all.

> diff --git a/board/indefia/nimbuscloud/u-boot.lds b/board/indefia/nimbuscloud/u-boot.lds
> new file mode 100644
> index 0000000..a7243f2
> --- /dev/null
> +++ b/board/indefia/nimbuscloud/u-boot.lds

Do you really need a board specific linker script?

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"The computer programmer is a creator of universes for which he alone
is responsible. Universes of virtually unlimited complexity can be
created in the form of computer programs." - Joseph Weizenbaum,
_Computer Power and Human Reason_