add support for C5000 thermostimulator
PATCH 1/1 add support for C5000 thermostimulator
Based on at91sam9263.
It is a thermostimulator for hair styling.
Subsection of
Software is based on at91sam9263ek one.
board/micronova/c5000/c5000.c 2009-06-18 12:57:52.000000000 +0200 renamed from board/micronova/c5000/c5000.c 1970-01-01 01:00:00.000000000 +0100 +43 -0
@@ -0,0 +1,194 @@ +/* + * (C) Copyright 2007-2008 + * Stelian Pop <[email protected]> + * Lead Tech Design <www.leadtechdesign.com> + * + * Giulio Benetti <[email protected]> + * Micronova srl <[email protected]> + * + * 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 + */ + +#include <common.h> +#include <asm/sizes.h> +#include <asm/arch/at91sam9263.h> +#include <asm/arch/at91sam9263_matrix.h> +#include <asm/arch/at91sam9_smc.h> +#include <asm/arch/at91_pmc.h> +#include <asm/arch/at91_rstc.h> +#include <asm/arch/gpio.h> +#include <asm/arch/io.h> +#include <asm/arch/hardware.h> +#include <lcd.h> +#include <atmel_lcdc.h> + +DECLARE_GLOBAL_DATA_PTR; + +/* -------------------------------------------------------------------------
*/
+/*
+ * Miscelaneous platform dependent initialisations
+ */
+
+static void c5000_serial_hw_init(void)
+{
+ at91_set_A_periph(AT91_PIN_PC30, 0); /* DRXD */ + at91_set_A_periph(AT91_PIN_PC31, 1); /* DTXD */ + at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_SYS);
+}
+
+static void c5000_nand_hw_init(void)
+{
+ unsigned long csa;
+
+ /* Enable CS3 */ + csa = at91_sys_read(AT91_MATRIX_EBI0CSA); + at91_sys_write(AT91_MATRIX_EBI0CSA,
+ csa | AT91_MATRIX_EBI0_CS3A_SMC_SMARTMEDIA);
+
+ /* Configure SMC CS3 for NAND/SmartMedia */
+ at91_sys_write(AT91_SMC_SETUP(3),
+ AT91_SMC_NWESETUP_(1) | AT91_SMC_NCS_WRSETUP_(0) | + AT91_SMC_NRDSETUP_(1) | AT91_SMC_NCS_RDSETUP_(0)); + at91_sys_write(AT91_SMC_PULSE(3), + AT91_SMC_NWEPULSE_(3) | AT91_SMC_NCS_WRPULSE_(3) | + AT91_SMC_NRDPULSE_(3) | AT91_SMC_NCS_RDPULSE_(3)); + at91_sys_write(AT91_SMC_CYCLE(3), + AT91_SMC_NWECYCLE_(5) | AT91_SMC_NRDCYCLE_(5)); + at91_sys_write(AT91_SMC_MODE(3), + AT91_SMC_READMODE | AT91_SMC_WRITEMODE | + AT91_SMC_EXNWMODE_DISABLE | + AT91_SMC_DBW_8 | + AT91_SMC_TDF_(2));
+
+ at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9263_ID_PIOA |
+ 1 << AT91SAM9263_ID_PIOCDE);
+
+ /* Configure RDY/BSY */
+ at91_set_gpio_input(AT91_PIN_PA22, 1);
+
+ /* Enable NandFlash */
+ at91_set_gpio_output(AT91_PIN_PD15, 1);
+}
+
+#ifdef CONFIG_HAS_DATAFLASH
+static void c5000_spi_hw_init(void)
+{
+ at91_set_B_periph(AT91_PIN_PA5, 0); /* SPI0_NPCS0 */
+
+ at91_set_B_periph(AT91_PIN_PA0, 0); /* SPI0_MISO */ + at91_set_B_periph(AT91_PIN_PA1, 0); /* SPI0_MOSI */ + at91_set_B_periph(AT91_PIN_PA2, 0); /* SPI0_SPCK */
+
+ /* Enable clock */
+ at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9263_ID_SPI0);
+}
+#endif
+
+vidinfo_t panel_info = {
+ vl_col: 640, + vl_row: 480, + vl_clk: 25000000, + vl_sync: ATMEL_LCDC_INVLINE_INVERTED | + ATMEL_LCDC_INVFRAME_INVERTED, + vl_bpix: 3, + vl_tft: 1, + vl_hsync_len: 4, + vl_left_margin: 16, + vl_right_margin:8, + vl_vsync_len: 1, + vl_upper_margin:8, + vl_lower_margin:5, + mmio: AT91SAM9263_LCDC_BASE,
+};
+
+void lcd_enable(void)
+{
+ at91_set_gpio_value(AT91_PIN_PA30, 1); /* power up */
+}
+
+void lcd_disable(void)
+{
+ at91_set_gpio_value(AT91_PIN_PA30, 0); /* power down */
+}
+
+static void c5000_lcd_hw_init(void)
+{
+ at91_set_A_periph(AT91_PIN_PC1, 0); /* LCDHSYNC */ + at91_set_A_periph(AT91_PIN_PC2, 0); /* LCDDOTCK */ + at91_set_A_periph(AT91_PIN_PC3, 0); /* LCDDEN */ + at91_set_B_periph(AT91_PIN_PB9, 0); /* LCDCC */ + at91_set_A_periph(AT91_PIN_PC6, 0); /* LCDD2 */ + at91_set_A_periph(AT91_PIN_PC7, 0); /* LCDD3 */ + at91_set_A_periph(AT91_PIN_PC8, 0); /* LCDD4 */ + at91_set_A_periph(AT91_PIN_PC9, 0); /* LCDD5 */ + at91_set_A_periph(AT91_PIN_PC10, 0); /* LCDD6 */ + at91_set_A_periph(AT91_PIN_PC11, 0); /* LCDD7 */ + at91_set_A_periph(AT91_PIN_PC14, 0); /* LCDD10 */ + at91_set_A_periph(AT91_PIN_PC15, 0); /* LCDD11 */ + at91_set_A_periph(AT91_PIN_PC16, 0); /* LCDD12 */ + at91_set_B_periph(AT91_PIN_PC12, 0); /* LCDD13 */ + at91_set_A_periph(AT91_PIN_PC18, 0); /* LCDD14 */ + at91_set_A_periph(AT91_PIN_PC19, 0); /* LCDD15 */ + at91_set_A_periph(AT91_PIN_PC22, 0); /* LCDD18 */ + at91_set_A_periph(AT91_PIN_PC23, 0); /* LCDD19 */ + at91_set_A_periph(AT91_PIN_PC24, 0); /* LCDD20 */ + at91_set_B_periph(AT91_PIN_PC17, 0); /* LCDD21 */ + at91_set_A_periph(AT91_PIN_PC26, 0); /* LCDD22 */ + at91_set_A_periph(AT91_PIN_PC27, 0); /* LCDD23 */
+
+ at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9263_ID_LCDC);
+
+ gd->fb_base = PHYS_SDRAM + 0x3FB5000; /* mapped into sdram @ 0x20000000 +
(64 MByte - (640x480) 8bpp) */
+}
+
+static void c5000_set_rst(void)
+{
+ at91_sys_write(AT91_RSTC_MR, AT91_RSTC_KEY |
+ (AT91_RSTC_ERSTL & (0x0E << 8)) |
+ AT91_RSTC_URSTEN);
+}
+
+int board_init(void)
+{
+ c5000_set_rst();
+
+ /* Enable Ctrlc */
+ console_init_f();
+
+ /* arch number of C5000-Board */ + gd->bd->bi_arch_number = MACH_TYPE_C5000; + /* adress of boot parameters */ + gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
+
+ c5000_serial_hw_init();
+ c5000_nand_hw_init();
+#ifdef CONFIG_HAS_DATAFLASH
+ c5000_spi_hw_init();
+#endif
+ c5000_lcd_hw_init();
+
+ 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 -urpN b/board/micronova/c5000/config.mka/board/micronova/c5000/config.mk
board/micronova/c5000/config.mk 2009-06-18 12:55:19.000000000 +0200 renamed from board/micronova/c5000/config.mk 1970-01-01 01:00:00.000000000 +0100 +1 -0
@@ -0,0 +1 @@ +TEXT_BASE = 0x23f00000
board/micronova/c5000/Makefile 2009-06-18 12:55:19.000000000 +0200 renamed from board/micronova/c5000/Makefile 1970-01-01 01:00:00.000000000 +0100 +56 -0
56 lines not on this page · raw message
board/micronova/c5000/nand.c 2009-06-18 16:49:04.000000000 +0200 renamed from board/micronova/c5000/nand.c 1970-01-01 01:00:00.000000000 +0100 +75 -0
75 lines not on this page · raw message
diff -urpN b/board/micronova/c5000/partition.ca/board/micronova/c5000/partition.c
board/micronova/c5000/partition.c 2009-06-18 16:50:06.000000000 +0200 renamed from board/micronova/c5000/partition.c 1970-01-01 01:00:00.000000000 +0100 +37 -0
@@ -0,0 +1,37 @@ +/* + * (C) Copyright 2008 + * Ulf Samuelsson <[email protected]> + * + * 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 + * + */ +#include <common.h> +#include <config.h> +#include <asm/hardware.h> +#include <dataflash.h> + +AT91S_DATAFLASH_INFO dataflash_info[CONFIG_SYS_MAX_DATAFLASH_BANKS]; + +struct dataflash_addr cs[CONFIG_SYS_MAX_DATAFLASH_BANKS] = { + {CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0, 0}, /* Logical adress, CS */ +}; + +/*define the area offsets*/ +dataflash_protect_t area_list[NB_DATAFLASH_AREA] = { + {0x00000000, 0x000041FF, FLAG_PROTECT_SET, 0, "Bootstrap"}, + {0x00004200, 0x000083FF, FLAG_PROTECT_CLEAR, 0, "Environment"}, + {0x00008400, 0x00041FFF, FLAG_PROTECT_SET, 0, "U-Boot"}, +};
include/configs/c5000.h 2009-06-18 17:06:07.000000000 +0200 renamed from include/configs/c5000.h 1970-01-01 01:00:00.000000000 +0100 +121 -0
121 lines not on this page · raw message
CONFIG_ENV_OFFSET)
+#define CONFIG_ENV_SIZE 0x4200
+
+#else /* CONFIG_USE_NANDFLASH */
+
+/* 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 */
+
+#endif
+
+#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 */
+
+#define CONFIG_AT91SAM9_WATCHDOG
+#define CONFIG_HW_WATCHDOG
+
+#endif
Makefile 2009-06-18 12:55:19.000000000 +0200 renamed from Makefile 2009-06-14 21:30:39.000000000 +0200 +3 -0
@@ -2752,6 +2752,9 @@ at91sam9rlek_config : unconfig pm9263_config : unconfig @$(MKCONFIG) $(@:_config=) arm arm926ejs pm9263 ronetix at91 +c5000_config : unconfig + @$(MKCONFIG) $(@:_config=) arm arm926ejs c5000 micronova at91 + ######################################################################## ## ARM Integrator boards - see doc/README-integrator for more info. integratorap_config \
Signature · 3 lines
Giulio Benetti R&D Micronova srl
PATCH 1/1 add support for C5000 thermostimulator
Dear Giulio Benetti,
Quoted 6 lines · In message <[email protected]> you wrote:
Based on at91sam9263.
It is a thermostimulator for hair styling.
Subsection of
Software is based on at91sam9263ek one.Signed-off-by giulio.benetti at micronovasrl.com
Please use git-format-patch to prepare patches.
Entries for MAINTAINERS and MAKEALL files are missing.
Please use TABs (instead of spaces) for vertical alignment.
Quoted 3 lines
diff -urpN
b/board/micronova/c5000/c5000.ca/board/micronova/c5000/c5000.cboard/micronova/c5000/c5000.c 2009-06-18 12:57:52.000000000 +0200 renamed from board/micronova/c5000/c5000.c 1970-01-01 01:00:00.000000000 +0100 +0
-0
...
Quoted 4 lines
board/micronova/c5000/c5000.c 2009-06-18 12:57:52.000000000 +0200 renamed from board/micronova/c5000/c5000.c 1970-01-01 01:00:00.000000000 +0100 +3
-0+ at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9263_ID_LCDC); + + gd->fb_base = PHYS_SDRAM + 0x3FB5000; /* mapped into sdram @ 0x20000000 +(64 MByte - (640x480) 8bpp) */
Line too long. Please fix globally.
board/micronova/c5000/c5000.c 2009-06-18 12:57:52.000000000 +0200
Quoted 6 lines
board/micronova/c5000/c5000.c 2009-06-18 12:57:52.000000000 +0200 renamed from board/micronova/c5000/c5000.c 1970-01-01 01:00:00.000000000 +0100 +6
-0+int dram_init(void) +{ + gd->bd->bi_dram[0].start = PHYS_SDRAM; + gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE; + return 0; +}
How about using get_ram_size() for auto-sizing and memory testing?
board/micronova/c5000/config.mk 2009-06-18 12:55:19.000000000 +0200 line 1
Quoted 6 lines
diff -urpN
b/board/micronova/c5000/config.mka/board/micronova/c5000/config.mkboard/micronova/c5000/config.mk 2009-06-18 12:55:19.000000000 +0200 renamed from board/micronova/c5000/config.mk 1970-01-01 01:00:00.000000000 +0100 +1
-0@@ -0,0 +1 @@ +TEXT_BASE = 0x23f00000
Copyright entry missing.
Makefile 2009-06-18 12:55:19.000000000 +0200 at91sam9rlek_config : unconfig · line 2757
Quoted 10 lines
diff -urpN b/Makefile a/Makefile
Makefile 2009-06-18 12:55:19.000000000 +0200 renamed from Makefile 2009-06-14 21:30:39.000000000 +0200 +3
-0@@ -2752,6 +2752,9 @@ at91sam9rlek_config : unconfig pm9263_config : unconfig @$(MKCONFIG) $(@:_config=) arm arm926ejs pm9263 ronetix at91 +c5000_config : unconfig + @$(MKCONFIG) $(@:_config=) arm arm926ejs c5000 micronova at91 +
Please keep lists sorted.
Best regards,
Wolfgang Denk
Signature · 4 lines
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 ######## This message was made from 100% recycled electrons. ########