[U-Boot] [PATCH] Added support for TMQ CAPD Board from Genesys Design <www.genesysdesign.com.au>

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Fri Nov 14 09:28:54 CET 2008


On 16:02 Fri 14 Nov     , Jared Holzman wrote:
> ---
>  Makefile                      |    3 +
>  board/tmq/tmq_capd/Makefile   |   61 +++
>  board/tmq/tmq_capd/config.mk  |    1 +
>  board/tmq/tmq_capd/led.c      |   56 +++
>  board/tmq/tmq_capd/nand.c     |   83 +++++
>  board/tmq/tmq_capd/tmq_capd.c |  259 +++++++++++++
>  include/asm-arm/mach-types.h  |  808 ++++++++++++++++++++++++++++++++++++++++-
>  include/configs/tmq_capd.h    |  165 +++++++++
>  tools/Makefile                |    3 +
>  tools/logos/tmqlogo.bmp       |  Bin 0 -> 20254 bytes
>  10 files changed, 1438 insertions(+), 1 deletions(-)
>  create mode 100644 board/tmq/tmq_capd/Makefile
>  create mode 100644 board/tmq/tmq_capd/config.mk
>  create mode 100644 board/tmq/tmq_capd/led.c
>  create mode 100644 board/tmq/tmq_capd/nand.c
>  create mode 100644 board/tmq/tmq_capd/tmq_capd.c
>  create mode 100644 include/configs/tmq_capd.h
>  create mode 100644 tools/logos/tmqlogo.bmp

please note that a common patch will send to reduce duplicate code for device
initialisation
> 
> diff --git a/Makefile b/Makefile
> index e4a184f..dae3903 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -2587,6 +2587,9 @@ at91sam9263ek_config	:	unconfig
>  at91sam9rlek_config	:	unconfig
>  	@$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9rlek atmel at91
>  
> +tmq_capd_config		:	unconfig
> +	@$(MKCONFIG) $(@:_config=) arm arm926ejs tmq_capd tmq at91
> +
>  ########################################################################
>  ## ARM Integrator boards - see doc/README-integrator for more info.
>  integratorap_config	\
> diff --git a/board/tmq/tmq_capd/Makefile b/board/tmq/tmq_capd/Makefile
> new file mode 100644
> index 0000000..3eee33a
 +
> +#ifdef CONFIG_USB_OHCI_NEW
> +static void capd_uhp_hw_init(void)
> +{
> +	/* Enable VBus on UHP ports */
> +	at91_set_gpio_output(AT91_PIN_PA21, 0);
> +	at91_set_gpio_output(AT91_PIN_PA24, 0);
> +
> +#ifdef SP2526_1_FITTED //SP2526-1 is Active High
> +	at91_set_gpio_value(AT91_PIN_PA21, 1);
> +	at91_set_gpio_value(AT91_PIN_PA24, 1);
> +#else
> +	at91_set_gpio_value(AT91_PIN_PA21, 0);
> +	at91_set_gpio_value(AT91_PIN_PA24, 0);
> +#endif
> +	
> +	
whitespace please remove
> +}
> +#endif
> +
please move this to lcd.c
> +#ifdef CONFIG_LCD
> +//Settings for the ET057003DM6 LCD
please no C++ comment style
> +vidinfo_t panel_info = {
> +	vl_col:		320,
> +	vl_row:		240,
> +	vl_clk:		5406000,
> +	vl_sync:	ATMEL_LCDC_INVCLK_INVERTED,
> +	vl_bpix:	3,
> +	vl_tft:		1,
> +	vl_hsync_len:	30,
> +	vl_left_margin:	38,
> +	vl_right_margin:20,
> +	vl_vsync_len:	5,
> +	vl_upper_margin:15,
> +	vl_lower_margin:5,
> +	mmio:		AT91SAM9263_LCDC_BASE,
> +};
> +
> +void lcd_enable(void)
> +{
> +	at91_set_gpio_value(AT91_PIN_PA30, 1);  /* power up */
					      ^^
whitespace please remove
> +}
> +
> +void lcd_disable(void)
> +{
> +	at91_set_gpio_value(AT91_PIN_PA30, 0);  /* power down */
					      ^^
whitespace please remove
> +}
> +
> +int board_init(void)
> +{
> +	/* Enable Ctrlc */
> +	console_init_f();
> +
> +	/* arch number of TMQ CAPD Board */
> +	gd->bd->bi_arch_number = MACH_TYPE_TMQ_CAPD;
> +	/* adress of boot parameters */
> +	gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
> +
> +	capd_serial_hw_init();
> +#ifdef CONFIG_CMD_NAND
> +	capd_nand_hw_init();
> +#endif
> +#ifdef CONFIG_USB_OHCI_NEW
> +	capd_uhp_hw_init();
> +#endif
> +#ifdef CONFIG_LCD
> +	capd_lcd_hw_init();
> +#endif
> +	return 0;
> +}
> +
> +int dram_init(void)
> +{
> +	gd->bd->bi_dram[0].start = PHYS_SDRAM;
> +	gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
> +	return 0;
> +}
> diff --git a/include/asm-arm/mach-types.h b/include/asm-arm/mach-types.h
> index ce6d25f..94ad824 100644
> --- a/include/asm-arm/mach-types.h
> +++ b/include/asm-arm/mach-types.h
If need you must ask a sync
and not that hte mach-types.h is sync every kernel release


