mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v3 0/7] Basic support for Armada 370/XP SOCs
@ 2013-05-09  9:52 Thomas Petazzoni
  2013-05-09  9:52 ` [PATCH v3 1/7] scripts: new kwbimage manipulation tool for Marvell SoC boot images Thomas Petazzoni
                   ` (9 more replies)
  0 siblings, 10 replies; 18+ messages in thread
From: Thomas Petazzoni @ 2013-05-09  9:52 UTC (permalink / raw)
  To: barebox; +Cc: Thomas Petazzoni, Lior Amsalem, Willy Tarreau, Ezequiel Garcia

Hello,

Here is a patch set that adds basic support for the Marvell Armada 370
and Armada XP SOCs. For now, the support is quite minimal, since only
the serial port is supported. However, a significant part of the work
has been the development of the tools that allow to extract/create
bootable images and to push a bootable image through the UART to the
hardware platform.

I expect to work on adding support for more devices (such as the
network interface) and possibly to add support for the older, but
popular, Marvell Kirkwood SoC family. Contributions are of course
welcome.

Changes since v2:

 - Use $(srctree) when accessing kwbimage.cfg from arch/arm/Makefile,
   in order to allow out-of-tree builds to work properly. Noticed by
   Grégory Clement.

 - Improve the error message displayed by kwbimage when the DDR3
   training blob cannot be found. Since it must first be extracted by
   the user, it is a good idea to guide him. Suggested by Grégory
   Clement.

 - Change the file name of the binary blobs for each board, in order
   to make it different for each board. So instead of being 'binary.0'
   it is know 'globalscale-mirabox-binary.0', etc. This allows to keep
   multiple binary blobs for different boards around at the same time.

Changes since v1:

 - Drop the patch fixing scripts/checkpatch.pl since it has been
   merged upstream.

 - Improve kwbimage to add options that allow to override the payload
   filename, the boot media, the destination address and execution
   address from the command line. Suggested by Sascha Hauer.

 - Add an integration of kwbimage to the Barebox build process. Now,
   when an ARCH_MVEBU platform is selected, a barebox.kwb file is
   automatically generated using the board kwbimage.cfg, and a
   barebox.kwbuart is generated using the board kwbimage.cfg + an
   override of the boot media to be UART.

 - Simplify the kwbimage.cfg to no longer contain the payload filename
   (it is passed by Barebox using kwbimage -p option), the destination
   and execution addresses (those are passed by Barebox using kwbimage
   -d and -e options, which allows to ensure they match
   CONFIG_TEXT_BASE).

 - Change the default boot media of the kwbimage.cfg to be the real
   boot media used on the platform, typically SPI or NAND. Since an
   image for UART is always automatically generated by overriding the
   boot media, it makes sense to have the real boot media in
   kwbimage.cfg.

 - Remove incorrect whitespace change in scripts/Makefile. Noticed by
   Sascha Hauer.

In detail, the patch set contains:

 * A kwbimage tool. This tool allows to extract existing bootloader
   images, and create new bootloader images. It is more or less
   similar in purpose to the kwbimage tool from U-Boot, but is capable
   of handling 'version 1' images used by Armada 370/XP, and not only
   allows to create images, but also extract images.

   A typical usage is to first extract an existing bootloader image:

    ./scripts/kwbimage -x -i <existing-image> -o <some-directory>

   As an output, you typically get 3 files: kwbimage.cfg (a text file
   that describes the configuration of the image in a format
   ressembling the one used by U-Boot), binary.0 (the binary blob that
   does the DDR3 training) and payload (the bootloader itself).

   Being able to extract an image is needed in order to get the DDR3
   training code, and re-use it with Barebox.

   An image is then later created with:

    ./scripts/kwbimage -c -i <path/to/kwbimage.cfg> -o <image>

   For each board, the kwbimage.cfg file is typically located in
   arch/arm/boards/<board-name>/. The DDR3 training code must however
   be extracted from an existing bootloader image of your board,
   usually the one provided by the board manufacturer.

 * A kwboot tool to push a bootloader through UART. It is directly
   taken from U-Boot source code, to which I've added some fixes:

   - Extend the timeouts, to actually make it work on Armada
     370/XP. This has originally been found by Willy Tarreau.

   - Ignore non-Xmodem characters, so that the original DDR3 training
     code can be used without modifications (Willy had to change it to
     make it output its messages on a different serial port, otherwise
     it was confusing the Xmodem implementation)

   - Output to stdout all the non-Xmodem characters so that if
     something goes wrong during the transfer, we have some
     informations. It also shows the messages output by the DDR3
     training code.

   - Remove the 'patch' feature that patches an image to have the UART
     type. This requires a knowledge of the header format, which is
     different between version 0 (kirkwood) and version 1 (armada
     370/xp). It is not really needed anyway since kwbimage can
     extract and create images.

 * The SoC-level code, which for now only consists in a minimal
   clocksource driver, a function to register an UART, a fixed-rate
   clock, and a function that determines the amount of RAM by looking
   at the SDRAM windows registers.

 * An integration of kwbimage generation. When an ARCH_MVEBU platform
   is selected, both barebox.kwb and barebox.kwbuart images are
   generated automatically.

 * The board-level code for the Armada 370 Mirabox from Globalscale,
   the Armada XP OpenBlocks AX3 from Plathome and the Armada XP GP
   from Marvell.

Best regards,

Thomas

Thomas Petazzoni (7):
  scripts: new kwbimage manipulation tool for Marvell SoC boot images
  scripts: add kwboot tool
  arm: initial support for Marvell Armada 370/XP SoCs
  arm: integrate kwbimage in the image generation
  arm: add basic support for Armada XP OpenBlocks AX3 platform
  arm: add basic support for the Armada 370 Mirabox platform
  arm: add basic support for the Armada XP GP platform

 Makefile                                           |    2 +-
 arch/arm/Kconfig                                   |    8 +
 arch/arm/Makefile                                  |   24 +
 arch/arm/boards/globalscale-mirabox/Makefile       |    2 +
 arch/arm/boards/globalscale-mirabox/config.h       |    4 +
 .../globalscale-mirabox/globalscale-mirabox.c      |   26 +
 arch/arm/boards/globalscale-mirabox/kwbimage.cfg   |    5 +
 arch/arm/boards/globalscale-mirabox/lowlevel.c     |   26 +
 arch/arm/boards/marvell-armada-xp-gp/Makefile      |    2 +
 arch/arm/boards/marvell-armada-xp-gp/config.h      |    4 +
 arch/arm/boards/marvell-armada-xp-gp/kwbimage.cfg  |    3 +
 arch/arm/boards/marvell-armada-xp-gp/lowlevel.c    |   25 +
 .../marvell-armada-xp-gp/marvell-armada-xp-gp.c    |   25 +
 arch/arm/boards/plathome-openblocks-ax3/Makefile   |    2 +
 arch/arm/boards/plathome-openblocks-ax3/config.h   |    4 +
 .../boards/plathome-openblocks-ax3/kwbimage.cfg    |    3 +
 arch/arm/boards/plathome-openblocks-ax3/lowlevel.c |   25 +
 .../plathome-openblocks-ax3.c                      |   25 +
 arch/arm/configs/globalscale_mirabox_defconfig     |    8 +
 arch/arm/configs/marvell_armada_xp_gp_defconfig    |   10 +
 arch/arm/configs/plathome_openblocks_ax3_defconfig |    9 +
 arch/arm/mach-mvebu/Kconfig                        |   54 +
 arch/arm/mach-mvebu/Makefile                       |    1 +
 arch/arm/mach-mvebu/core.c                         |  142 ++
 arch/arm/mach-mvebu/include/mach/clkdev.h          |    7 +
 arch/arm/mach-mvebu/include/mach/debug_ll.h        |   40 +
 arch/arm/mach-mvebu/include/mach/mvebu.h           |   22 +
 drivers/clocksource/Kconfig                        |    4 +
 drivers/clocksource/Makefile                       |    1 +
 drivers/clocksource/mvebu.c                        |   90 ++
 scripts/.gitignore                                 |    2 +
 scripts/Makefile                                   |    1 +
 scripts/kwbimage.c                                 | 1448 ++++++++++++++++++++
 scripts/kwboot.c                                   |  717 ++++++++++
 34 files changed, 2770 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boards/globalscale-mirabox/Makefile
 create mode 100644 arch/arm/boards/globalscale-mirabox/config.h
 create mode 100644 arch/arm/boards/globalscale-mirabox/globalscale-mirabox.c
 create mode 100644 arch/arm/boards/globalscale-mirabox/kwbimage.cfg
 create mode 100644 arch/arm/boards/globalscale-mirabox/lowlevel.c
 create mode 100644 arch/arm/boards/marvell-armada-xp-gp/Makefile
 create mode 100644 arch/arm/boards/marvell-armada-xp-gp/config.h
 create mode 100644 arch/arm/boards/marvell-armada-xp-gp/kwbimage.cfg
 create mode 100644 arch/arm/boards/marvell-armada-xp-gp/lowlevel.c
 create mode 100644 arch/arm/boards/marvell-armada-xp-gp/marvell-armada-xp-gp.c
 create mode 100644 arch/arm/boards/plathome-openblocks-ax3/Makefile
 create mode 100644 arch/arm/boards/plathome-openblocks-ax3/config.h
 create mode 100644 arch/arm/boards/plathome-openblocks-ax3/kwbimage.cfg
 create mode 100644 arch/arm/boards/plathome-openblocks-ax3/lowlevel.c
 create mode 100644 arch/arm/boards/plathome-openblocks-ax3/plathome-openblocks-ax3.c
 create mode 100644 arch/arm/configs/globalscale_mirabox_defconfig
 create mode 100644 arch/arm/configs/marvell_armada_xp_gp_defconfig
 create mode 100644 arch/arm/configs/plathome_openblocks_ax3_defconfig
 create mode 100644 arch/arm/mach-mvebu/Kconfig
 create mode 100644 arch/arm/mach-mvebu/Makefile
 create mode 100644 arch/arm/mach-mvebu/core.c
 create mode 100644 arch/arm/mach-mvebu/include/mach/clkdev.h
 create mode 100644 arch/arm/mach-mvebu/include/mach/debug_ll.h
 create mode 100644 arch/arm/mach-mvebu/include/mach/mvebu.h
 create mode 100644 drivers/clocksource/mvebu.c
 create mode 100644 scripts/kwbimage.c
 create mode 100644 scripts/kwboot.c

