From 3ff7785627d11739593efddde5d5ee861deb99ae Mon Sep 17 00:00:00 2001 From: Przemyslaw Marczak Date: Tue, 8 Jul 2014 13:48:16 +0200 Subject: [PATCH] tizen: add tizen_defconfig Change-Id: I52603d206b90616f1ea8dc4ff926c4f2541964da Signed-off-by: Przemyslaw Marczak --- arch/arm/cpu/armv7/exynos/Kconfig | 4 + board/samsung/common/Kconfig | 12 ++ board/samsung/common/MAINTAINERS | 6 + configs/tizen_defconfig | 3 + include/configs/tizen-environment.h | 88 +++++++++++++ include/configs/tizen.h | 247 ++++++++++++++++++++++++++++++++++++ 6 files changed, 360 insertions(+) create mode 100644 board/samsung/common/Kconfig create mode 100644 board/samsung/common/MAINTAINERS create mode 100644 configs/tizen_defconfig create mode 100644 include/configs/tizen-environment.h create mode 100644 include/configs/tizen.h diff --git a/arch/arm/cpu/armv7/exynos/Kconfig b/arch/arm/cpu/armv7/exynos/Kconfig index 7a0d182..d2e9484 100644 --- a/arch/arm/cpu/armv7/exynos/Kconfig +++ b/arch/arm/cpu/armv7/exynos/Kconfig @@ -22,6 +22,9 @@ config TARGET_TRATS2 config TARGET_ODROID bool "Exynos4412 Odroid board" +config TARGET_TIZEN + bool "Exynos4412: Trats2/Odroid-U3&X2 boards" + config TARGET_ARNDALE bool "Exynos5250 Arndale board" select OF_CONTROL if !SPL_BUILD @@ -56,6 +59,7 @@ source "board/samsung/universal_c210/Kconfig" source "board/samsung/origen/Kconfig" source "board/samsung/trats2/Kconfig" source "board/samsung/odroid/Kconfig" +source "board/samsung/common/Kconfig" source "board/samsung/arndale/Kconfig" source "board/samsung/smdk5250/Kconfig" source "board/samsung/smdk5420/Kconfig" diff --git a/board/samsung/common/Kconfig b/board/samsung/common/Kconfig new file mode 100644 index 0000000..1a1ce40 --- /dev/null +++ b/board/samsung/common/Kconfig @@ -0,0 +1,12 @@ +if TARGET_TIZEN + +config SYS_BOARD + default "common" + +config SYS_VENDOR + default "samsung" + +config SYS_CONFIG_NAME + default "tizen" + +endif diff --git a/board/samsung/common/MAINTAINERS b/board/samsung/common/MAINTAINERS new file mode 100644 index 0000000..70174bc --- /dev/null +++ b/board/samsung/common/MAINTAINERS @@ -0,0 +1,6 @@ +ODROID BOARD +M: Przemyslaw Marczak +S: Maintained +F: board/samsung/common/ +F: include/configs/tizen.h +F: configs/tizen_defconfig diff --git a/configs/tizen_defconfig b/configs/tizen_defconfig new file mode 100644 index 0000000..b2a8f46 --- /dev/null +++ b/configs/tizen_defconfig @@ -0,0 +1,3 @@ +CONFIG_ARM=y +CONFIG_ARCH_EXYNOS=y +CONFIG_TARGET_TIZEN=y diff --git a/include/configs/tizen-environment.h b/include/configs/tizen-environment.h new file mode 100644 index 0000000..7a3052c --- /dev/null +++ b/include/configs/tizen-environment.h @@ -0,0 +1,88 @@ +#ifndef _TIZEN_ENVIRONMENT_H_ +#define _TIZEN_ENVIRONMENT_H_ + +/* + * Bootable media layout: + * dev: SD eMMC(part boot) + * BL1 1 0 + * BL2 31 30 + * UBOOT 63 62 + * TZSW 2111 2110 + * ENV 2560 2560(part user) + * + * MBR Primary partiions: + * Num Name Size Offset + * 1. BOOT: 100MiB 2MiB + * 2. ROOT: 3GiB + * 3. DATA: 3GiB + * 4. UMS: - +*/ + +/* Tizen - partitions definitions */ +#define PARTS_CSA "csa-mmc" +#define PARTS_BOOT "boot" +#define PARTS_QBOOT "qboot" +#define PARTS_CSC "csc" +#define PARTS_ROOT "platform" +#define PARTS_DATA "data" +#define PARTS_UMS "ums" + +#define PARTS_ODROID \ + "This board uses MSDOS partition table." + +#define PARTS_TRATS2 \ + "uuid_disk=${uuid_gpt_disk};" \ + "name="PARTS_CSA",start=5MiB,size=8MiB,uuid=${uuid_gpt_"PARTS_CSA"};" \ + "name="PARTS_BOOT",size=60MiB,uuid=${uuid_gpt_"PARTS_BOOT"};" \ + "name="PARTS_QBOOT",size=100MiB,uuid=${uuid_gpt_"PARTS_QBOOT"};" \ + "name="PARTS_CSC",size=150MiB,uuid=${uuid_gpt_"PARTS_CSC"};" \ + "name="PARTS_ROOT",size=1536MiB,uuid=${uuid_gpt_"PARTS_ROOT"};" \ + "name="PARTS_DATA",size=3000MiB,uuid=${uuid_gpt_"PARTS_DATA"};" \ + "name="PARTS_UMS",size=-,uuid=${uuid_gpt_"PARTS_UMS"}\0" \ + +#define DFU_ALT_SYSTEM_TRATS2 \ + "/uImage ext4 0 2;" \ + "/zImage ext4 0 2;" \ + "/Image.itb ext4 0 2;" \ + "/modem.bin ext4 0 2;" \ + "/exynos4412-trats2.dtb ext4 0 2;" \ + ""PARTS_CSA" part 0 1;" \ + ""PARTS_BOOT" part 0 2;" \ + ""PARTS_QBOOT" part 0 3;" \ + ""PARTS_CSC" part 0 4;" \ + ""PARTS_ROOT" part 0 5;" \ + ""PARTS_DATA" part 0 6;" \ + ""PARTS_UMS" part 0 7;" \ + "params.bin raw 2560 8\0" + +#define DFU_ALT_SYSTEM_ODROID \ + "uImage fat 0 1;" \ + "zImage fat 0 1;" \ + "Image.itb fat 0 1;" \ + "exynos4412-odroidu3.dtb fat 0 1;" \ + "exynos4412-odroidx2.dtb fat 0 1;" \ + ""PARTS_BOOT" part 0 1;" \ + ""PARTS_ROOT" part 0 2;" \ + ""PARTS_DATA" part 0 3;" \ + ""PARTS_UMS" part 0 4;" \ + "params.bin raw 2560 8\0" + +#define DFU_ALT_BOOT_EMMC_TRATS2 \ + "u-boot raw 0x80 0x800\0" + +#define DFU_ALT_BOOT_SD_TRATS2 \ + "This boot mode is not used\0" + +#define DFU_ALT_BOOT_EMMC_ODROID \ + "u-boot raw 0x3e 0x800 mmcpart 1;" \ + "bl1 raw 0x0 0x1e mmcpart 1;" \ + "bl2 raw 0x1e 0x1d mmcpart 1;" \ + "tzsw raw 0x83e 0x138 mmcpart 1\0" + +#define DFU_ALT_BOOT_SD_ODROID \ + "u-boot raw 0x3f 0x800;" \ + "bl1 raw 0x1 0x1e;" \ + "bl2 raw 0x1f 0x1d;" \ + "tzsw raw 0x83f 0x138\0" + +#endif /* _TIZEN_ENVIRONMENT_H_ */ diff --git a/include/configs/tizen.h b/include/configs/tizen.h new file mode 100644 index 0000000..8e3211d --- /dev/null +++ b/include/configs/tizen.h @@ -0,0 +1,247 @@ +/* + * Copyright (C) 2014 Samsung Electronics + * + * Configuration settings for the SAMSUNG EXYNOS5 board. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef __CONFIG_TIZEN_H +#define __CONFIG_TIZEN_H + +#include +#include + +#define CONFIG_SYS_PROMPT "Exynos4412 # " /* Monitor Command Prompt */ + +#undef CONFIG_DEFAULT_DEVICE_TREE +#define CONFIG_DEFAULT_DEVICE_TREE exynos4412-odroid + +#define CONFIG_OF_MULTI +#define CONFIG_FDTDEC_MEMORY + +/* Arch number for Trats2 */ +#define MACH_TYPE_SMDK4412 3765 +/* Arch number for Odroid */ +#define MACH_TYPE_ODROIDX 4289 + +#define CONFIG_SYS_L2CACHE_OFF +#ifndef CONFIG_SYS_L2CACHE_OFF +#define CONFIG_SYS_L2_PL310 +#define CONFIG_SYS_PL310_BASE 0x10502000 +#endif + +#define CONFIG_NR_DRAM_BANKS 8 +#define CONFIG_SYS_SDRAM_BASE 0x40000000 +#define SDRAM_BANK_SIZE (256 << 20) /* 256 MB */ + +#define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + 0x3E00000) +#define CONFIG_SYS_TEXT_BASE 0x43e00000 + + +/* set serial baudrate */ +#define CONFIG_BAUDRATE 115200 + +/* Console configuration */ +#define CONFIG_SYS_CONSOLE_INFO_QUIET +#define CONFIG_SYS_CONSOLE_IS_IN_ENV + +#define CONFIG_CMD_BOOTZ +#define CONFIG_FIT +#define CONFIG_FIT_VERBOSE +#define CONFIG_BOOTARGS "Please use defined boot" +#define CONFIG_BOOTCOMMAND "run autoboot" +#define CONFIG_CONSOLE_TTY1 " console=ttySAC1,115200n8" +#define CONFIG_CONSOLE_TTY2 " console=ttySAC2,115200n8" + +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR \ + - GENERATED_GBL_DATA_SIZE) + +#define CONFIG_SYS_MEM_TOP_HIDE (SZ_1M) /* ram console */ + +#define CONFIG_SYS_MONITOR_BASE 0x00000000 + +#define CONFIG_ENV_IS_IN_MMC +#define CONFIG_SYS_MMC_ENV_DEV CONFIG_MMC_DEFAULT_DEV +#define CONFIG_ENV_SIZE 4096 +#define CONFIG_ENV_OFFSET (SZ_1K * 1280) /* 1.25 MiB offset */ +#define CONFIG_ENV_OVERWRITE + +#define CONFIG_SET_DFU_ALT_INFO +#define CONFIG_SET_DFU_ALT_BUF_LEN SZ_1K + +#define CONFIG_EXTRA_ENV_SETTINGS \ + "loadkernel=load mmc ${mmcbootdev}:${mmcbootpart} ${kerneladdr} " \ + "${kernelname}\0" \ + "loadinitrd=load mmc ${mmcbootdev}:${mmcbootpart} ${initrdaddr} " \ + "${initrdname}\0" \ + "loaddtb=load mmc ${mmcbootdev}:${mmcbootpart} ${fdtaddr} " \ + "${fdtfile}\0" \ + "check_ramdisk=" \ + "if run loadinitrd; then " \ + "setenv initrd_addr ${initrdaddr};" \ + "else " \ + "setenv initrd_addr -;" \ + "fi;\0" \ + "check_dtb=" \ + "if run loaddtb; then " \ + "setenv fdt_addr ${fdtaddr};" \ + "else " \ + "setenv fdt_addr;" \ + "fi;\0" \ + "kernel_args=" \ + "setenv bootargs root=/dev/mmcblk${mmcrootdev}p${mmcrootpart}" \ + " rootwait ${console} ${opts}\0" \ + "checkboard=" \ + "if test ${boardname} = trats2; then " \ + "setenv mmcbootpart 2;" \ + "setenv mmcrootpart 5;" \ + "setenv console" CONFIG_CONSOLE_TTY2";" \ + "else " \ + "setenv mmcbootpart 1;" \ + "setenv mmcrootpart 2;" \ + "setenv console" CONFIG_CONSOLE_TTY1";" \ + "fi;\0" \ + "boot_fit=" \ + "setenv kerneladdr 0x42000000;" \ + "setenv kernelname Image.itb;" \ + "run loadkernel;" \ + "run kernel_args;" \ + "bootm ${kerneladdr}#${boardname}\0" \ + "boot_uimg=" \ + "setenv kerneladdr 0x40007FC0;" \ + "setenv kernelname uImage;" \ + "run check_dtb;" \ + "run check_ramdisk;" \ + "run loadkernel;" \ + "run kernel_args;" \ + "bootm ${kerneladdr} ${initrd_addr} ${fdt_addr};\0" \ + "boot_zimg=" \ + "setenv kerneladdr 0x40007FC0;" \ + "setenv kernelname zImage;" \ + "run check_dtb;" \ + "run check_ramdisk;" \ + "run loadkernel;" \ + "run kernel_args;" \ + "bootz ${kerneladdr} ${initrd_addr} ${fdt_addr};\0" \ + "autoboot=" \ + "run checkboard;" \ + "if test -e mmc 0:${mmcbootpart} Image.itb; then; " \ + "run boot_fit;" \ + "elif test -e mmc 0:${mmcbootpart} zImage; then; " \ + "run boot_zimg;" \ + "elif test -e mmc 0:${mmcbootpart} uImage; then; " \ + "run boot_uimg;" \ + "fi;\0" \ + "mmcbootdev=0\0" \ + "mmcrootdev=0\0" \ + "bootdelay=0\0" \ + "dfu_alt_info=Please reset the board.\0" \ + "consoleon=set console console=ttySAC1,115200n8; save; reset\0" \ + "consoleoff=set console console=ram; save; reset\0" \ + "initrdname=uInitrd\0" \ + "initrdaddr=42000000\0" \ + "fdtaddr=40800000\0" + +/* I2C */ +#include + +#define CONFIG_CMD_I2C + +#define CONFIG_SYS_I2C +#define CONFIG_SYS_I2C_S3C24X0 +#define CONFIG_SYS_I2C_S3C24X0_SPEED 100000 +#define CONFIG_SYS_I2C_S3C24X0_SLAVE 0 +#define CONFIG_MAX_I2C_NUM 8 +#define CONFIG_SYS_I2C_SOFT +#define CONFIG_SYS_I2C_SOFT_SPEED 50000 +#define CONFIG_SYS_I2C_SOFT_SLAVE 0x00 +#define I2C_SOFT_DECLARATIONS2 +#define CONFIG_SYS_I2C_SOFT_SPEED_2 50000 +#define CONFIG_SYS_I2C_SOFT_SLAVE_2 0x00 +#define CONFIG_SOFT_I2C_READ_REPEATED_START +#define CONFIG_SYS_I2C_INIT_BOARD + +#ifndef __ASSEMBLY__ +int get_soft_i2c_scl_pin(void); +int get_soft_i2c_sda_pin(void); +#endif +#define CONFIG_SOFT_I2C_GPIO_SCL get_soft_i2c_scl_pin() +#define CONFIG_SOFT_I2C_GPIO_SDA get_soft_i2c_sda_pin() + +/* POWER */ +#define CONFIG_POWER +#define CONFIG_POWER_I2C +#define CONFIG_POWER_MAX77686 +#define CONFIG_POWER_PMIC_MAX77693 +#define CONFIG_POWER_MUIC_MAX77693 +#define CONFIG_POWER_FG_MAX77693 +#define CONFIG_POWER_BATTERY_TRATS2 +#define CONFIG_CMD_POWEROFF + +/* GPT */ +#define CONFIG_RANDOM_UUID + +/* Security subsystem - enable hw_rand() */ +#define CONFIG_EXYNOS_ACE_SHA +#define CONFIG_LIB_HW_RAND + +#define CONFIG_CMD_GPIO + +/* + * Supported Odroid boards: X3, U3 + * TODO: Add Odroid X support + */ +#define CONFIG_MISC_COMMON +#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG +#define CONFIG_BOARD_TYPES +#define CONFIG_MISC_INIT_R +#undef CONFIG_REVISION_TAG + +#define CONFIG_TIZEN +#define CONFIG_SIG + +/* Charge battery with interactive LCD animation */ +#define CONFIG_INTERACTIVE_CHARGER +#define CONFIG_CMD_BATTERY + +/* Download menu - Samsung common */ +#define CONFIG_LCD_MENU +#define CONFIG_LCD_MENU_BOARD + +/* + * Download menu - definitions for check keys + * This is valid only for Trats2 and will be reworked + */ +#ifndef __ASSEMBLY__ +#include + +#define KEY_PWR_PMIC_NAME "MAX77686_PMIC" +#define KEY_PWR_STATUS_REG MAX77686_REG_PMIC_STATUS1 +#define KEY_PWR_STATUS_MASK (1 << 0) +#define KEY_PWR_INTERRUPT_REG MAX77686_REG_PMIC_INT1 +#define KEY_PWR_INTERRUPT_MASK (1 << 1) + +#define KEY_VOL_UP_GPIO EXYNOS4X12_GPIO_X22 +#define KEY_VOL_DOWN_GPIO EXYNOS4X12_GPIO_X33 +#endif /* __ASSEMBLY__ */ + +/* LCD console */ +#define LCD_BPP LCD_COLOR16 +#define CONFIG_SYS_WHITE_ON_BLACK + +/* LCD */ +#define CONFIG_EXYNOS_FB +#define CONFIG_LCD +#define CONFIG_CMD_BMP +#define CONFIG_BMP_16BPP +#define CONFIG_FB_ADDR 0x52504000 +#define CONFIG_S6E8AX0 +#define CONFIG_EXYNOS_MIPI_DSIM +#define CONFIG_VIDEO_BMP_GZIP +#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE ((500 * 160 * 4) + 54) + +#define LCD_XRES 720 +#define LCD_YRES 1280 + +#endif /* __CONFIG_H */ -- 2.7.4