> diff --git a/include/configs/tmq_capd.h b/include/configs/tmq_capd.h
> new file mode 100644
> index 0000000..7d6cbcc
> --- /dev/null
> +++ b/include/configs/tmq_capd.h
> @@ -0,0 +1,165 @@
> +/*
> + * (C) Copyright 2007-2008
> + * Stelian Pop <stelian.pop at leadtechdesign.com>
> + * Lead Tech Design <www.leadtechdesign.com>
> + *
> + * Configuation settings for the AT91SAM9263EK board.
> + *
> + * See file CREDITS for list of people who contributed to this
> + * project.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + */
> +
> +#ifndef __CONFIG_H
> +#define __CONFIG_H
> +
> +/* ARM asynchronous clock */
> +#define AT91_CPU_NAME		"AT91SAM9263"
> +#define AT91_MAIN_CLOCK		198656000	/* from 18.432 MHz crystal */
> +#define AT91_MASTER_CLOCK	99328000	/* peripheral = main / 2 */
> +#define CONFIG_SYS_HZ		1000000		/* 1us resolution */
> +
> +#define AT91_SLOW_CLOCK		32768	/* slow clock */
> +
> +#define CONFIG_ARM926EJS	1	/* This is an ARM926EJS Core	*/
> +#define CONFIG_AT91SAM9263	1	/* It's an Atmel AT91SAM9263 SoC*/
> +#define CONFIG_TMQ_CAPD		1	/* on an TMQ CAPD Board	*/
> +#undef CONFIG_USE_IRQ			/* we don't need IRQ/FIQ stuff	*/
> +
> +#define CONFIG_CMDLINE_TAG	1	/* enable passing of ATAGs	*/
> +#define CONFIG_SETUP_MEMORY_TAGS 1
> +#define CONFIG_INITRD_TAG	1
> +
> +#define CONFIG_SKIP_LOWLEVEL_INIT
> +#define CONFIG_SKIP_RELOCATE_UBOOT
> +
> +/*
> + * Hardware drivers
> + */
> +#define CONFIG_ATMEL_USART	1
> +#undef CONFIG_USART0
> +#undef CONFIG_USART1
> +#undef CONFIG_USART2
> +#define CONFIG_USART3		1	/* USART 3 is DBGU */
> +
> +/* LCD */
> +#define CONFIG_LCD			1
> +#define LCD_BPP				LCD_COLOR8
> +#define CONFIG_LCD_LOGO			1
> +#undef LCD_TEST_PATTERN
> +#define CONFIG_LCD_INFO			1
> +#define CONFIG_LCD_INFO_BELOW_LOGO	1
> +#define CONFIG_SYS_WHITE_ON_BLACK	1
> +#define CONFIG_ATMEL_LCD		1
> +#define CONFIG_ATMEL_LCD_BGR555		1
> +#define CONFIG_SYS_CONSOLE_IS_IN_ENV	1
> +
> +#define CONFIG_BOOTDELAY	3
> +
> +/*
> + * BOOTP options
> + */
> +#define CONFIG_BOOTP_BOOTFILESIZE	1
> +#define CONFIG_BOOTP_BOOTPATH		1
> +#define CONFIG_BOOTP_GATEWAY		1
> +#define CONFIG_BOOTP_HOSTNAME		1
> +
> +/*
> + * Command line configuration.
> + */
> +#include <config_cmd_default.h>
> +#undef CONFIG_CMD_BDI
> +#undef CONFIG_CMD_IMI
> +#undef CONFIG_CMD_AUTOSCRIPT
> +#undef CONFIG_CMD_FPGA
> +#undef CONFIG_CMD_LOADS
> +#undef CONFIG_CMD_IMLS
> +
> +#undef CONFIG_CMD_NET
> +#undef CONFIG_CMD_PING
> +#undef CONFIG_CMD_DHCP
> +#define CONFIG_CMD_NAND		1
> +#define CONFIG_CMD_USB		1
> +#define CONFIG_CMD_FAT		1
> +
> +/* SDRAM */
> +#define CONFIG_NR_DRAM_BANKS		1
> +#define PHYS_SDRAM			0x20000000
> +#define PHYS_SDRAM_SIZE			0x02000000	/* 32 megs */
> +
> +#define	CONFIG_SYS_NO_FLASH			1 		/* No NOR Flash */
							 ^
whitespace please remove
> +
> +/* NAND flash */
> +#define NAND_MAX_CHIPS			1
> +#define CONFIG_SYS_MAX_NAND_DEVICE		1
> +#define CONFIG_SYS_NAND_BASE			0x40000000
> +//#define CONFIG_SYS_NAND_DBW_8			1
> +#define CONFIG_SYS_NAND_DBW_16			1		/* 16bit */
> +
> +/* USB */
> +#define SP2526_1_FITTED			1
> +#undef SP2526_2_FITTED
> +#define CONFIG_USB_OHCI_NEW		1
> +#define LITTLEENDIAN			1
> +#define CONFIG_DOS_PARTITION		1
> +#define CONFIG_SYS_USB_OHCI_CPU_INIT		1
> +#define CONFIG_SYS_USB_OHCI_REGS_BASE		0x00a00000	/* AT91SAM9263_UHP_BASE */
> +#define CONFIG_SYS_USB_OHCI_SLOT_NAME		"at91sam9263"
> +#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS	2
> +#define CONFIG_USB_STORAGE		1
> +
> +#define CONFIG_SYS_LOAD_ADDR			0x21000000	/* load address */
> +
> +#define CONFIG_SYS_MEMTEST_START		PHYS_SDRAM
> +#define CONFIG_SYS_MEMTEST_END			0x21e00000
> +
> +/* bootstrap + u-boot + env + linux in nandflash */
> +#define CONFIG_ENV_IS_IN_NAND	1
> +#define CONFIG_ENV_OFFSET		0x60000
> +#define CONFIG_ENV_OFFSET_REDUND	0x80000
> +#define CONFIG_ENV_SIZE		0x20000		/* 1 sector = 128 kB */
> +#define CONFIG_BOOTCOMMAND	"nand read 21100000 100000 500000; bootm 21100000"
> +#define CONFIG_BOOTARGS		"console=ttyS0,115200 " \
> +				"root=/dev/mtdblock5 " \
> +				"mtdparts=at91_nand:128k(bootstrap)ro,256k(uboot)ro,128k(env1)ro,128k(env2)ro,2M(linux),-(root) " \
too long please split
> +				"rw rootfstype=jffs2"
> +
> +
> +#define CONFIG_BAUDRATE		115200
> +#define CONFIG_SYS_BAUDRATE_TABLE	{115200 , 19200, 38400, 57600, 9600 }
> +
> +#define CONFIG_SYS_PROMPT		"U-Boot> "
> +#define CONFIG_SYS_CBSIZE		256
> +#define CONFIG_SYS_MAXARGS		16
> +#define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
> +#define CONFIG_SYS_LONGHELP		1
> +#define CONFIG_CMDLINE_EDITING	1
> +
> +#define ROUND(A, B)		(((A) + (B)) & ~((B) - 1))
> +/*
> + * Size of malloc() pool
> + */
> +#define CONFIG_SYS_MALLOC_LEN		ROUND(3 * CONFIG_ENV_SIZE + 128*1024, 0x1000)
> +#define CONFIG_SYS_GBL_DATA_SIZE	128	/* 128 bytes for initial data */
> +
> +#define CONFIG_STACKSIZE	(32*1024)	/* regular stack */
please add space arround '*'
> +
> +#ifdef CONFIG_USE_IRQ
> +#error CONFIG_USE_IRQ not supported
> +#endif
> +
Best Regards,
J.


More information about the U-Boot mailing list