Re: [U-Boot] [PATCH v3 3/3] ARMV7: Exynos4: Add support for TRATS board
On 11 January 2012 13:00, Kim, Heungjun riverful@samsung.com wrote: Hi Minkyu Kang, On 2012년 01월 11일 11:35, Minkyu Kang wrote: Dear HeungJun, Kim, On 10 January 2012 18:00, HeungJun, Kimriverful@samsung.com wrote: This patch adds support for Samsung TRATS board Signed-off-by: HeungJun, Kimriverful@samsung.com Signed-off-by: Kyungmin Parkkyungmin.p...@samsung.com --- MAINTAINERS | 4 + board/samsung/trats/Makefile | 43 ++ board/samsung/trats/trats.c | 349 board/samsung/trats/trats_setup.h | 814 + boards.cfg | 1 + include/configs/trats.h | 216 ++ 6 files changed, 1427 insertions(+), 0 deletions(-) create mode 100644 board/samsung/trats/Makefile create mode 100644 board/samsung/trats/trats.c create mode 100644 board/samsung/trats/trats_setup.h create mode 100644 include/configs/trats.h diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c new file mode 100644 index 000..9070df5 --- /dev/null +++ b/board/samsung/trats/trats.c +void lowlevel_init(void) +{ + s5p_set_cpu_id(); /* For using Exynos's structures */ + + watchdog_disable(); + + clock_init(); + power_init(); +} One more... I think.. we need to set GPIOs for UART select. Please check old lowlevel_init function. Thanks. Minkyu Kang. -- from. prom. www.promsoft.net ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3 3/3] ARMV7: Exynos4: Add support for TRATS board
This patch adds support for Samsung TRATS board Signed-off-by: HeungJun, Kim riverful@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com --- MAINTAINERS |4 + board/samsung/trats/Makefile | 43 ++ board/samsung/trats/trats.c | 349 board/samsung/trats/trats_setup.h | 814 + boards.cfg|1 + include/configs/trats.h | 216 ++ 6 files changed, 1427 insertions(+), 0 deletions(-) create mode 100644 board/samsung/trats/Makefile create mode 100644 board/samsung/trats/trats.c create mode 100644 board/samsung/trats/trats_setup.h create mode 100644 include/configs/trats.h diff --git a/MAINTAINERS b/MAINTAINERS index 4bf12b5..60314a6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -706,6 +706,10 @@ Chander Kashyap k.chan...@samsung.com origen ARM ARMV7 (EXYNOS4210 SoC) SMDKV310ARM ARMV7 (EXYNOS4210 SoC) +Heungjun Kim riverful@samsung.com + + trats ARM ARMV7 (EXYNOS4210 SoC) + Torsten Koschorrek koschor...@synertronixx.de scb9328 ARM920T (i.MXL) diff --git a/board/samsung/trats/Makefile b/board/samsung/trats/Makefile new file mode 100644 index 000..d21883f --- /dev/null +++ b/board/samsung/trats/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2011 Samsung Electronics +# Heungjun Kim riverful@samsung.com +# +# 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 $(TOPDIR)/config.mk + +LIB= $(obj)lib$(BOARD).o + +COBJS-y+= trats.o + +SRCS:= $(COBJS-y:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS-y)) + +$(LIB):$(obj).depend $(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c new file mode 100644 index 000..9070df5 --- /dev/null +++ b/board/samsung/trats/trats.c @@ -0,0 +1,349 @@ +/* + * Copyright (C) 2011 Samsung Electronics + * Heungjun Kim riverful@samsung.com + * Kyungmin Park kyungmin.p...@samsung.com + * + * 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/io.h +#include asm/arch/gpio.h +#include asm/arch/mmc.h +#include asm/arch/clock.h +#include asm/arch/watchdog.h +#include asm/arch/gpio.h +#include asm/arch/power.h +#include pmic.h +#include usb/s3c_udc.h +#include asm/arch/cpu.h +#include max8998_pmic.h + +#include trats_setup.h + +DECLARE_GLOBAL_DATA_PTR; + +unsigned int board_rev; + +#ifdef CONFIG_REVISION_TAG +u32 get_board_rev(void) +{ + return board_rev; +} +#endif + +static void check_hw_revision(void); +static void pmic_reset(void); + +int board_init(void) +{ + gd-bd-bi_boot_params = PHYS_SDRAM_1 + 0x100; + + check_hw_revision(); + printf(HW Revision:\t0x%x\n, board_rev); + +#if defined(CONFIG_PMIC) + pmic_init(); + pmic_reset(); +#endif + + return 0; +} + +int dram_init(void) +{ + gd-ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE) + + get_ram_size((long *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE); + + return 0; +} + +void dram_init_banksize(void) +{ + gd-bd-bi_dram[0].start = PHYS_SDRAM_1; +
Re: [U-Boot] [PATCH v3 3/3] ARMV7: Exynos4: Add support for TRATS board
Dear HeungJun, Kim, On 10 January 2012 18:00, HeungJun, Kim riverful@samsung.com wrote: This patch adds support for Samsung TRATS board Signed-off-by: HeungJun, Kim riverful@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com --- MAINTAINERS | 4 + board/samsung/trats/Makefile | 43 ++ board/samsung/trats/trats.c | 349 board/samsung/trats/trats_setup.h | 814 + boards.cfg | 1 + include/configs/trats.h | 216 ++ 6 files changed, 1427 insertions(+), 0 deletions(-) create mode 100644 board/samsung/trats/Makefile create mode 100644 board/samsung/trats/trats.c create mode 100644 board/samsung/trats/trats_setup.h create mode 100644 include/configs/trats.h diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c new file mode 100644 index 000..9070df5 --- /dev/null +++ b/board/samsung/trats/trats.c @@ -0,0 +1,349 @@ +/* + * Copyright (C) 2011 Samsung Electronics + * Heungjun Kim riverful@samsung.com + * Kyungmin Park kyungmin.p...@samsung.com + * + * 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/io.h +#include asm/arch/gpio.h +#include asm/arch/mmc.h +#include asm/arch/clock.h +#include asm/arch/watchdog.h +#include asm/arch/gpio.h +#include asm/arch/power.h +#include pmic.h +#include usb/s3c_udc.h +#include asm/arch/cpu.h +#include max8998_pmic.h + +#include trats_setup.h + +DECLARE_GLOBAL_DATA_PTR; + +unsigned int board_rev; + +#ifdef CONFIG_REVISION_TAG +u32 get_board_rev(void) +{ + return board_rev; +} +#endif + +static void check_hw_revision(void); +static void pmic_reset(void); + +int board_init(void) +{ + gd-bd-bi_boot_params = PHYS_SDRAM_1 + 0x100; + + check_hw_revision(); + printf(HW Revision:\t0x%x\n, board_rev); + +#if defined(CONFIG_PMIC) + pmic_init(); + pmic_reset(); +#endif + + return 0; +} + +int dram_init(void) +{ + gd-ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE) + + get_ram_size((long *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE); + + return 0; +} + +void dram_init_banksize(void) +{ + gd-bd-bi_dram[0].start = PHYS_SDRAM_1; + gd-bd-bi_dram[0].size = PHYS_SDRAM_1_SIZE; + gd-bd-bi_dram[1].start = PHYS_SDRAM_2; + gd-bd-bi_dram[1].size = PHYS_SDRAM_2_SIZE; +} + +static unsigned int get_hw_revision(void) +{ + struct exynos4_gpio_part1 *gpio = + (struct exynos4_gpio_part1 *)samsung_get_base_gpio_part1(); + int hwrev = 0; + int i; + + /* hw_rev[3:0] == GPE1[3:0] */ + for (i = 0; i 4; i++) { + s5p_gpio_cfg_pin(gpio-e1, i, GPIO_INPUT); + s5p_gpio_set_pull(gpio-e1, i, GPIO_PULL_NONE); + } + + udelay(1); + + for (i = 0; i 4; i++) + hwrev |= (s5p_gpio_get_value(gpio-e1, i) i); + + debug(hwrev 0x%x\n, hwrev); + + return hwrev; +} + +static void check_hw_revision(void) +{ + int hwrev; + + hwrev = get_hw_revision(); + + board_rev |= hwrev; +} + +static void pmic_reset(void) +{ + struct exynos4_gpio_part2 *gpio = + (struct exynos4_gpio_part2 *)samsung_get_base_gpio_part2(); + + s5p_gpio_set_pull(gpio-x2, 7, GPIO_PULL_NONE); + s5p_gpio_direction_output(gpio-x2, 7, 1); +} + +#ifdef CONFIG_DISPLAY_BOARDINFO +int checkboard(void) +{ + puts(Board:\tTRATS\n); + return 0; +} +#endif + +#ifdef CONFIG_GENERIC_MMC +int board_mmc_init(bd_t *bis) +{ + struct exynos4_gpio_part2 *gpio = + (struct exynos4_gpio_part2 *)samsung_get_base_gpio_part2(); + int i, err; + + /* eMMC_EN: SD_0_CDn: GPK0[2] Output High */ + s5p_gpio_direction_output(gpio-k0, 2, 1); + s5p_gpio_set_pull(gpio-k0, 2, GPIO_PULL_NONE); + + /* + * eMMC GPIO: + * SDR 8-bit@48MHz at MMC0 + * GPK0[0] SD_0_CLK(2) + * GPK0[1] SD_0_CMD(2) + * GPK0[2]
Re: [U-Boot] [PATCH v3 3/3] ARMV7: Exynos4: Add support for TRATS board
Hi Minkyu Kang, On 2012년 01월 11일 11:35, Minkyu Kang wrote: Dear HeungJun, Kim, On 10 January 2012 18:00, HeungJun, Kimriverful@samsung.com wrote: This patch adds support for Samsung TRATS board Signed-off-by: HeungJun, Kimriverful@samsung.com Signed-off-by: Kyungmin Parkkyungmin.p...@samsung.com --- MAINTAINERS |4 + board/samsung/trats/Makefile | 43 ++ board/samsung/trats/trats.c | 349 board/samsung/trats/trats_setup.h | 814 + boards.cfg|1 + include/configs/trats.h | 216 ++ 6 files changed, 1427 insertions(+), 0 deletions(-) create mode 100644 board/samsung/trats/Makefile create mode 100644 board/samsung/trats/trats.c create mode 100644 board/samsung/trats/trats_setup.h create mode 100644 include/configs/trats.h diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c new file mode 100644 index 000..9070df5 --- /dev/null +++ b/board/samsung/trats/trats.c @@ -0,0 +1,349 @@ +/* + * Copyright (C) 2011 Samsung Electronics + * Heungjun Kimriverful@samsung.com + * Kyungmin Parkkyungmin.p...@samsung.com + * + * 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 + */ + +#includecommon.h +#includeasm/io.h +#includeasm/arch/gpio.h +#includeasm/arch/mmc.h +#includeasm/arch/clock.h +#includeasm/arch/watchdog.h +#includeasm/arch/gpio.h +#includeasm/arch/power.h +#includepmic.h +#includeusb/s3c_udc.h +#includeasm/arch/cpu.h +#includemax8998_pmic.h + +#include trats_setup.h + +DECLARE_GLOBAL_DATA_PTR; + +unsigned int board_rev; + +#ifdef CONFIG_REVISION_TAG +u32 get_board_rev(void) +{ + return board_rev; +} +#endif + +static void check_hw_revision(void); +static void pmic_reset(void); + +int board_init(void) +{ + gd-bd-bi_boot_params = PHYS_SDRAM_1 + 0x100; + + check_hw_revision(); + printf(HW Revision:\t0x%x\n, board_rev); + +#if defined(CONFIG_PMIC) + pmic_init(); + pmic_reset(); +#endif + + return 0; +} + +int dram_init(void) +{ + gd-ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE) + + get_ram_size((long *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE); + + return 0; +} + +void dram_init_banksize(void) +{ + gd-bd-bi_dram[0].start = PHYS_SDRAM_1; + gd-bd-bi_dram[0].size = PHYS_SDRAM_1_SIZE; + gd-bd-bi_dram[1].start = PHYS_SDRAM_2; + gd-bd-bi_dram[1].size = PHYS_SDRAM_2_SIZE; +} + +static unsigned int get_hw_revision(void) +{ + struct exynos4_gpio_part1 *gpio = + (struct exynos4_gpio_part1 *)samsung_get_base_gpio_part1(); + int hwrev = 0; + int i; + + /* hw_rev[3:0] == GPE1[3:0] */ + for (i = 0; i 4; i++) { + s5p_gpio_cfg_pin(gpio-e1, i, GPIO_INPUT); + s5p_gpio_set_pull(gpio-e1, i, GPIO_PULL_NONE); + } + + udelay(1); + + for (i = 0; i 4; i++) + hwrev |= (s5p_gpio_get_value(gpio-e1, i) i); + + debug(hwrev 0x%x\n, hwrev); + + return hwrev; +} + +static void check_hw_revision(void) +{ + int hwrev; + + hwrev = get_hw_revision(); + + board_rev |= hwrev; +} + +static void pmic_reset(void) +{ + struct exynos4_gpio_part2 *gpio = + (struct exynos4_gpio_part2 *)samsung_get_base_gpio_part2(); + + s5p_gpio_set_pull(gpio-x2, 7, GPIO_PULL_NONE); + s5p_gpio_direction_output(gpio-x2, 7, 1); +} + +#ifdef CONFIG_DISPLAY_BOARDINFO +int checkboard(void) +{ + puts(Board:\tTRATS\n); + return 0; +} +#endif + +#ifdef CONFIG_GENERIC_MMC +int board_mmc_init(bd_t *bis) +{ + struct exynos4_gpio_part2 *gpio = + (struct exynos4_gpio_part2 *)samsung_get_base_gpio_part2(); + int i, err; + + /* eMMC_EN: SD_0_CDn: GPK0[2] Output High */ + s5p_gpio_direction_output(gpio-k0, 2, 1); + s5p_gpio_set_pull(gpio-k0, 2, GPIO_PULL_NONE); + + /* +* eMMC GPIO: +* SDR 8-bit@48MHz at MMC0 +* GPK0[0] SD_0_CLK(2) +* GPK0[1] SD_0_CMD(2) +* GPK0[2] SD_0_CDn- Not used +* GPK0[3:6]SD_0_DATA[0:3](2) +* GPK1[3:6]SD_0_DATA[0:3](3) +