-- 
1.7.9.5


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2013-05-12 11:15 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-09  9:52 [PATCH v3 0/7] Basic support for Armada 370/XP SOCs Thomas Petazzoni
2013-05-09  9:52 ` [PATCH v3 1/7] scripts: new kwbimage manipulation tool for Marvell SoC boot images Thomas Petazzoni
2013-05-09  9:52 ` [PATCH v3 2/7] scripts: add kwboot tool Thomas Petazzoni
2013-05-09 11:16   ` Jason Cooper
2013-05-10 13:25     ` Sascha Hauer
2013-05-09  9:52 ` [PATCH v3 3/7] arm: initial support for Marvell Armada 370/XP SoCs Thomas Petazzoni
2013-05-12 11:14   ` antonynpavlov
2013-05-09  9:52 ` [PATCH v3 4/7] arm: integrate kwbimage in the image generation Thomas Petazzoni
2013-05-09  9:52 ` [PATCH v3 5/7] arm: add basic support for Armada XP OpenBlocks AX3 platform Thomas Petazzoni
2013-05-09  9:52 ` [PATCH v3 6/7] arm: add basic support for the Armada 370 Mirabox platform Thomas Petazzoni
2013-05-09  9:52 ` [PATCH v3 7/7] arm: add basic support for the Armada XP GP platform Thomas Petazzoni
2013-05-09 13:33 ` [PATCH v3 0/7] Basic support for Armada 370/XP SOCs Gregory CLEMENT
2013-05-11 15:27 ` Sascha Hauer
2013-05-11 16:27   ` Thomas Petazzoni
2013-05-12  7:56 ` Sascha Hauer
2013-05-12  9:12   ` Thomas Petazzoni
2013-05-12 10:24     ` Sascha Hauer
2013-05-12 10:41       ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox