Skip to contentSkip to conversation

Trats2 code cleanups

PATCH New Piotr Wilczek 2 participants 6 messages Nov 27, 2013 – Dec 3, 2013

lore
Share & tools
lore
#0 lore raw

cover Trats2 code cleanups

This patch series cleanups some code for Trats2.

Unused defines are removed.
For envs, hardcoded names are replaced with variable names. In the board file, 'samsung_get_base' common functions are used. Tizen partions layout is updated.

This patch series is based on:
http://patchwork.ozlabs.org/patch/290667/
http://patchwork.ozlabs.org/patch/293163/
http://patchwork.ozlabs.org/patch/293162/

Piotr Wilczek (4):
board: trats2: remove unused defines from config file board:trats2: fix config
board:trats2: fix access to samsung registers board:trats2: update Tizen partition definitions

 board/samsung/trats2/trats2.c |   16 ++++++++--------
 include/configs/trats2.h      |   28 +++++++++++-----------------
 2 files changed, 19 insertions(+), 25 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/4 board: trats2: remove unused defines from config file

---
 include/configs/trats2.h |    4 ----
 1 file changed, 4 deletions(-)
include/configs/trats2.h +0 -4
index bf49dd5..8de41ff 100644
@@ -20,8 +20,6 @@
 #define CONFIG_EXYNOS4		/* which is in a EXYNOS4XXX */
 #define CONFIG_TIZEN		/* TIZEN lib */
 
-#define PLATFORM_NO_UNALIGNED
-
 #include <asm/arch/cpu.h>		/* get chip and board defs */
 
 #define CONFIG_ARCH_CPU_INIT
@@ -257,8 +255,6 @@
 #define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_LOAD_ADDR \
 					- GENERATED_GBL_DATA_SIZE)
 
-#define CONFIG_SYS_HZ			1000
-
 /* valid baudrates */
 #define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, 115200 }
 
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/4 board:trats2: fix environmental variables

In reply to Piotr Wilczek

In this patch variable names are used instead of hardcoded names

---
 include/configs/trats2.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
include/configs/trats2.h +3 -3
index 8de41ff..9a90941 100644
@@ -199,11 +199,11 @@
 	"rootfstype=ext4\0" \
 	"console=" CONFIG_DEFAULT_CONSOLE \
 	"kernelname=uImage\0" \
-	"loaduimage=ext4load mmc ${mmcdev}:${mmcbootpart} 0x40007FC0 uImage\0" \
-		"0x40007FC0 ${kernelname}\0" \
+	"loaduimage=ext4load mmc ${mmcdev}:${mmcbootpart} 0x40007FC0 " \
+		"${kernelname}\0" \
 	"loaddtb=ext4load mmc ${mmcdev}:${mmcbootpart} ${fdtaddr} " \
 		"${fdtfile}\0" \
-	"mmcdev=0\0" \
+	"mmcdev=CONFIG_MMC_DEFAULT_DEV\0" \
 	"mmcbootpart=2\0" \
 	"mmcrootpart=5\0" \
 	"opts=always_resume=1\0" \
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH 3/4 board:trats2: fix access to samsung registers

In reply to Piotr Wilczek

This patch use 'samsung_get_base' common functions to access registers.

---
 board/samsung/trats2/trats2.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
board/samsung/trats2/trats2.c +8 -8
index b932a60..9552522 100644
@@ -43,7 +43,7 @@ static void check_hw_revision(void)
 	int modelrev = 0;
 	int i;
 
-	gpio2 = (struct exynos4x12_gpio_part2 *)EXYNOS4X12_GPIO_PART2_BASE;
+	gpio2 = (struct exynos4x12_gpio_part2 *)samsung_get_base_gpio_part2();
 
 	/*
 	 * GPM1[1:0]: MODEL_REV[1:0]
@@ -93,7 +93,7 @@ static inline u32 get_model_rev(void)
 
 static void board_external_gpio_init(void)
 {
-	gpio2 = (struct exynos4x12_gpio_part2 *)EXYNOS4X12_GPIO_PART2_BASE;
+	gpio2 = (struct exynos4x12_gpio_part2 *)samsung_get_base_gpio_part2();
 
 	/*
 	 * some pins which in alive block are connected with external pull-up
@@ -118,8 +118,8 @@ static void board_external_gpio_init(void)
 #ifdef CONFIG_SYS_I2C_INIT_BOARD
 static void board_init_i2c(void)
 {
-	gpio1 = (struct exynos4x12_gpio_part1 *)EXYNOS4X12_GPIO_PART1_BASE;
-	gpio2 = (struct exynos4x12_gpio_part2 *)EXYNOS4X12_GPIO_PART2_BASE;
+	gpio1 = (struct exynos4x12_gpio_part1 *)samsung_get_base_gpio_part1();
+	gpio2 = (struct exynos4x12_gpio_part2 *)samsung_get_base_gpio_part2();
 
 	/* I2C_7 */
 	s5p_gpio_direction_output(&gpio1->d0, 2, 1);
@@ -150,7 +150,7 @@ static int pmic_init_max77686(void);
 int board_init(void)
 {
 	struct exynos4_power *pwr =
-		(struct exynos4_power *)EXYNOS4X12_POWER_BASE;
+		(struct exynos4_power *)samsung_get_base_power();
 
 	gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
 
@@ -257,7 +257,7 @@ int board_mmc_init(bd_t *bis)
 {
 	int err0, err2 = 0;
 
-	gpio2 = (struct exynos4x12_gpio_part2 *)EXYNOS4X12_GPIO_PART2_BASE;
+	gpio2 = (struct exynos4x12_gpio_part2 *)samsung_get_base_gpio_part2();
 
 	/* eMMC_EN: SD_0_CDn: GPK0[2] Output High */
 	s5p_gpio_direction_output(&gpio2->k0, 2, 1);
@@ -513,7 +513,7 @@ void exynos_lcd_power_on(void)
 {
 	struct pmic *p = pmic_get("MAX77686_PMIC");
 
-	gpio1 = (struct exynos4x12_gpio_part1 *)EXYNOS4X12_GPIO_PART1_BASE;
+	gpio1 = (struct exynos4x12_gpio_part1 *)samsung_get_base_gpio_part1();
 
 	/* LCD_2.2V_EN: GPC0[1] */
 	s5p_gpio_set_pull(&gpio1->c0, 1, GPIO_PULL_UP);
@@ -527,7 +527,7 @@ void exynos_lcd_power_on(void)
 
 void exynos_reset_lcd(void)
 {
-	gpio1 = (struct exynos4x12_gpio_part1 *)EXYNOS4X12_GPIO_PART1_BASE;
+	gpio1 = (struct exynos4x12_gpio_part1 *)samsung_get_base_gpio_part1();
 
 	/* reset lcd */
 	s5p_gpio_direction_output(&gpio1->f2, 1, 0);
Signature · 1 line
1.7.9.5
#4 lore raw

PATCH 4/4 board:trats2: update Tizen partition definitions

In reply to Piotr Wilczek

This patch updates Tizen partions layout.

---
 include/configs/trats2.h |   18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)
include/configs/trats2.h +8 -10
index 9a90941..c49a969e 100644
@@ -151,23 +151,21 @@
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
 
 /* Tizen - partitions definitions */
-#define PARTS_CSA		"csa-mmc"
-#define PARTS_BOOTLOADER	"u-boot"
+#define PARTS_CSA		"csa"
 #define PARTS_BOOT		"boot"
+#define PARTS_MODEM		"modem"
+#define PARTS_CSC		"csc"
 #define PARTS_ROOT		"platform"
 #define PARTS_DATA		"data"
-#define PARTS_CSC		"csc"
 #define PARTS_UMS		"ums"
 
 #define PARTS_DEFAULT \
-	"uuid_disk=${uuid_gpt_disk};" \
-	"name="PARTS_CSA",size=8MiB,uuid=${uuid_gpt_"PARTS_CSA"};" \
-	"name="PARTS_BOOTLOADER",size=60MiB," \
-		"uuid=${uuid_gpt_"PARTS_BOOTLOADER"};" \
-	"name="PARTS_BOOT",size=100MiB,uuid=${uuid_gpt_"PARTS_BOOT"};" \
-	"name="PARTS_ROOT",size=1GiB,uuid=${uuid_gpt_"PARTS_ROOT"};" \
-	"name="PARTS_DATA",size=3GiB,uuid=${uuid_gpt_"PARTS_DATA"};" \
+	"name="PARTS_CSA",start=5MiB,size=8MiB,uuid=${uuid_gpt_"PARTS_CSA"};" \
+	"name="PARTS_BOOT",size=64MiB,uuid=${uuid_gpt_"PARTS_BOOT"};" \
+	"name="PARTS_MODEM",size=100MiB,uuid=${uuid_gpt_"PARTS_MODEM"};" \
 	"name="PARTS_CSC",size=150MiB,uuid=${uuid_gpt_"PARTS_CSC"};" \
+	"name="PARTS_ROOT",size=1536MiB,uuid=${uuid_gpt_"PARTS_ROOT"};" \
+	"name="PARTS_DATA",size=512MiB,uuid=${uuid_gpt_"PARTS_DATA"};" \
 	"name="PARTS_UMS",size=-,uuid=${uuid_gpt_"PARTS_UMS"}\0" \
 
 #define CONFIG_DFU_ALT \
Signature · 1 line
1.7.9.5
#5 lore raw

cover Trats2 code cleanups

In reply to Piotr Wilczek
Quoted 18 lines · Piotr Wilczek

This patch series cleanups some code for Trats2.

Unused defines are removed.
For envs, hardcoded names are replaced with variable names. In the board file, 'samsung_get_base' common functions are used. Tizen partions layout is updated.

This patch series is based on:
http://patchwork.ozlabs.org/patch/290667/
http://patchwork.ozlabs.org/patch/293163/
http://patchwork.ozlabs.org/patch/293162/

Piotr Wilczek (4):
board: trats2: remove unused defines from config file board:trats2: fix config
board:trats2: fix access to samsung registers board:trats2: update Tizen partition definitions

Quoted 4 lines
 board/samsung/trats2/trats2.c |   16 ++++++++--------
 include/configs/trats2.h      |   28 +++++++++++-----------------
 2 files changed, 19 insertions(+), 25 deletions(-)

applied to u-boot-samsung.

Thanks,
Minkyu Kang.