Minimal S5PV210 support
Subsystems (7)
This is minimal working Samsung S5PV210 CPU support and very minimal example Tiny210 board support. No working MMC or NAND drivers yet.
It is able to start from MMC using iROM, can blink LEDs and has working command-line. It has working DRAM and clock initialization. Also there is BL1 file cooker.
The checksummed image is named barebox.s5p and should be dd-ed from 1st 512-byte sector of an MMC card.
TODO: add S5P NAND driver, add MMC driver.
TODO: get rid of iROM booting.
TODO: support USB and DM9000 in Tiny210.
The following changes since commit c7c32736bcd428ef146fa49846defaeff0679fdb:
i2c: Fix barebox crash when 'count' is not set for i2c_read command
(2012-05-11 20:12:19 +0200)
are available in the git repository at:
git://github.com/agalakhov/barebox.git master
for you to fetch changes up to 1a50adbbea14a995e14301725b969680410a3f24:
S5P boot header and image generator (2012-05-12 22:08:58 +0600)
----------------------------------------------------------------
Alexey Galakhov (9):
Support most Samsung SoCs in S3C serial driver Fine split S3C arch dependencies from generic code Minimal S5PV210 + Tiny210 support (2nd stage only) S5PV210 iROM magic boot code
S5P DRAM support
S5P lowlevel clock init
Revert "S5PV210 iROM magic boot code"
S5P iROM boot support - improved
S5P boot header and image generator
.gitignore | 2 +
arch/arm/Kconfig | 6 +
arch/arm/Makefile | 8 +
arch/arm/boards/a9m2410/a9m2410.c | 10 +-
arch/arm/boards/a9m2410/config.h | 2 +-
arch/arm/boards/a9m2410/lowlevel_init.S | 2 +-
arch/arm/boards/a9m2440/a9m2410dev.c | 2 +-
arch/arm/boards/a9m2440/a9m2440.c | 10 +-
arch/arm/boards/a9m2440/config.h | 2 +-
arch/arm/boards/a9m2440/lowlevel_init.S | 4 +-
arch/arm/boards/mini2440/config.h | 2 +-
arch/arm/boards/mini2440/lowlevel_init.S | 2 +-
arch/arm/boards/mini2440/mini2440.c | 10 +-
arch/arm/boards/tiny210/Makefile | 1 +
arch/arm/boards/tiny210/config.h | 23 +
arch/arm/boards/tiny210/lowlevel.c | 58 ++
arch/arm/boards/tiny210/tiny210.c | 113 +++
arch/arm/configs/a9m2410_defconfig | 2 +-
arch/arm/configs/a9m2440_defconfig | 4 +-
arch/arm/configs/mini2440_defconfig | 2 +-
arch/arm/mach-samsung/Kconfig | 63 +-
arch/arm/mach-samsung/Makefile | 8 +-
.../{s3c24xx-clocks.c => clocks-s3c24x0.c} | 17 +
arch/arm/mach-samsung/clocks-s5pcxx.c | 98 +++
arch/arm/mach-samsung/generic.c | 112 ---
arch/arm/mach-samsung/gpio-s3c24x0.c | 2 +-
arch/arm/mach-samsung/gpio-s5pcxx.c | 123 +++
.../arm/mach-samsung/include/mach/clocks-s3c24x0.h | 24 +
arch/arm/mach-samsung/include/mach/clocks-s5pcxx.h | 55 ++
.../mach/{s3c24xx-gpio.h => gpio-s3c24x0.h} | 6 +-
arch/arm/mach-samsung/include/mach/gpio.h | 3 +
arch/arm/mach-samsung/include/mach/iomap-s3c24x0.h | 69 ++
arch/arm/mach-samsung/include/mach/iomap-s5pcxx.h | 52 ++
arch/arm/mach-samsung/include/mach/iomux-s5pcxx.h | 798
++++++++++++++++++++
.../mach/{s3c24xx-nand.h => nand-s3c24x0.h} | 4 +-
arch/arm/mach-samsung/include/mach/s3c-clocks.h | 25 +-
arch/arm/mach-samsung/include/mach/s3c-generic.h | 13 +-
arch/arm/mach-samsung/include/mach/s3c-iomap.h | 56 +-
arch/arm/mach-samsung/include/mach/s5pcxx-irom.h | 32 +
.../{lowlevel-init.S => lowlevel-s3c24x0.S} | 12 +-
arch/arm/mach-samsung/lowlevel-s5pcxx.c | 61 ++
arch/arm/mach-samsung/mem-s3c24x0.c | 143 ++++
arch/arm/mach-samsung/mem-s5pcxx.c | 260 +++++++
arch/arm/mach-samsung/s5p-irom-boot.c | 59 ++
drivers/mtd/nand/nand_s3c24xx.c | 16 +-
drivers/serial/Kconfig | 2 +-
drivers/serial/serial_s3c.c | 55 +-
scripts/Makefile | 1 +
scripts/s5p_cksum.c | 140 ++++
49 files changed, 2319 insertions(+), 255 deletions(-)
create mode 100644 arch/arm/boards/tiny210/Makefile
create mode 100644 arch/arm/boards/tiny210/config.h
create mode 100644 arch/arm/boards/tiny210/lowlevel.c
create mode 100644 arch/arm/boards/tiny210/tiny210.c
rename arch/arm/mach-samsung/{s3c24xx-clocks.c => clocks-s3c24x0.c} (91%)
create mode 100644 arch/arm/mach-samsung/clocks-s5pcxx.c
create mode 100644 arch/arm/mach-samsung/gpio-s5pcxx.c
create mode 100644 arch/arm/mach-samsung/include/mach/clocks-s3c24x0.h
create mode 100644 arch/arm/mach-samsung/include/mach/clocks-s5pcxx.h
rename arch/arm/mach-samsung/include/mach/{s3c24xx-gpio.h =>
gpio-s3c24x0.h} (96%)
create mode 100644 arch/arm/mach-samsung/include/mach/iomap-s3c24x0.h
create mode 100644 arch/arm/mach-samsung/include/mach/iomap-s5pcxx.h
create mode 100644 arch/arm/mach-samsung/include/mach/iomux-s5pcxx.h
rename arch/arm/mach-samsung/include/mach/{s3c24xx-nand.h =>
nand-s3c24x0.h} (95%)
create mode 100644 arch/arm/mach-samsung/include/mach/s5pcxx-irom.h
rename arch/arm/mach-samsung/{lowlevel-init.S => lowlevel-s3c24x0.S} (96%)
create mode 100644 arch/arm/mach-samsung/lowlevel-s5pcxx.c
create mode 100644 arch/arm/mach-samsung/mem-s3c24x0.c
create mode 100644 arch/arm/mach-samsung/mem-s5pcxx.c
create mode 100644 arch/arm/mach-samsung/s5p-irom-boot.c
create mode 100644 scripts/s5p_cksum.c_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Hi Alexey,
Quoted 27 lines · Alexey Galakhov
This is minimal working Samsung S5PV210 CPU support and very minimal example Tiny210 board support. No working MMC or NAND drivers yet.
It is able to start from MMC using iROM, can blink LEDs and has working command-line. It has working DRAM and clock initialization. Also there is BL1 file cooker.
The checksummed image is named barebox.s5p and should be dd-ed from 1st 512-byte sector of an MMC card.
TODO: add S5P NAND driver, add MMC driver.
TODO: get rid of iROM booting.
TODO: support USB and DM9000 in Tiny210.The following changes since commit
c7c32736bcd428ef146fa49846defaeff0679fdb:i2c: Fix barebox crash when 'count' is not set for
i2c_readcommand
(2012-05-11 20:12:19 +0200)are available in the git repository at:
git://github.com/agalakhov/barebox.gitmasterfor you to fetch changes up to
1a50adbbea14a995e14301725b969680410a3f24:S5P boot header and image generator (2012-05-12 22:08:58 +0600)
Quoted 11 lines
----------------------------------------------------------------
Alexey Galakhov (9):
Support most Samsung SoCs in S3C serial driver Fine split S3C arch dependencies from generic code Minimal S5PV210 + Tiny210 support (2nd stage only) S5PV210 iROM magic boot code
S5P DRAM support
S5P lowlevel clock init
Revert "S5PV210 iROM magic boot code"
S5P iROM boot support - improved
S5P boot header and image generator
I can't see these patches on the list. Can you post them first? Otherwise I can't pull this series.
Thanks
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
cover Minimal S5PV210 support
This is minimal working Samsung S5PV210 CPU support and very minimal example Tiny210 board support. No working MMC or NAND drivers yet.
It is able to start from MMC using iROM, can blink LEDs and has working command-line. It has working DRAM and clock initialization. Also there is BL1 file cooker.
The checksummed image is named barebox.s5p and should be dd-ed from 1st 512-byte sector of an MMC card.
TODO: add S5P NAND driver, add MMC driver.
TODO: get rid of iROM booting.
TODO: support USB and DM9000 in Tiny210.
Alexey Galakhov (9):
Support most Samsung SoCs in S3C serial driver Fine split S3C arch dependencies from generic code Minimal S5PV210 + Tiny210 support (2nd stage only) S5PV210 iROM magic boot code
S5P DRAM support
S5P lowlevel clock init
Revert "S5PV210 iROM magic boot code"
S5P iROM boot support - improved
S5P boot header and image generator
.gitignore | 2 + arch/arm/Kconfig | 6 + arch/arm/Makefile | 8 + arch/arm/boards/a9m2410/a9m2410.c | 10 +- arch/arm/boards/a9m2410/config.h | 2 +- arch/arm/boards/a9m2410/lowlevel_init.S | 2 +- arch/arm/boards/a9m2440/a9m2410dev.c | 2 +- arch/arm/boards/a9m2440/a9m2440.c | 10 +- arch/arm/boards/a9m2440/config.h | 2 +- arch/arm/boards/a9m2440/lowlevel_init.S | 4 +- arch/arm/boards/mini2440/config.h | 2 +- arch/arm/boards/mini2440/lowlevel_init.S | 2 +- arch/arm/boards/mini2440/mini2440.c | 10 +- arch/arm/boards/tiny210/Makefile | 1 + arch/arm/boards/tiny210/config.h | 23 + arch/arm/boards/tiny210/lowlevel.c | 58 ++ arch/arm/boards/tiny210/tiny210.c | 113 +++ arch/arm/configs/a9m2410_defconfig | 2 +- arch/arm/configs/a9m2440_defconfig | 4 +- arch/arm/configs/mini2440_defconfig | 2 +- arch/arm/mach-samsung/Kconfig | 63 +- arch/arm/mach-samsung/Makefile | 8 +- arch/arm/mach-samsung/clocks-s3c24x0.c | 157 ++++ arch/arm/mach-samsung/clocks-s5pcxx.c | 98 +++ arch/arm/mach-samsung/generic.c | 112 --- arch/arm/mach-samsung/gpio-s3c24x0.c | 2 +- arch/arm/mach-samsung/gpio-s5pcxx.c | 123 +++ .../arm/mach-samsung/include/mach/clocks-s3c24x0.h | 24 + arch/arm/mach-samsung/include/mach/clocks-s5pcxx.h | 55 ++ arch/arm/mach-samsung/include/mach/gpio-s3c24x0.h | 77 ++ arch/arm/mach-samsung/include/mach/gpio.h | 3 + arch/arm/mach-samsung/include/mach/iomap-s3c24x0.h | 69 ++ arch/arm/mach-samsung/include/mach/iomap-s5pcxx.h | 52 ++ arch/arm/mach-samsung/include/mach/iomux-s5pcxx.h | 798 ++++++++++++++++++++ arch/arm/mach-samsung/include/mach/nand-s3c24x0.h | 54 ++ arch/arm/mach-samsung/include/mach/s3c-clocks.h | 25 +- arch/arm/mach-samsung/include/mach/s3c-generic.h | 13 +- arch/arm/mach-samsung/include/mach/s3c-iomap.h | 56 +- arch/arm/mach-samsung/include/mach/s3c24xx-gpio.h | 77 -- arch/arm/mach-samsung/include/mach/s3c24xx-nand.h | 54 -- arch/arm/mach-samsung/include/mach/s5pcxx-irom.h | 32 + arch/arm/mach-samsung/lowlevel-init.S | 317 -------- arch/arm/mach-samsung/lowlevel-s3c24x0.S | 317 ++++++++ arch/arm/mach-samsung/lowlevel-s5pcxx.c | 61 ++ arch/arm/mach-samsung/mem-s3c24x0.c | 143 ++++ arch/arm/mach-samsung/mem-s5pcxx.c | 260 +++++++ arch/arm/mach-samsung/s3c24xx-clocks.c | 140 ---- arch/arm/mach-samsung/s5p-irom-boot.c | 59 ++ drivers/mtd/nand/nand_s3c24xx.c | 16 +- drivers/serial/Kconfig | 2 +- drivers/serial/serial_s3c.c | 55 +- scripts/Makefile | 1 + scripts/s5p_cksum.c | 140 ++++ 53 files changed, 2896 insertions(+), 832 deletions(-) create mode 100644 arch/arm/boards/tiny210/Makefile create mode 100644 arch/arm/boards/tiny210/config.h create mode 100644 arch/arm/boards/tiny210/lowlevel.c create mode 100644 arch/arm/boards/tiny210/tiny210.c create mode 100644 arch/arm/mach-samsung/clocks-s3c24x0.c create mode 100644 arch/arm/mach-samsung/clocks-s5pcxx.c create mode 100644 arch/arm/mach-samsung/gpio-s5pcxx.c create mode 100644 arch/arm/mach-samsung/include/mach/clocks-s3c24x0.h create mode 100644 arch/arm/mach-samsung/include/mach/clocks-s5pcxx.h create mode 100644 arch/arm/mach-samsung/include/mach/gpio-s3c24x0.h create mode 100644 arch/arm/mach-samsung/include/mach/iomap-s3c24x0.h create mode 100644 arch/arm/mach-samsung/include/mach/iomap-s5pcxx.h create mode 100644 arch/arm/mach-samsung/include/mach/iomux-s5pcxx.h create mode 100644 arch/arm/mach-samsung/include/mach/nand-s3c24x0.h delete mode 100644 arch/arm/mach-samsung/include/mach/s3c24xx-gpio.h delete mode 100644 arch/arm/mach-samsung/include/mach/s3c24xx-nand.h create mode 100644 arch/arm/mach-samsung/include/mach/s5pcxx-irom.h delete mode 100644 arch/arm/mach-samsung/lowlevel-init.S create mode 100644 arch/arm/mach-samsung/lowlevel-s3c24x0.S create mode 100644 arch/arm/mach-samsung/lowlevel-s5pcxx.c create mode 100644 arch/arm/mach-samsung/mem-s3c24x0.c create mode 100644 arch/arm/mach-samsung/mem-s5pcxx.c delete mode 100644 arch/arm/mach-samsung/s3c24xx-clocks.c create mode 100644 arch/arm/mach-samsung/s5p-irom-boot.c create mode 100644 scripts/s5p_cksum.c
Signature · 7 lines
1.7.10 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 1/9 Support most Samsung SoCs in S3C serial driver
--- arch/arm/mach-samsung/include/mach/s3c-generic.h | 4 ++ arch/arm/mach-samsung/s3c24xx-clocks.c | 17 +++++++ drivers/serial/serial_s3c.c | 55 +++++++++++++++------- 3 files changed, 59 insertions(+), 17 deletions(-)
arch/arm/mach-samsung/include/mach/s3c-generic.h +4 -0
@@ -30,5 +30,9 @@ uint32_t s3c_get_fclk(void);uint32_t s3c_get_hclk (void );uint32_t s3c_get_pclk (void );uint32_t s3c_get_uclk (void ); + +unsigned s3c_get_uart_clk (unsigned src); +uint32_t s3c24xx_get_memory_size (void ); +void s3c24xx_disable_second_sdram_bank (void );
arch/arm/mach-samsung/s3c24xx-clocks.c +17 -0
@@ -117,6 +117,23 @@ uint32_t s3c24_get_uclk(void)return s3c_get_upllclk (); } +/** +* Return correct UART frequency based on the UCON register +*/ +unsigned s3c_get_uart_clk (unsigned src) +{ +switch (src &3 ) { +case 0 : +case 2 : +return s3c_get_pclk (); +case 1 : +return 0 ;/* TODO UEXTCLK */ +case 3 : +return 0 ;/* TODO FCLK/n */ + } +return 0 ;/* not reached, to make compiler happy */ +} +/** * Show the user the current clock settings */
drivers/serial/serial_s3c.c +38 -17
81 lines not on this page · raw message
Signature · 7 lines
1.7.10 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 2/9 Fine split S3C arch dependencies from generic code
In reply to Alexey Galakhov--- arch/arm/boards/a9m2410/a9m2410.c | 10 +- arch/arm/boards/a9m2410/config.h | 2 +- arch/arm/boards/a9m2410/lowlevel_init.S | 2 +- arch/arm/boards/a9m2440/a9m2410dev.c | 2 +- arch/arm/boards/a9m2440/a9m2440.c | 10 +- arch/arm/boards/a9m2440/config.h | 2 +- arch/arm/boards/a9m2440/lowlevel_init.S | 4 +- arch/arm/boards/mini2440/config.h | 2 +- arch/arm/boards/mini2440/lowlevel_init.S | 2 +- arch/arm/boards/mini2440/mini2440.c | 10 +- arch/arm/configs/a9m2410_defconfig | 2 +- arch/arm/configs/a9m2440_defconfig | 4 +- arch/arm/configs/mini2440_defconfig | 2 +- arch/arm/mach-samsung/Kconfig | 30 +- arch/arm/mach-samsung/Makefile | 5 +- arch/arm/mach-samsung/clocks-s3c24x0.c | 157 ++++++++++ arch/arm/mach-samsung/generic.c | 112 ------- arch/arm/mach-samsung/gpio-s3c24x0.c | 2 +- .../arm/mach-samsung/include/mach/clocks-s3c24x0.h | 24 ++ arch/arm/mach-samsung/include/mach/gpio-s3c24x0.h | 77 +++++ arch/arm/mach-samsung/include/mach/iomap-s3c24x0.h | 69 +++++ arch/arm/mach-samsung/include/mach/nand-s3c24x0.h | 54 ++++ arch/arm/mach-samsung/include/mach/s3c-clocks.h | 22 +- arch/arm/mach-samsung/include/mach/s3c-generic.h | 4 +- arch/arm/mach-samsung/include/mach/s3c-iomap.h | 53 +--- arch/arm/mach-samsung/include/mach/s3c24xx-gpio.h | 77 ----- arch/arm/mach-samsung/include/mach/s3c24xx-nand.h | 54 ---- arch/arm/mach-samsung/lowlevel-init.S | 317 -------------------- arch/arm/mach-samsung/lowlevel-s3c24x0.S | 317 ++++++++++++++++++++ arch/arm/mach-samsung/mem-s3c24x0.c | 143 +++++++++ arch/arm/mach-samsung/s3c24xx-clocks.c | 157 ---------- drivers/mtd/nand/nand_s3c24xx.c | 16 +- drivers/serial/Kconfig | 2 +- 33 files changed, 913 insertions(+), 833 deletions(-) create mode 100644 arch/arm/mach-samsung/clocks-s3c24x0.c create mode 100644 arch/arm/mach-samsung/include/mach/clocks-s3c24x0.h create mode 100644 arch/arm/mach-samsung/include/mach/gpio-s3c24x0.h create mode 100644 arch/arm/mach-samsung/include/mach/iomap-s3c24x0.h create mode 100644 arch/arm/mach-samsung/include/mach/nand-s3c24x0.h delete mode 100644 arch/arm/mach-samsung/include/mach/s3c24xx-gpio.h delete mode 100644 arch/arm/mach-samsung/include/mach/s3c24xx-nand.h delete mode 100644 arch/arm/mach-samsung/lowlevel-init.S create mode 100644 arch/arm/mach-samsung/lowlevel-s3c24x0.S create mode 100644 arch/arm/mach-samsung/mem-s3c24x0.c delete mode 100644 arch/arm/mach-samsung/s3c24xx-clocks.c
arch/arm/boards/a9m2410/a9m2410.c +5 -5
@@ -33,10 +33,10 @@#include <nand.h> #include <io.h> #include <mach/s3c-iomap.h> -#include <mach/s3c24xx-nand.h> +#include <mach/nand-s3c24x0.h> #include <mach/s3c-generic.h> #include <mach/s3c-busctl.h> -#include <mach/s3c24xx-gpio.h> +#include <mach/gpio-s3c24x0.h> // {"NAND 1MiB 3,3V 8-bit", 0xec, 256, 1, 0x1000, 0}, static struct s3c24x0_nand_platform_data nand_info = {
@@ -51,7 +51,7 @@ static int a9m2410_mem_init(void)* Note: On this card the second SDRAM page is not used */ s3c24xx_disable_second_sdram_bank (); - size =s3c24xx_get_memory_size (); + size =s3c_get_memory_size ();/* ---------- configure the GPIOs ------------- */ writel (0x007FFFFF ,S3C_GPACON );
@@ -136,10 +136,10 @@ static int a9m2410_devices_init(void)device_initcall (a9m2410_devices_init); -#ifdef CONFIG_S3C24XX_NAND_BOOT +#ifdef CONFIG_S3C_NAND_BOOT void __bare_init nand_boot(void) { -s3c24x0_nand_load_image ((void *)TEXT_BASE ,256 *1024 ,0 ); +s3c_nand_load_image ((void *)TEXT_BASE ,256 *1024 ,0 ); }#endif
arch/arm/boards/a9m2410/config.h +1 -1
@@ -115,7 +115,7 @@#define A9M2410_TWRPH1 1/* needed in the generic NAND boot code only */ -#ifdef CONFIG_S3C24XX_NAND_BOOT +#ifdef CONFIG_S3C_NAND_BOOT # define BOARD_DEFAULT_NAND_TIMING CALC_NFCONF_TIMING(A9M2410_TACLS, A9M2410_TWRPH0, A9M2410_TWRPH1)#endif
arch/arm/boards/a9m2410/lowlevel_init.S +1 -1
@@ -28,7 +28,7 @@ board_init_lowlevel: bl s3c24x0_sdram_init -#ifdef CONFIG_S3C24XX_NAND_BOOT +#ifdef CONFIG_S3C_NAND_BOOT mov lr, r10 /* restore the link register */ /* up to here we are running from the internal SRAM area */ b s3c24x0_nand_boot /* does return directly to our caller into SDRAM */
arch/arm/boards/a9m2440/a9m2410dev.c +1 -1
@@ -30,7 +30,7 @@#include <io.h> #include <mach/s3c-iomap.h> #include <mach/s3c-busctl.h> -#include <mach/s3c24xx-gpio.h> +#include <mach/gpio-s3c24x0.h> /** * Initialize the CPU to be able to work with the a9m2410dev evaluation board
arch/arm/boards/a9m2440/a9m2440.c +5 -5
@@ -33,10 +33,10 @@#include <nand.h> #include <io.h> #include <mach/s3c-iomap.h> -#include <mach/s3c24xx-nand.h> +#include <mach/nand-s3c24x0.h> #include <mach/s3c-generic.h> #include <mach/s3c-busctl.h> -#include <mach/s3c24xx-gpio.h> +#include <mach/gpio-s3c24x0.h> #include "baseboards.h"
@@ -99,7 +99,7 @@ static int a9m2440_mem_init(void)break ; } -arm_add_mem_device ("ram0" ,S3C_SDRAM_BASE ,s3c24xx_get_memory_size ()); +arm_add_mem_device ("ram0" ,S3C_SDRAM_BASE ,s3c_get_memory_size ());return 0 ; }
@@ -155,10 +155,10 @@ static int a9m2440_devices_init(void)device_initcall (a9m2440_devices_init); -#ifdef CONFIG_S3C24XX_NAND_BOOT +#ifdef CONFIG_S3C_NAND_BOOT void __bare_init nand_boot(void) { -s3c24x0_nand_load_image ((void *)TEXT_BASE ,256 *1024 ,0 ); +s3c_nand_load_image ((void *)TEXT_BASE ,256 *1024 ,0 ); }#endif
arch/arm/boards/a9m2440/config.h +1 -1
@@ -66,7 +66,7 @@#define A9M2440_TWRPH1 1/* needed in the generic NAND boot code only */ -#ifdef CONFIG_S3C24XX_NAND_BOOT +#ifdef CONFIG_S3C_NAND_BOOT # define BOARD_DEFAULT_NAND_TIMING CALC_NFCONF_TIMING(A9M2440_TACLS, A9M2440_TWRPH0, A9M2440_TWRPH1)#endif
arch/arm/boards/a9m2440/lowlevel_init.S +2 -2
@@ -4,7 +4,7 @@ #include <config.h> #include <mach/s3c-iomap.h> -#include <mach/s3c24xx-gpio.h> +#include <mach/gpio-s3c24x0.h> .section ".text_bare_init.board_init_lowlevel","ax"
@@ -232,7 +232,7 @@ board_init_lowlevel: bl sdram_init -#ifdef CONFIG_S3C24XX_NAND_BOOT +#ifdef CONFIG_S3C_NAND_BOOT mov lr, r10 /* restore the link register */ /* up to here we are running from the internal SRAM area */ b s3c24x0_nand_boot /* does return directly to our caller into SDRAM */
arch/arm/boards/mini2440/config.h +1 -1
@@ -66,7 +66,7 @@#define MINI2440_TWRPH1 1/* needed in the generic NAND boot code only */ -#ifdef CONFIG_S3C24XX_NAND_BOOT +#ifdef CONFIG_S3C_NAND_BOOT # define BOARD_DEFAULT_NAND_TIMING \ CALC_NFCONF_TIMING(MINI2440_TACLS, MINI2440_TWRPH0, MINI2440_TWRPH1)#endif
arch/arm/boards/mini2440/lowlevel_init.S +1 -1
@@ -30,7 +30,7 @@ board_init_lowlevel: bl s3c24x0_sdram_init -#ifdef CONFIG_S3C24XX_NAND_BOOT +#ifdef CONFIG_S3C_NAND_BOOT mov lr, r10 /* restore the link register */ /* up to here we are running from the internal SRAM area */ b s3c24x0_nand_boot /* does return directly to our caller into SDRAM */
arch/arm/boards/mini2440/mini2440.c +5 -5
@@ -39,12 +39,12 @@#include <io.h> #include <mach/gpio.h> #include <mach/s3c-iomap.h> -#include <mach/s3c24xx-nand.h> +#include <mach/nand-s3c24x0.h> #include <mach/s3c-generic.h> #include <mach/s3c-mci.h> #include <mach/s3c24xx-fb.h> #include <mach/s3c-busctl.h> -#include <mach/s3c24xx-gpio.h> +#include <mach/gpio-s3c24x0.h> static struct s3c24x0_nand_platform_data nand_info = { .nand_timing = CALC_NFCONF_TIMING(MINI2440_TACLS, MINI2440_TWRPH0,
@@ -268,7 +268,7 @@ static const unsigned pin_usage[] = {static int mini2440_mem_init (void ) { -arm_add_mem_device ("ram0" ,S3C_SDRAM_BASE ,s3c24xx_get_memory_size ()); +arm_add_mem_device ("ram0" ,S3C_SDRAM_BASE ,s3c_get_memory_size ());return 0 ; }
@@ -326,10 +326,10 @@ static int mini2440_devices_init(void)device_initcall (mini2440_devices_init); -#ifdef CONFIG_S3C24XX_NAND_BOOT +#ifdef CONFIG_S3C_NAND_BOOT void __bare_init nand_boot(void) { -s3c24x0_nand_load_image ((void *)TEXT_BASE ,256 *1024 ,0 ); +s3c_nand_load_image ((void *)TEXT_BASE ,256 *1024 ,0 ); }#endif
arch/arm/configs/a9m2410_defconfig +1 -1
@@ -1,5 +1,5 @@ CONFIG_ARCH_S3C24xx=y -CONFIG_S3C24XX_NAND_BOOT=y +CONFIG_S3C_NAND_BOOT=y CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y CONFIG_BROKEN=y CONFIG_EXPERIMENTAL=y
arch/arm/configs/a9m2440_defconfig +2 -2
@@ -1,7 +1,7 @@ CONFIG_ARCH_S3C24xx=y CONFIG_MACH_A9M2440=y -CONFIG_S3C24XX_SDRAM_INIT=y -CONFIG_S3C24XX_NAND_BOOT=y +CONFIG_S3C_SDRAM_INIT=y +CONFIG_S3C_NAND_BOOT=y CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y CONFIG_BROKEN=y CONFIG_EXPERIMENTAL=y
arch/arm/configs/mini2440_defconfig +1 -1
@@ -1,7 +1,7 @@ CONFIG_ARCH_S3C24xx=y CONFIG_MACH_MINI2440=y CONFIG_MINI2440_VIDEO_N35=y -CONFIG_S3C24XX_NAND_BOOT=y +CONFIG_S3C_NAND_BOOT=y CONFIG_AEABI=y CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y CONFIG_TEXT_BASE=0x33e00000
arch/arm/mach-samsung/Kconfig +15 -15
@@ -30,8 +30,8 @@ config MACH_A9M2410 bool "Digi A9M2410" select CPU_S3C2410 select MACH_HAS_LOWLEVEL_INIT - select S3C24XX_PLL_INIT - select S3C24XX_SDRAM_INIT + select S3C_PLL_INIT + select S3C_SDRAM_INIT help Say Y here if you are using Digi's Connect Core 9M equipped with a Samsung S3C2410 Processor
@@ -40,7 +40,7 @@ config MACH_A9M2440 bool "Digi A9M2440" select CPU_S3C2440 select MACH_HAS_LOWLEVEL_INIT - select S3C24XX_PLL_INIT + select S3C_PLL_INIT help Say Y here if you are using Digi's Connect Core 9M equipped with a Samsung S3C2440 Processor
@@ -50,8 +50,8 @@ config MACH_MINI2440 select CPU_S3C2440 select MACH_HAS_LOWLEVEL_INIT select MACH_DO_LOWLEVEL_INIT - select S3C24XX_PLL_INIT - select S3C24XX_SDRAM_INIT + select S3C_PLL_INIT + select S3C_SDRAM_INIT select HAS_DM9000 help Say Y here if you are using Mini 2440 dev board equipped
@@ -78,34 +78,36 @@ source arch/arm/boards/mini2440/Kconfig endmenu -menu "S3C24X0 Features " +endif + +menu "S3C Features " -config S3C24XX_LOW_LEVEL_INIT +config S3C_LOWLEVEL_INIT bool -config S3C24XX_PLL_INIT +config S3C_PLL_INIT bool prompt "Reconfigure PLL" - select S3C24XX_LOW_LEVEL_INIT + select S3C_LOWLEVEL_INIT help This adds generic code to reconfigure the internal PLL very early after reset. -config S3C24XX_SDRAM_INIT +config S3C_SDRAM_INIT bool prompt "Initialize SDRAM" - select S3C24XX_LOW_LEVEL_INIT + select S3C_LOWLEVEL_INIT help This adds generic code to configure the SDRAM controller after reset. The initialisation will be skipped if the code is already running from SDRAM. -config S3C24XX_NAND_BOOT +config S3C_NAND_BOOT bool prompt "Booting from NAND" select MTD select NAND - select NAND_S3C24XX + select NAND_S3C help Add generic support to boot from NAND flash. Image loading will be skipped if the code is running from NOR or already from SDRAM.
@@ -113,5 +115,3 @@ config S3C24XX_NAND_BOOT endmenu endif - -endif
arch/arm/mach-samsung/Makefile +3 -2
@@ -1,3 +1,4 @@ obj-y += s3c-timer.o generic.o -obj-$(CONFIG_ARCH_S3C24xx) += gpio-s3c24x0.o s3c24xx-clocks.o -obj-$(CONFIG_S3C24XX_LOW_LEVEL_INIT) += lowlevel-init.o +obj-lowlevel-$(CONFIG_ARCH_S3C24xx) += lowlevel-s3c24x0.o +obj-$(CONFIG_ARCH_S3C24xx) += gpio-s3c24x0.o clocks-s3c24x0.o mem-s3c24x0.o +obj-$(CONFIG_S3C_LOWLEVEL_INIT) += $(obj-lowlevel-y)
arch/arm/mach-samsung/clocks-s3c24x0.c new file +157 -0
157 lines not on this page · raw message
arch/arm/mach-samsung/generic.c +0 -112
125 lines not on this page · raw message
arch/arm/mach-samsung/gpio-s3c24x0.c +1 -1
@@ -20,7 +20,7 @@#include <io.h> #include <mach/s3c-iomap.h> #include <mach/gpio.h> -#include <mach/s3c24xx-gpio.h> +#include <mach/gpio-s3c24x0.h> static const unsigned char group_offset[] = {
arch/arm/mach-samsung/include/mach/clocks-s3c24x0.h new file +24 -0
@@ -0,0 +1,24 @@ +/* +* Copyright (C) 2011 Juergen Beisert, Pengutronix +* +* 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. +*/ + +# define S3C_LOCKTIME (S3C_CLOCK_POWER_BASE) +# define S3C_MPLLCON (S3C_CLOCK_POWER_BASE + 0x4) +# define S3C_UPLLCON (S3C_CLOCK_POWER_BASE + 0x8) +# define S3C_CLKCON (S3C_CLOCK_POWER_BASE + 0xc) +# define S3C_CLKSLOW (S3C_CLOCK_POWER_BASE + 0x10) +# define S3C_CLKDIVN (S3C_CLOCK_POWER_BASE + 0x14) + +# define S3C_MPLLCON_GET_MDIV (x) ((((x) >> 12) & 0xff) + 8) +# define S3C_MPLLCON_GET_PDIV (x) ((((x) >> 4) & 0x3f) + 2) +# define S3C_MPLLCON_GET_SDIV (x) ((x) & 0x3)
arch/arm/mach-samsung/include/mach/gpio-s3c24x0.h new file +77 -0
77 lines not on this page · raw message
arch/arm/mach-samsung/include/mach/iomap-s3c24x0.h new file +69 -0
69 lines not on this page · raw message
arch/arm/mach-samsung/include/mach/nand-s3c24x0.h new file +54 -0
54 lines not on this page · raw message
arch/arm/mach-samsung/include/mach/s3c-clocks.h +10 -12
@@ -1,5 +1,6 @@/* -* Copyright (C) 2011 Juergen Beisert, Pengutronix +* 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
@@ -10,22 +11,19 @@* 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 __MACH_S3C_CLOCKS_H -# define __MACH_S3C_CLOCKS_H +#define __MACH_S3C_CLOCKS_H#ifdef CONFIG_ARCH_S3C24xx -# define S3C_LOCKTIME (S3C_CLOCK_POWER_BASE) -# define S3C_MPLLCON (S3C_CLOCK_POWER_BASE + 0x4) -# define S3C_UPLLCON (S3C_CLOCK_POWER_BASE + 0x8) -# define S3C_CLKCON (S3C_CLOCK_POWER_BASE + 0xc) -# define S3C_CLKSLOW (S3C_CLOCK_POWER_BASE + 0x10) -# define S3C_CLKDIVN (S3C_CLOCK_POWER_BASE + 0x14) - -# define S3C_MPLLCON_GET_MDIV (x) ((((x) >> 12) & 0xff) + 8) -# define S3C_MPLLCON_GET_PDIV (x) ((((x) >> 4) & 0x3f) + 2) -# define S3C_MPLLCON_GET_SDIV (x) ((x) & 0x3) +# include <mach/clocks-s3c24x0.h> #endif #endif /* __MACH_S3C_CLOCKS_H */
arch/arm/mach-samsung/include/mach/s3c-generic.h +3 -1
@@ -33,6 +33,8 @@ uint32_t s3c_get_uclk(void);unsigned s3c_get_uart_clk (unsigned src); -uint32_t s3c24xx_get_memory_size (void ); +uint32_t s3c_get_memory_size (void ); +#ifdef CONFIG_ARCH_S3C24xxvoid s3c24xx_disable_second_sdram_bank (void ); +#endif
arch/arm/mach-samsung/include/mach/s3c-iomap.h +4 -49
61 lines not on this page · raw message
arch/arm/mach-samsung/include/mach/s3c24xx-gpio.h deleted +0 -77
77 lines not on this page · raw message
arch/arm/mach-samsung/include/mach/s3c24xx-nand.h deleted +0 -54
54 lines not on this page · raw message
arch/arm/mach-samsung/lowlevel-init.S deleted +0 -317
317 lines not on this page · raw message
arch/arm/mach-samsung/lowlevel-s3c24x0.S new file +317 -0
317 lines not on this page · raw message
arch/arm/mach-samsung/mem-s3c24x0.c new file +143 -0
143 lines not on this page · raw message
arch/arm/mach-samsung/s3c24xx-clocks.c deleted +0 -157
157 lines not on this page · raw message
drivers/mtd/nand/nand_s3c24xx.c +8 -8
@@ -32,11 +32,11 @@#include <linux/mtd/nand.h> #include <mach/s3c-generic.h> #include <mach/s3c-iomap.h> -#include <mach/s3c24xx-nand.h> +#include <mach/nand-s3c24x0.h> #include <io.h> #include <asm-generic/errno.h> -#ifdef CONFIG_S3C24XX_NAND_BOOT +#ifdef CONFIG_S3C_NAND_BOOT # define __nand_boot_init __bare_init# ifndef BOARD_DEFAULT_NAND_TIMING # define BOARD_DEFAULT_NAND_TIMING 0x0737
@@ -49,7 +49,7 @@* Define this symbol for testing purpose. It will add a command to read an * image from the NAND like it the boot strap code will do. */ -#define CONFIG_NAND_S3C24XX_BOOT_DEBUG +#define CONFIG_NAND_S3C_BOOT_DEBUG /* NAND controller's register */
@@ -497,7 +497,7 @@ static struct driver_d s3c24x0_nand_driver = { .probe = s3c24x0_nand_probe, }; -#ifdef CONFIG_S3C24XX_NAND_BOOT +#ifdef CONFIG_S3C_NAND_BOOT static void __nand_boot_init wait_for_completion(void __iomem *host) {
@@ -545,7 +545,7 @@ static void __nand_boot_init nfc_addr(void __iomem *host, uint32_t offs,* This function must be located in the first 4kiB of the barebox image * (guess why). */ -void __nand_boot_init s3c24x0_nand_load_image(void *dest, int size, int page) +void __nand_boot_init s3c_nand_load_image(void *dest, int size, int page) {void __iomem *host = (void __iomem *)S3C24X0_NAND_BASE ;unsigned pagesize;
@@ -603,7 +603,7 @@ void __nand_boot_init s3c24x0_nand_load_image(void *dest, int size, int page)disable_nand_controller (host); } -#ifdef CONFIG_NAND_S3C24XX_BOOT_DEBUG +#ifdef CONFIG_NAND_S3C_BOOT_DEBUG #include <command.h> static int do_nand_boot_test (int argc,char *argv[])
@@ -617,7 +617,7 @@ static int do_nand_boot_test(int argc, char *argv[]) dest = (void *)strtoul_suffix (argv[1 ],NULL ,0 ); size =strtoul_suffix (argv[2 ],NULL ,0 ); -s3c24x0_nand_load_image (dest, size,0 ); +s3c_nand_load_image (dest, size,0 );/* re-enable the controller again, as this was a test only */ enable_nand_controller((void *)S3C24X0_NAND_BASE,
@@ -636,7 +636,7 @@ BAREBOX_CMD_START(nand_boot_test) BAREBOX_CMD_END#endif -#endif /* CONFIG_S3C24XX_NAND_BOOT */ +#endif /* CONFIG_S3C_NAND_BOOT */ /* * Main initialization routine
drivers/serial/Kconfig +1 -1
@@ -80,7 +80,7 @@ config DRIVER_SERIAL_PL010 config DRIVER_SERIAL_S3C bool "Samsung S3C serial driver" - depends on ARCH_S3C24xx + depends on ARCH_SAMSUNG default y help Say Y here if you want to use the CONS on a Samsung S3C CPU
Signature · 7 lines
1.7.10 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 2/9] Fine split S3C arch dependencies from generic code
Quoted 19 lines · Alexey Galakhov
Signed-off-by Alexey Galakhov <[email protected]>--- arch/arm/boards/a9m2410/a9m2410.c | 10 +- arch/arm/boards/a9m2440/a9m2410dev.c | 2 +- arch/arm/boards/a9m2440/a9m2440.c | 10 +- arch/arm/boards/mini2440/mini2440.c | 10 +- [...] delete mode 100644 arch/arm/mach-samsung/include/mach/s3c24xx-gpio.h create mode 100644 arch/arm/mach-samsung/include/mach/gpio-s3c24x0.h [...] create mode 100644 arch/arm/mach-samsung/include/mach/nand-s3c24x0.h delete mode 100644 arch/arm/mach-samsung/include/mach/s3c24xx-nand.h[...]
(quoted diff) +0
-0
b/arch/arm/boards/a9m2410/a9m2410.cindex 1a3181e..e416c8e 100644arch/arm/boards/a9m2410/a9m2410.c +0
-0@@ -33,10 +33,10 @@#include <nand.h>
arch/arm/boards/a9m2410/a9m2410.c
Quoted 10 lines
arch/arm/boards/a9m2410/a9m2410.c +2
-2#include <io.h> #include <mach/s3c-iomap.h> -#include <mach/s3c24xx-nand.h> +#include <mach/nand-s3c24x0.h> #include <mach/s3c-generic.h> #include <mach/s3c-busctl.h> -#include <mach/s3c24xx-gpio.h> +#include <mach/gpio-s3c24x0.h> delete mode 100644 arch/arm/mach-samsung/s3c24xx-clocks.c
You have to touch all S3C24xx based board files just to rename these files from "<socname>-<function>.h" to "<function>-<socname>.h"?
jbe
Signature · 7 lines
Pengutronix e.K. | Juergen Beisert | Linux Solutions for Science and Industry | http://www.pengutronix.de/ | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 2/9] Fine split S3C arch dependencies from generic code
Quoted 5 lines · Juergen Beisert
You have to touch all S3C24xx based board files just to rename these files from "<socname>-<function>.h" to "<function>-<socname>.h"?
jbe
Not exactly so. Yes, I have to rename file - to make space for another one. Having just one file with lots of #ifdefs for two very different architectures seems to be worse than this.
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 2/9] Fine split S3C arch dependencies from generic code
Quoted 10 lines · Alexey Galakhov
Quoted 5 lines · Juergen Beisert
You have to touch all S3C24xx based board files just to rename these files from "<socname>-<function>.h" to "<function>-<socname>.h"?
jbe
Not exactly so. Yes, I have to rename file - to make space for another one.
Hm? The SoC name already is in the filename, so there *is* space for a new file.
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 2/9] Fine split S3C arch dependencies from generic code
Quoted 2 lines · Sascha Hauer
Hm? The SoC name already is in the filename, so there *is* space for a new file.
I'll move this to a separate rename-only patch. If you don't apply them, nothing will break.
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 2/9] Fine split S3C arch dependencies from generic code
In reply to Alexey GalakhovQuoted 7 lines · Alexey Galakhov
Quoted 2 lines · Juergen Beisert
You have to touch all S3C24xx based board files just to rename these files from "<socname>-<function>.h" to "<function>-<socname>.h"?
Not exactly so. Yes, I have to rename file - to make space for another one. Having just one file with lots of #ifdefs for two very different architectures seems to be worse than this.
Did you really read my answer?
Here again:
...just to rename these files from "<socname>-<function>.h" to "<function>-<socname>.h"
jbe
Signature · 7 lines
Pengutronix e.K. | Juergen Beisert | Linux Solutions for Science and Industry | http://www.pengutronix.de/ | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 2/9] Fine split S3C arch dependencies from generic code
Quoted 6 lines
Did you really read my answer?
Here again:
...just to rename these files from "<socname>-<function>.h" to "<function>-<socname>.h"
Sorry, I misunderstood. Going to fix now.
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 2/9] Fine split S3C arch dependencies from generic code
In reply to Alexey Galakhovarch/arm/boards/a9m2410/a9m2410.c static int a9m2410_mem_init(void) · line 54
Quoted 11 lines · Alexey Galakhov
Signed-off-by Alexey Galakhov <[email protected]>---
// {"NAND 1MiB 3,3V 8-bit",
0xec, 256, 1,0x1000, 0}, static structs3c24x0_nand_platform_datanand_info= {arch/arm/boards/a9m2410/a9m2410.c +1
-1@@ -51,7 +51,7 @@ static int a9m2410_mem_init(void)* Note: On this card the second SDRAM page is not used */ s3c24xx_disable_second_sdram_bank (); - size =s3c24xx_get_memory_size (); + size =s3c_get_memory_size ();
s3c24xx_get_memory_size is a s3c24xx specific function, which is called from a s3c24xx specific context, so please keep the name like it is.
Generally if two functions need to be implemented differently on different SoCs they should have a different name. We learned that the hard way in the kernel where we tend to build multiple SoCs in a single image. With a generic s3c_ this won't work.
Not that we want to compile in multiple SoC support into barebox in the near future, but the above already *is* done right, so don't change it.
arch/arm/boards/a9m2440/a9m2410dev.c line 33
Quoted 10 lines
arch/arm/boards/a9m2440/a9m2410dev.c +1
-1@@ -30,7 +30,7 @@#include <io.h> #include <mach/s3c-iomap.h> #include <mach/s3c-busctl.h> -#include <mach/s3c24xx-gpio.h> +#include <mach/gpio-s3c24x0.h>
Don't rename files if you don't really have to. One may argue if one name or the other is better, but once the files are there you need really good reasons to change them because tracking git history over renames is hard.
If you really want to change filenames, please generate your patches with git format-patch -M which will make it easier to review.
arch/arm/boards/a9m2440/a9m2410dev.c line 35
Quoted 3 lines
arch/arm/boards/a9m2440/a9m2410dev.c +1
-1#include <mach/s3c-iomap.h> -#include <mach/s3c24xx-nand.h> +#include <mach/nand-s3c24x0.h>
Same here.
Overall this patch introduces a lot of churn without explaining why it is useful. The series would be much better if you just drop this patch.
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 3/9 Minimal S5PV210 + Tiny210 support (2nd stage only)
In reply to Alexey Galakhov--- arch/arm/Kconfig | 6 + arch/arm/Makefile | 1 + arch/arm/boards/tiny210/Makefile | 1 + arch/arm/boards/tiny210/config.h | 1 + arch/arm/boards/tiny210/lowlevel.c | 41 + arch/arm/boards/tiny210/tiny210.c | 113 +++ arch/arm/mach-samsung/Kconfig | 24 + arch/arm/mach-samsung/Makefile | 1 + arch/arm/mach-samsung/clocks-s5pcxx.c | 98 +++ arch/arm/mach-samsung/gpio-s5pcxx.c | 123 +++ arch/arm/mach-samsung/include/mach/clocks-s5pcxx.h | 55 ++ arch/arm/mach-samsung/include/mach/gpio.h | 3 + arch/arm/mach-samsung/include/mach/iomap-s5pcxx.h | 49 ++ arch/arm/mach-samsung/include/mach/iomux-s5pcxx.h | 798 ++++++++++++++++++++ arch/arm/mach-samsung/include/mach/s3c-clocks.h | 3 + arch/arm/mach-samsung/include/mach/s3c-iomap.h | 3 + 16 files changed, 1320 insertions(+) create mode 100644 arch/arm/boards/tiny210/Makefile create mode 100644 arch/arm/boards/tiny210/config.h create mode 100644 arch/arm/boards/tiny210/lowlevel.c create mode 100644 arch/arm/boards/tiny210/tiny210.c create mode 100644 arch/arm/mach-samsung/clocks-s5pcxx.c create mode 100644 arch/arm/mach-samsung/gpio-s5pcxx.c create mode 100644 arch/arm/mach-samsung/include/mach/clocks-s5pcxx.h create mode 100644 arch/arm/mach-samsung/include/mach/iomap-s5pcxx.h create mode 100644 arch/arm/mach-samsung/include/mach/iomux-s5pcxx.h
arch/arm/Kconfig +6 -0
@@ -73,6 +73,12 @@ config ARCH_S3C24xx select CPU_ARM920T select GENERIC_GPIO +config ARCH_S5PCxx + bool "Samsung S5PC110, S5PV210" + select ARCH_SAMSUNG + select CPU_V7 + select GENERIC_GPIO + config ARCH_VERSATILE bool "ARM Versatile boards (ARM926EJ-S)" select CPU_ARM926T
arch/arm/Makefile +1 -0
@@ -133,6 +133,7 @@ board-$(CONFIG_MACH_TX25) := karo-tx25 board-$(CONFIG_MACH_TQMA53) := tqma53 board-$(CONFIG_MACH_TX51) := karo-tx51 board-$(CONFIG_MACH_MX6Q_ARM2) := freescale-mx6-arm2 +board-$(CONFIG_MACH_TINY210) := tiny210 machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y))
arch/arm/boards/tiny210/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-y += tiny210.o lowlevel.o
arch/arm/boards/tiny210/config.h new file +1 -0
@@ -0,0 +1 @@ +#define S5PCXX_CLOCK_REFERENCE 24000000
arch/arm/boards/tiny210/lowlevel.c new file +41 -0
41 lines not on this page · raw message
arch/arm/boards/tiny210/tiny210.c new file +113 -0
113 lines not on this page · raw message
arch/arm/mach-samsung/Kconfig +24 -0
@@ -13,6 +13,7 @@ config BOARDINFO default "Mini 2440" if MACH_MINI2440 default "Digi A9M2440" if MACH_A9M2440 default "Digi A9M2410" if MACH_A9M2410 + default "Tiny 210" if MACH_TINY210 if ARCH_S3C24xx
@@ -80,6 +81,29 @@ endmenu endif +if ARCH_S5PCxx + +config CPU_S5PC110 + bool + +config CPU_S5PV210 + bool + +choice + + prompt "S5PCxx board type" + +config MACH_TINY210 + bool "Tiny 210" + select CPU_S5PV210 + select MACH_HAS_LOWLEVEL_INIT + select MACH_DO_LOWLEVEL_INIT + +endchoice + +endif + + menu "S3C Features " config S3C_LOWLEVEL_INIT
arch/arm/mach-samsung/Makefile +1 -0
@@ -1,4 +1,5 @@ obj-y += s3c-timer.o generic.o obj-lowlevel-$(CONFIG_ARCH_S3C24xx) += lowlevel-s3c24x0.o obj-$(CONFIG_ARCH_S3C24xx) += gpio-s3c24x0.o clocks-s3c24x0.o mem-s3c24x0.o +obj-$(CONFIG_ARCH_S5PCxx) += gpio-s5pcxx.o clocks-s5pcxx.o obj-$(CONFIG_S3C_LOWLEVEL_INIT) += $(obj-lowlevel-y)
arch/arm/mach-samsung/clocks-s5pcxx.c new file +98 -0
98 lines not on this page · raw message
arch/arm/mach-samsung/gpio-s5pcxx.c new file +123 -0
123 lines not on this page · raw message
arch/arm/mach-samsung/include/mach/clocks-s5pcxx.h new file +55 -0
55 lines not on this page · raw message
arch/arm/mach-samsung/include/mach/gpio.h +3 -0
@@ -16,6 +16,9 @@#ifdef CONFIG_ARCH_S3C24xx# include <mach/iomux-s3c24x0.h> #endif +#ifdef CONFIG_ARCH_S5PCxx +# include <mach/iomux-s5pcxx.h> +#endif void gpio_set_value (unsigned ,int );int gpio_direction_input (unsigned );
arch/arm/mach-samsung/include/mach/iomap-s5pcxx.h new file +49 -0
49 lines not on this page · raw message
arch/arm/mach-samsung/include/mach/iomux-s5pcxx.h new file +798 -0
798 lines not on this page · raw message
arch/arm/mach-samsung/include/mach/s3c-clocks.h +3 -0
@@ -25,5 +25,8 @@#ifdef CONFIG_ARCH_S3C24xx# include <mach/clocks-s3c24x0.h> #endif +#ifdef CONFIG_ARCH_S5PCxx +# include <mach/clocks-s5pcxx.h> +#endif #endif /* __MACH_S3C_CLOCKS_H */
arch/arm/mach-samsung/include/mach/s3c-iomap.h +3 -0
@@ -22,3 +22,6 @@#ifdef CONFIG_ARCH_S3C24xx# include <mach/iomap-s3c24x0.h> #endif +#ifdef CONFIG_ARCH_S5PCxx +# include <mach/iomap-s5pcxx.h> +#endif
Signature · 7 lines
1.7.10 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 3/9] Minimal S5PV210 + Tiny210 support (2nd stage only)
Quoted 28 lines · Alexey Galakhov
Signed-off-by Alexey Galakhov <[email protected]>--- arch/arm/Kconfig | 6 + arch/arm/Makefile | 1 + arch/arm/boards/tiny210/Makefile | 1 + arch/arm/boards/tiny210/config.h | 1 + arch/arm/boards/tiny210/lowlevel.c | 41 + arch/arm/boards/tiny210/tiny210.c | 113 +++ arch/arm/mach-samsung/Kconfig | 24 + arch/arm/mach-samsung/Makefile | 1 + arch/arm/mach-samsung/clocks-s5pcxx.c | 98 +++ arch/arm/mach-samsung/gpio-s5pcxx.c | 123 +++ arch/arm/mach-samsung/include/mach/clocks-s5pcxx.h | 55 ++ arch/arm/mach-samsung/include/mach/gpio.h | 3 + arch/arm/mach-samsung/include/mach/iomap-s5pcxx.h | 49 ++ arch/arm/mach-samsung/include/mach/iomux-s5pcxx.h | 798 ++++++++++++++++++++ arch/arm/mach-samsung/include/mach/s3c-clocks.h | 3 + arch/arm/mach-samsung/include/mach/s3c-iomap.h | 3 + 16 files changed, 1320 insertions(+) create mode 100644 arch/arm/boards/tiny210/Makefile create mode 100644 arch/arm/boards/tiny210/config.h create mode 100644 arch/arm/boards/tiny210/lowlevel.c create mode 100644 arch/arm/boards/tiny210/tiny210.c create mode 100644 arch/arm/mach-samsung/clocks-s5pcxx.c create mode 100644 arch/arm/mach-samsung/gpio-s5pcxx.c create mode 100644 arch/arm/mach-samsung/include/mach/clocks-s5pcxx.h create mode 100644 arch/arm/mach-samsung/include/mach/iomap-s5pcxx.h create mode 100644 arch/arm/mach-samsung/include/mach/iomux-s5pcxx.h
Quoted 1 line
[...]
This patch series reflects your development steps (2nd stage first, then native boot support). But this is not useful when including the results into the Barebox repository.
For example you should add your new platform at the end of this patch series after all the required preparations are done to make it work.
jbe
Signature · 7 lines
Pengutronix e.K. | Juergen Beisert | Linux Solutions for Science and Industry | http://www.pengutronix.de/ | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 3/9] Minimal S5PV210 + Tiny210 support (2nd stage only)
Quoted 6 lines · Juergen Beisert
This patch series reflects your development steps (2nd stage first, then native boot support). But this is not useful when including the results into the Barebox repository.
For example you should add your new platform at the end of this patch series after all the required preparations are done to make it work.
Ok, I'll rebase them.
The reason to do so was to introduce (harmless?) refactoring first and to add new features next to make git bisect work.
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 3/9] Minimal S5PV210 + Tiny210 support (2nd stage only)
Quoted 5 lines · Alexey Galakhov
Quoted 4 lines · Juergen Beisert
This patch series reflects your development steps (2nd stage first, then native boot support). But this is not useful when including the results into the Barebox repository.
Quoted 7 lines
Quoted 2 lines
For example you should add your new platform at the end of this patch series after all the required preparations are done to make it work.
Ok, I'll rebase them.
The reason to do so was to introduce (harmless?) refactoring first and to add new features next to make git bisect work.
It would be all right if you had introduce the basic support first and it is now part of the repository. And *then* add the native boot support as a really second step and separate patch series.
jbe
Signature · 7 lines
Pengutronix e.K. | Juergen Beisert | Linux Solutions for Science and Industry | http://www.pengutronix.de/ | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH 3/9] Minimal S5PV210 + Tiny210 support (2nd stage only)
Hi Alexey,
please keep the mailing list at least on CC.
Quoted 11 lines · Alexey Galakhov
Quoted 3 lines
It would be all right if you had introduce the basic support first and it is now part of the repository. And *then* add the native boot support as a really second step and separate patch series.
The iROM support should be separated anyway. The reason is, iROM is only a temporary solution until we have a working replacement. This patch is designed to be easily reverted separately as soon as we'll able to boot without it.
Using iROM to boot is generally a bad idea, but there's no alternative right now.
For you there might be no alternative right now. But for Barebox its all right if only a basic support for this new CPU is available.
Quoted 8 lines
I think the correct patch series should look like that:
* make some space for everything (not introducing anything new, to be able to use git bisect if things do break)
* add support of the new architecture to the existing code
* add support for specific PLL
* add support for specific DRAM
* add support for iROM
Skip the iROM entirely in your patch series if you want to remove it later on. What sense would it make to include it and then remove it again?
Quoted 1 line
* finally, add new board.
Yes. This step makes use of all the steps above (but not the iROM).
Quoted 2 lines
The point is, if one reverts these patches one by one from the end, the rest will be usable.
There is almost _never_ a reason to revert a complete patch. If an older patch has introduced a regression then there will be a new patch that fixes it and explains why and how to fix.
Quoted 2 lines
However, there's one bad thing: it's better to add at least one board to
Kconfigwith the new arch.
?
jbe
Signature · 7 lines
Pengutronix e.K. | Juergen Beisert | Linux Solutions for Science and Industry | http://www.pengutronix.de/ | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 3/9] Minimal S5PV210 + Tiny210 support (2nd stage only)
Hi,
Quoted 3 lines · Juergen Beisert
Hi Alexey,
please keep the mailing list at least on CC.
Oops. Sorry. Wrong button :)
Quoted 5 lines
Quoted 2 lines
Using iROM to boot is generally a bad idea, but there's no alternative right now.
For you there might be no alternative right now. But for Barebox its all right if only a basic support for this new CPU is available.
Even if it's not bootable?
Ok, there's better plan. Instead of adding iROM in a separate file, I'll just call its magic address in board's lowlevel init. So this will be for tiny210 only.
Quoted 2 lines
Skip the iROM entirely in your patch series if you want to remove it later on. What sense would it make to include it and then remove it again?
It depends on what one means "remove again". This may happen after a year or so. While I think I can implement NAND quite fast, I'm not so optimistic about MMC.
Quoted 4 lines
Quoted 2 lines
However, there's one bad thing: it's better to add at least one board to
Kconfigwith the new arch.?
If there are no BOARDINFO and board-y defined, barebox cannot be built. So one cannot compile barebox with CONFIG_ARCH_something if there are no boards utilizing it, right? How to test the compilation then? Is it Ok?
Regards,
Alex
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 3/9] Minimal S5PV210 + Tiny210 support (2nd stage only)
Hi Alexey,
Quoted 7 lines · Alexey Galakhov
Quoted 5 lines
Quoted 2 lines
Using iROM to boot is generally a bad idea, but there's no alternative right now.
For you there might be no alternative right now. But for Barebox its all right if only a basic support for this new CPU is available.
Even if it's not bootable?
At least it can act as a second stage bootloader (network boot for example). This is also the stage at which my S3C6410 currently is.
Quoted 11 lines
Ok, there's better plan. Instead of adding iROM in a separate file, I'll just call its magic address in board's lowlevel init. So this will be for tiny210 only.
Quoted 3 lines
Skip the iROM entirely in your patch series if you want to remove it later on. What sense would it make to include it and then remove it again?
It depends on what one means "remove again". This may happen after a year or so. While I think I can implement NAND quite fast, I'm not so optimistic about MMC.
In this case MMC boot support just not exists. If it will work with an ugly solution there is no more pressure to develop a correct solution for it...and it will stay forever.
Keep it in your repository if you need it for your work.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
However, there's one bad thing: it's better to add at least one board to
Kconfigwith the new arch.?
If there are no BOARDINFO and board-y defined, barebox cannot be built. So one cannot compile barebox with
CONFIG_ARCH_somethingif there are no boards utilizing it, right? How to test the compilation then? Is it Ok?
But you can't first add the consumer of a new API (=board file) and after that the API itself!
jbe
Signature · 7 lines
Pengutronix e.K. | Juergen Beisert | Linux Solutions for Science and Industry | http://www.pengutronix.de/ | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 3/9] Minimal S5PV210 + Tiny210 support (2nd stage only)
Hi Juergen,
I mostly finished rebasing the patches according to your comments.
Now looks like that:
* Support most Samsung SoCs in S3C serial driver
* Fine split S3C arch dependencies from generic code
* Add support for Samsung S5P architecture (S5PV210)
* S5P boot header and image generator
* S5P lowlevel clock init
* S5P DRAM support
* Add FriendlyArm Tiny210 board (S5PV210)
Lowlevel clock and DRAM inits may be skipped for 2nd stage only bootloader. iROM support is now part of board's lowlevel.c and has nothing to do with mach-samsung.
Alex
Quoted 36 lines · Juergen Beisert
Hi Alexey,
Quoted 7 lines · Alexey Galakhov
Quoted 5 lines
Quoted 2 lines
Using iROM to boot is generally a bad idea, but there's no alternative right now.
For you there might be no alternative right now. But for Barebox its all right if only a basic support for this new CPU is available.
Even if it's not bootable?
At least it can act as a second stage bootloader (network boot for example). This is also the stage at which my S3C6410 currently is.
Quoted 11 lines
Ok, there's better plan. Instead of adding iROM in a separate file, I'll just call its magic address in board's lowlevel init. So this will be for tiny210 only.
Quoted 3 lines
Skip the iROM entirely in your patch series if you want to remove it later on. What sense would it make to include it and then remove it again?
It depends on what one means "remove again". This may happen after a year or so. While I think I can implement NAND quite fast, I'm not so optimistic about MMC.
In this case MMC boot support just not exists. If it will work with an ugly solution there is no more pressure to develop a correct solution for it...and it will stay forever.
Keep it in your repository if you need it for your work.Quoted 5 lines
Quoted 4 lines
Quoted 2 lines
However, there's one bad thing: it's better to add at least one board to
Kconfigwith the new arch.?
Quoted 9 lines
Quoted 3 lines
If there are no BOARDINFO and board-y defined, barebox cannot be built. So one cannot compile barebox with
CONFIG_ARCH_somethingif there are no boards utilizing it, right? How to test the compilation then? Is it Ok?But you can't first add the consumer of a new API (=board file) and after that the API itself!
jbe
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
PATCH 4/9 S5PV210 iROM magic boot code
In reply to Alexey Galakhov--- arch/arm/Kconfig | 1 + arch/arm/boards/tiny210/lowlevel.c | 11 +++- arch/arm/lib/barebox.lds.S | 4 ++ arch/arm/mach-samsung/Kconfig | 1 + arch/arm/mach-samsung/Makefile | 1 + arch/arm/mach-samsung/include/mach/s3c-generic.h | 4 ++ arch/arm/mach-samsung/s5p-irom-boot.c | 64 ++++++++++++++++++++++ common/Kconfig | 24 ++++++++ 8 files changed, 108 insertions(+), 2 deletions(-) create mode 100644 arch/arm/mach-samsung/s5p-irom-boot.c
arch/arm/Kconfig +1 -0
@@ -16,6 +16,7 @@ config ARM select HAS_MODULES select HAVE_CONFIGURABLE_MEMORY_LAYOUT select HAVE_CONFIGURABLE_TEXT_BASE + select HAVE_BARE_INIT_PADDING default y config ARM_AMBA
arch/arm/boards/tiny210/lowlevel.c +9 -2
@@ -23,11 +23,15 @@#include <init.h> #include <io.h> #include <asm/barebox-arm.h> +#include <asm/sections.h> #include <mach/s3c-iomap.h> #include <mach/s3c-clocks.h> +#include <mach/s3c-generic.h> void __bare_init board_init_lowlevel(void) { +unsigned r; +/* TODO: initialize PLL here */ if (get_pc () <0xD0000000 )/* Are we running from iRAM? */
@@ -35,7 +39,10 @@ void __bare_init board_init_lowlevel(void)/* TODO: initialize DRAM here */ -/* TODO: load barebox to DRAM here */ +if (!s5p_irom_mmc_load ((void *)TEXT_BASE -16 ,1 , (barebox_image_size +16 +511 ) /512 )) +while (1 ) { }/* hang */ -while (1 ) { }/* hang */ +/* Jump to SDRAM */ + r = (unsigned )TEXT_BASE ; + __asm__ __volatile__("mov pc, %0" : :"r" (r)); }
arch/arm/lib/barebox.lds.S +4 -0
@@ -49,6 +49,10 @@ SECTIONS __bare_init_start = .; *(.text_bare_init*) __bare_init_end = .; +#ifdef CONFIG_BAREBOX_BARE_INIT_PADDING + . = (. + (CONFIG_BAREBOX_BARE_INIT_PADDING_SIZE)); + . = ALIGN(CONFIG_BAREBOX_BARE_INIT_PADDING_ALIGN); +#endif __exceptions_start = .; KEEP(*(.text_exceptions*)) __exceptions_stop = .;
arch/arm/mach-samsung/Kconfig +1 -0
@@ -98,6 +98,7 @@ config MACH_TINY210 select CPU_S5PV210 select MACH_HAS_LOWLEVEL_INIT select MACH_DO_LOWLEVEL_INIT + select BAREBOX_BARE_INIT_PADDING endchoice
arch/arm/mach-samsung/Makefile +1 -0
@@ -2,4 +2,5 @@ obj-y += s3c-timer.o generic.o obj-lowlevel-$(CONFIG_ARCH_S3C24xx) += lowlevel-s3c24x0.o obj-$(CONFIG_ARCH_S3C24xx) += gpio-s3c24x0.o clocks-s3c24x0.o mem-s3c24x0.o obj-$(CONFIG_ARCH_S5PCxx) += gpio-s5pcxx.o clocks-s5pcxx.o +obj-$(CONFIG_ARCH_S5PCxx) += s5p-irom-boot.o obj-$(CONFIG_S3C_LOWLEVEL_INIT) += $(obj-lowlevel-y)
arch/arm/mach-samsung/include/mach/s3c-generic.h +4 -0
@@ -38,3 +38,7 @@ uint32_t s3c_get_memory_size(void);#ifdef CONFIG_ARCH_S3C24xxvoid s3c24xx_disable_second_sdram_bank (void );#endif + +#ifdef CONFIG_ARCH_S5PCxx +int s5p_irom_mmc_load (void *dest,uint32_t start_block,uint16_t block_count); +#endif
arch/arm/mach-samsung/s5p-irom-boot.c new file +64 -0
64 lines not on this page · raw message
common/Kconfig +24 -0
@@ -124,6 +124,30 @@ config BAREBOX_MAX_BARE_INIT_SIZE this will allow your bare_init will fit in SRAM as example ARCH can overwrite it via ARCH_BAREBOX_MAX_BARE_INIT_SIZE +config HAVE_BARE_INIT_PADDING + bool + +config BAREBOX_BARE_INIT_PADDING + depends on HAVE_BARE_INIT_PADDING + bool "Enable bare_init tail padding" + default n + help + Some architectures require that 1st stage loader is padded + with zeroes. This will add zero padding at the end of + bare_init block. If unsure, say n. + +config BAREBOX_BARE_INIT_PADDING_SIZE + depends on BAREBOX_BARE_INIT_PADDING + prompt "Minimal bare_init padding size" + hex + default 0x4 + +config BAREBOX_BARE_INIT_PADDING_ALIGN + depends on BAREBOX_BARE_INIT_PADDING + prompt "bare_init end alignment" + hex + default 0x200 + config HAVE_CONFIGURABLE_MEMORY_LAYOUT bool
Signature · 7 lines
1.7.10 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 4/9] S5PV210 iROM magic boot code
Quoted 11 lines · Alexey Galakhov
Signed-off-by Alexey Galakhov <[email protected]>--- arch/arm/Kconfig | 1 + arch/arm/boards/tiny210/lowlevel.c | 11 +++- arch/arm/lib/barebox.lds.S | 4 ++ arch/arm/mach-samsung/Kconfig | 1 + arch/arm/mach-samsung/Makefile | 1 + arch/arm/mach-samsung/include/mach/s3c-generic.h | 4 ++ arch/arm/mach-samsung/s5p-irom-boot.c | 64 ++++++++++++++++++++++ common/Kconfig | 24 ++++++++ 8 files changed, 108 insertions(+), 2 deletions(-)
Please clean up your series. This patch gets reverted in 7/9 so no reason to introduce it in the first place.
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 4/9] S5PV210 iROM magic boot code
Quoted 13 lines · Sascha Hauer
Quoted 11 lines · Alexey Galakhov
Signed-off-by Alexey Galakhov <[email protected]>--- arch/arm/Kconfig | 1 + arch/arm/boards/tiny210/lowlevel.c | 11 +++- arch/arm/lib/barebox.lds.S | 4 ++ arch/arm/mach-samsung/Kconfig | 1 + arch/arm/mach-samsung/Makefile | 1 + arch/arm/mach-samsung/include/mach/s3c-generic.h | 4 ++ arch/arm/mach-samsung/s5p-irom-boot.c | 64 ++++++++++++++++++++++ common/Kconfig | 24 ++++++++ 8 files changed, 108 insertions(+), 2 deletions(-)
Quoted 2 lines
Please clean up your series. This patch gets reverted in 7/9 so no reason to introduce it in the first place.
Ok. That's because I pushed the patch to public github before I reverted it.
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
PATCH 5/9 S5P DRAM support
In reply to Alexey Galakhov--- arch/arm/boards/tiny210/config.h | 9 + arch/arm/boards/tiny210/lowlevel.c | 4 +- arch/arm/boards/tiny210/tiny210.c | 2 +- arch/arm/mach-samsung/Makefile | 2 +- arch/arm/mach-samsung/include/mach/iomap-s5pcxx.h | 3 + arch/arm/mach-samsung/include/mach/s3c-generic.h | 1 + arch/arm/mach-samsung/mem-s5pcxx.c | 260 +++++++++++++++++++++ 7 files changed, 278 insertions(+), 3 deletions(-) create mode 100644 arch/arm/mach-samsung/mem-s5pcxx.c
arch/arm/boards/tiny210/config.h +9 -0
@@ -1 +1,10 @@#define S5PCXX_CLOCK_REFERENCE 24000000 + +#define S5P_DRAM_DDR2 + +#define S5P_DRAM_WR 3 +#define S5P_DRAM_CAS 4 +#define DMC_TIMING_AREF 0x00000618 +#define DMC_TIMING_ROW 0x2B34438A +#define DMC_TIMING_DATA 0x24240000 +#define DMC_TIMING_PWR 0x0BDC0343
arch/arm/boards/tiny210/lowlevel.c +3 -1
@@ -37,7 +37,9 @@ void __bare_init board_init_lowlevel(void)if (get_pc () <0xD0000000 )/* Are we running from iRAM? */ return ;/* No, we don't. */ -/* TODO: initialize DRAM here */ +#ifdef CONFIG_S3C_SDRAM_INIT +s5p_init_dram_bank (S5P_DMC0_BASE ,0x20E00323 ,0 ); +#endif if (!s5p_irom_mmc_load ((void *)TEXT_BASE -16 ,1 , (barebox_image_size +16 +511 ) /512 ))while (1 ) { }/* hang */
arch/arm/boards/tiny210/tiny210.c +1 -1
@@ -70,7 +70,7 @@ static struct gpio_led leds[] = {static int tiny210_mem_init (void ) { -arm_add_mem_device ("ram0" ,S3C_SDRAM_BASE , (512 <<20 )); +arm_add_mem_device ("ram0" ,S3C_SDRAM_BASE ,s3c_get_memory_size ());return 0 ; }mem_initcall (tiny210_mem_init);
arch/arm/mach-samsung/Makefile +1 -1
@@ -1,6 +1,6 @@ obj-y += s3c-timer.o generic.o obj-lowlevel-$(CONFIG_ARCH_S3C24xx) += lowlevel-s3c24x0.o obj-$(CONFIG_ARCH_S3C24xx) += gpio-s3c24x0.o clocks-s3c24x0.o mem-s3c24x0.o -obj-$(CONFIG_ARCH_S5PCxx) += gpio-s5pcxx.o clocks-s5pcxx.o +obj-$(CONFIG_ARCH_S5PCxx) += gpio-s5pcxx.o clocks-s5pcxx.o mem-s5pcxx.o obj-$(CONFIG_ARCH_S5PCxx) += s5p-irom-boot.o obj-$(CONFIG_S3C_LOWLEVEL_INIT) += $(obj-lowlevel-y)
arch/arm/mach-samsung/include/mach/iomap-s5pcxx.h +3 -0
@@ -47,3 +47,6 @@#define S3C_UART3_SIZE 0x400#define S3C_UART_HAS_UBRDIVSLOT #define S3C_UART_HAS_UINTM + +#define S5P_DMC0_BASE 0xF0000000 +#define S5P_DMC1_BASE 0xF1400000
arch/arm/mach-samsung/include/mach/s3c-generic.h +1 -0
@@ -40,5 +40,6 @@ void s3c24xx_disable_second_sdram_bank(void);#endif #ifdef CONFIG_ARCH_S5PCxx +void s5p_init_dram_bank (uint32_t base,uint32_t mc0,uint32_t mc1);int s5p_irom_mmc_load (void *dest,uint32_t start_block,uint16_t block_count);#endif
arch/arm/mach-samsung/mem-s5pcxx.c new file +260 -0
260 lines not on this page · raw message
Signature · 7 lines
1.7.10 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 6/9 S5P lowlevel clock init
In reply to Alexey Galakhov--- arch/arm/boards/tiny210/config.h | 13 +++++ arch/arm/boards/tiny210/lowlevel.c | 4 +- arch/arm/mach-samsung/Makefile | 1 + arch/arm/mach-samsung/include/mach/s3c-generic.h | 1 + arch/arm/mach-samsung/lowlevel-s5pcxx.c | 61 ++++++++++++++++++++++ 5 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 arch/arm/mach-samsung/lowlevel-s5pcxx.c
arch/arm/boards/tiny210/config.h +13 -0
@@ -8,3 +8,16 @@#define DMC_TIMING_ROW 0x2B34438A#define DMC_TIMING_DATA 0x24240000#define DMC_TIMING_PWR 0x0BDC0343 + +#define set_pll (mdiv, pdiv, sdiv) (1<<31 | mdiv<<16 | pdiv<<8 | sdiv) + +#define BOARD_APLL_VAL set_pll(0x7d, 0x3, 0x1) +#define BOARD_MPLL_VAL set_pll(0x29b, 0xc, 0x1) +#define BOARD_EPLL_VAL set_pll(0x60, 0x6, 0x2) +#define BOARD_VPLL_VAL set_pll(0x6c, 0x6, 0x3) + +#define BOARD_CLK_DIV0_MASK 0xFFFFFFFF +#define BOARD_CLK_DIV0_VAL 0x14131440 +#define BOARD_APLL_LOCKTIME 0x2cf + +
arch/arm/boards/tiny210/lowlevel.c +3 -1
@@ -32,7 +32,9 @@ void __bare_init board_init_lowlevel(void) {unsigned r; -/* TODO: initialize PLL here */ +#ifdef CONFIG_S3C_PLL_INIT +s5p_init_pll (); +#endif if (get_pc () <0xD0000000 )/* Are we running from iRAM? */ return ;/* No, we don't. */
arch/arm/mach-samsung/Makefile +1 -0
@@ -1,5 +1,6 @@ obj-y += s3c-timer.o generic.o obj-lowlevel-$(CONFIG_ARCH_S3C24xx) += lowlevel-s3c24x0.o +obj-lowlevel-$(CONFIG_ARCH_S5PCxx) += lowlevel-s5pcxx.o obj-$(CONFIG_ARCH_S3C24xx) += gpio-s3c24x0.o clocks-s3c24x0.o mem-s3c24x0.o obj-$(CONFIG_ARCH_S5PCxx) += gpio-s5pcxx.o clocks-s5pcxx.o mem-s5pcxx.o obj-$(CONFIG_ARCH_S5PCxx) += s5p-irom-boot.o
arch/arm/mach-samsung/include/mach/s3c-generic.h +1 -0
@@ -40,6 +40,7 @@ void s3c24xx_disable_second_sdram_bank(void);#endif #ifdef CONFIG_ARCH_S5PCxx +void s5p_init_pll (void );void s5p_init_dram_bank (uint32_t base,uint32_t mc0,uint32_t mc1);int s5p_irom_mmc_load (void *dest,uint32_t start_block,uint16_t block_count);#endif
arch/arm/mach-samsung/lowlevel-s5pcxx.c new file +61 -0
61 lines not on this page · raw message
Signature · 7 lines
1.7.10 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 7/9 Revert "S5PV210 iROM magic boot code"
In reply to Alexey GalakhovThis reverts commit 4d6b83126d870ce3f0667d0a46077b8717521381.
Conflicts:
arch/arm/boards/tiny210/lowlevel.c arch/arm/mach-samsung/Makefile arch/arm/mach-samsung/include/mach/s3c-generic.h
--- arch/arm/Kconfig | 1 - arch/arm/boards/tiny210/lowlevel.c | 9 +-- arch/arm/lib/barebox.lds.S | 4 -- arch/arm/mach-samsung/Kconfig | 1 - arch/arm/mach-samsung/Makefile | 1 - arch/arm/mach-samsung/include/mach/s3c-generic.h | 1 - arch/arm/mach-samsung/s5p-irom-boot.c | 64 ---------------------- common/Kconfig | 24 -------- 8 files changed, 2 insertions(+), 103 deletions(-) delete mode 100644 arch/arm/mach-samsung/s5p-irom-boot.c
arch/arm/Kconfig +0 -1
@@ -16,7 +16,6 @@ config ARM select HAS_MODULES select HAVE_CONFIGURABLE_MEMORY_LAYOUT select HAVE_CONFIGURABLE_TEXT_BASE - select HAVE_BARE_INIT_PADDING default y config ARM_AMBA
arch/arm/boards/tiny210/lowlevel.c +2 -7
@@ -23,14 +23,12 @@#include <init.h> #include <io.h> #include <asm/barebox-arm.h> -#include <asm/sections.h> #include <mach/s3c-iomap.h> #include <mach/s3c-clocks.h> #include <mach/s3c-generic.h> void __bare_init board_init_lowlevel(void) { -unsigned r;#ifdef CONFIG_S3C_PLL_INIT s5p_init_pll ();
@@ -43,10 +41,7 @@ void __bare_init board_init_lowlevel(void)s5p_init_dram_bank (S5P_DMC0_BASE ,0x20E00323 ,0 );#endif -if (!s5p_irom_mmc_load ((void *)TEXT_BASE -16 ,1 , (barebox_image_size +16 +511 ) /512 )) -while (1 ) { }/* hang */ +/* TODO: load barebox to DRAM here */ -/* Jump to SDRAM */ - r = (unsigned )TEXT_BASE ; - __asm__ __volatile__("mov pc, %0" : :"r" (r)); +while (1 ) { }/* hang */ }
arch/arm/lib/barebox.lds.S +0 -4
@@ -49,10 +49,6 @@ SECTIONS __bare_init_start = .; *(.text_bare_init*) __bare_init_end = .; -#ifdef CONFIG_BAREBOX_BARE_INIT_PADDING - . = (. + (CONFIG_BAREBOX_BARE_INIT_PADDING_SIZE)); - . = ALIGN(CONFIG_BAREBOX_BARE_INIT_PADDING_ALIGN); -#endif __exceptions_start = .; KEEP(*(.text_exceptions*)) __exceptions_stop = .;
arch/arm/mach-samsung/Kconfig +0 -1
@@ -98,7 +98,6 @@ config MACH_TINY210 select CPU_S5PV210 select MACH_HAS_LOWLEVEL_INIT select MACH_DO_LOWLEVEL_INIT - select BAREBOX_BARE_INIT_PADDING endchoice
arch/arm/mach-samsung/Makefile +0 -1
@@ -3,5 +3,4 @@ obj-lowlevel-$(CONFIG_ARCH_S3C24xx) += lowlevel-s3c24x0.o obj-lowlevel-$(CONFIG_ARCH_S5PCxx) += lowlevel-s5pcxx.o obj-$(CONFIG_ARCH_S3C24xx) += gpio-s3c24x0.o clocks-s3c24x0.o mem-s3c24x0.o obj-$(CONFIG_ARCH_S5PCxx) += gpio-s5pcxx.o clocks-s5pcxx.o mem-s5pcxx.o -obj-$(CONFIG_ARCH_S5PCxx) += s5p-irom-boot.o obj-$(CONFIG_S3C_LOWLEVEL_INIT) += $(obj-lowlevel-y)
arch/arm/mach-samsung/include/mach/s3c-generic.h +0 -1
@@ -42,5 +42,4 @@ void s3c24xx_disable_second_sdram_bank(void);#ifdef CONFIG_ARCH_S5PCxxvoid s5p_init_pll (void );void s5p_init_dram_bank (uint32_t base,uint32_t mc0,uint32_t mc1); -int s5p_irom_mmc_load (void *dest,uint32_t start_block,uint16_t block_count);#endif
arch/arm/mach-samsung/s5p-irom-boot.c deleted +0 -64
64 lines not on this page · raw message
common/Kconfig +0 -24
@@ -124,30 +124,6 @@ config BAREBOX_MAX_BARE_INIT_SIZE this will allow your bare_init will fit in SRAM as example ARCH can overwrite it via ARCH_BAREBOX_MAX_BARE_INIT_SIZE -config HAVE_BARE_INIT_PADDING - bool - -config BAREBOX_BARE_INIT_PADDING - depends on HAVE_BARE_INIT_PADDING - bool "Enable bare_init tail padding" - default n - help - Some architectures require that 1st stage loader is padded - with zeroes. This will add zero padding at the end of - bare_init block. If unsure, say n. - -config BAREBOX_BARE_INIT_PADDING_SIZE - depends on BAREBOX_BARE_INIT_PADDING - prompt "Minimal bare_init padding size" - hex - default 0x4 - -config BAREBOX_BARE_INIT_PADDING_ALIGN - depends on BAREBOX_BARE_INIT_PADDING - prompt "bare_init end alignment" - hex - default 0x200 - config HAVE_CONFIGURABLE_MEMORY_LAYOUT bool
Signature · 7 lines
1.7.10 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 8/9 S5P iROM boot support - improved
In reply to Alexey Galakhov--- arch/arm/boards/tiny210/lowlevel.c | 13 ++++- arch/arm/mach-samsung/Kconfig | 11 ++++ arch/arm/mach-samsung/Makefile | 1 + arch/arm/mach-samsung/include/mach/s5pcxx-irom.h | 32 ++++++++++++ arch/arm/mach-samsung/s5p-irom-boot.c | 59 ++++++++++++++++++++++ 5 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 arch/arm/mach-samsung/include/mach/s5pcxx-irom.h create mode 100644 arch/arm/mach-samsung/s5p-irom-boot.c
arch/arm/boards/tiny210/lowlevel.c +12 -1
@@ -23,12 +23,16 @@#include <init.h> #include <io.h> #include <asm/barebox-arm.h> +#include <asm/sections.h> #include <mach/s3c-iomap.h> #include <mach/s3c-clocks.h> #include <mach/s3c-generic.h> +#include <mach/s5pcxx-irom.h> + void __bare_init board_init_lowlevel(void) { +uint32_t r;#ifdef CONFIG_S3C_PLL_INIT s5p_init_pll ();
@@ -41,7 +45,14 @@ void __bare_init board_init_lowlevel(void)s5p_init_dram_bank (S5P_DMC0_BASE ,0x20E00323 ,0 );#endif -/* TODO: load barebox to DRAM here */ +#ifdef CONFIG_S5P_USE_IROM +/* FIXME this boots from MMC only */ +if (!s5p_irom_load_mmc ((void *)TEXT_BASE -16 ,1 , (barebox_image_size +16 +511 ) /512 )) +while (1 ) { }/* hang */ +#endif +/* Jump to SDRAM */ + r = (unsigned )TEXT_BASE ; + __asm__ __volatile__("mov pc, %0" : :"r" (r));while (1 ) { }/* hang */ }
arch/arm/mach-samsung/Kconfig +11 -0
@@ -98,6 +98,7 @@ config MACH_TINY210 select CPU_S5PV210 select MACH_HAS_LOWLEVEL_INIT select MACH_DO_LOWLEVEL_INIT + select S5P_USE_IROM endchoice
@@ -136,6 +137,16 @@ config S3C_NAND_BOOT Add generic support to boot from NAND flash. Image loading will be skipped if the code is running from NOR or already from SDRAM. +if ARCH_S5PCxx + +config S5P_USE_IROM + bool + prompt "Use iROM for booting" + help + Use CPU built-in iROM code for booting. If unsure, say N. + +endif + endmenu endif
arch/arm/mach-samsung/Makefile +1 -0
@@ -3,4 +3,5 @@ obj-lowlevel-$(CONFIG_ARCH_S3C24xx) += lowlevel-s3c24x0.o obj-lowlevel-$(CONFIG_ARCH_S5PCxx) += lowlevel-s5pcxx.o obj-$(CONFIG_ARCH_S3C24xx) += gpio-s3c24x0.o clocks-s3c24x0.o mem-s3c24x0.o obj-$(CONFIG_ARCH_S5PCxx) += gpio-s5pcxx.o clocks-s5pcxx.o mem-s5pcxx.o +obj-$(CONFIG_S5P_USE_IROM) += s5p-irom-boot.o obj-$(CONFIG_S3C_LOWLEVEL_INIT) += $(obj-lowlevel-y)
arch/arm/mach-samsung/include/mach/s5pcxx-irom.h new file +32 -0
@@ -0,0 +1,32 @@ +/* +* Copyright (C) 2012 Alexey Galakhov +* +* Based on code from u-boot found somewhere on the web +* that seems to originate from Samsung +* +* 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. +*/ + +/** +* Using iROM to boot is generally not a good idea. However we don't have +* another method of booting yet. +* TODO: implement NAND and SD booting and remove this file. +*/ + +#ifndef __S5PCXX_IROM_H +#define __S5PCXX_IROM_H + +#include <config.h> +#include <common.h> + +int __bare_init s5p_irom_load_mmc(void *dest, uint32_t start_block, uint16_t block_count); + +#endif /* __S5PCXX_IROM_H */
arch/arm/mach-samsung/s5p-irom-boot.c new file +59 -0
59 lines not on this page · raw message
Signature · 7 lines
1.7.10 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 9/9 S5P boot header and image generator
In reply to Alexey Galakhov--- .gitignore | 2 + arch/arm/Makefile | 7 +++ scripts/Makefile | 1 + scripts/s5p_cksum.c | 140 +++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 150 insertions(+) create mode 100644 scripts/s5p_cksum.c
.gitignore +2 -0
@@ -33,6 +33,7 @@ barebox.S barebox.bin barebox.srec barebox.netx +barebox.s5p barebox.map System.map Module.symvers
@@ -63,3 +64,4 @@ cscope.* # patches *.patch scripts/gen_netx_image +scripts/s5p_cksum
arch/arm/Makefile +7 -0
@@ -165,6 +165,13 @@ ifeq ($(machine-y),netx) KBUILD_IMAGE := barebox.netx endif +barebox.s5p: barebox.bin + $(Q)scripts/s5p_cksum barebox.bin barebox.s5p + +ifeq ($(CONFIG_ARCH_S5PCxx),y) +KBUILD_IMAGE := barebox.s5p +endif + MLO: barebox.bin @echo " IFT " $@ $(Q)scripts/omap_signGP barebox.bin $(TEXT_BASE) 1
scripts/Makefile +1 -0
@@ -10,6 +10,7 @@ hostprogs-y += mkimage hostprogs-y += bareboxenv hostprogs-$(CONFIG_ARCH_NETX) += gen_netx_image hostprogs-$(CONFIG_ARCH_OMAP) += omap_signGP +hostprogs-$(CONFIG_ARCH_S5PCxx) += s5p_cksum always := $(hostprogs-y) $(hostprogs-m)
scripts/s5p_cksum.c new file +140 -0
140 lines not on this page · raw message
Signature · 7 lines
1.7.10 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox