From: Michael Grzeschik <mgr@pengutronix.de>
To: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/3] scripts: add socfpga preloader-files importer
Date: Thu, 19 Feb 2015 00:04:55 +0100 [thread overview]
Message-ID: <20150218230455.GG21880@pengutronix.de> (raw)
In-Reply-To: <1424260458-19639-2-git-send-email-s.trumtrar@pengutronix.de>
On Wed, Feb 18, 2015 at 12:54:16PM +0100, Steffen Trumtrar wrote:
> Add script to automatically import and fixup the autogenerated handoff files
> into the board folder.
>
> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
> ---
> Documentation/boards/socfpga.rst | 10 ++++--
> scripts/socfpga_import_preloader | 69 ++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 77 insertions(+), 2 deletions(-)
> create mode 100755 scripts/socfpga_import_preloader
>
> diff --git a/Documentation/boards/socfpga.rst b/Documentation/boards/socfpga.rst
> index 70f959b32570..e956bccbe24a 100644
> --- a/Documentation/boards/socfpga.rst
> +++ b/Documentation/boards/socfpga.rst
> @@ -67,8 +67,14 @@ To update the handoff files, the following procedure is necessary::
> 6. Select the directory `hps_isw_handoff/soc_system_hps_0` under the
> preloader settings directory
> 7. Click ``Ok`` than ``Generate``
> - 8. Copy the files generated in `software/spl_bsp/generated/` to your
> - board folder
> +
> +Now run the command::
> +
> + scripts/socfpga_import_preloader <SPL_GENERATED_DIR> <ISW_HANDOFF> <BOARD_DIRECTORY>
> +
> +where `<SPL_GENERATED_DIR>` is the directory where the bsp-editor generated the files,
> +`<ISW_HANDOFF>` is the directory where Quartus generated the handoff files, and
> +`<BOARD_DIRECTORY>` is your board directory under `arch/arm/boards`.
>
> The following files are generic and belong into the
> `arch/arm/mach-socfpga` directory tree:
> diff --git a/scripts/socfpga_import_preloader b/scripts/socfpga_import_preloader
> new file mode 100755
> index 000000000000..d52b1e8ab0b2
> --- /dev/null
> +++ b/scripts/socfpga_import_preloader
> @@ -0,0 +1,69 @@
> +#!/bin/bash
> +
> +if [ "$#" -lt "2" ]
> +then
> + echo "USAGE: $0 <SPL_GENERATED_DIR> <ISW_HANDOFF> <BOARD_DIRECTORY>"
> + echo "EXAMPLE: $0 ~/cv_soc_devkit_ghrd/software/spl_bsp/generated ~/cv_soc_devkit_ghrd/hps_isw_handoff/soc_system_hps_0/ arch/arm/boards/altera-socdk"
> + exit 1
> +fi
> +
> +splroot=$1
> +handoff=$2
> +boardroot=$3
> +bareboxsrc=.
> +
> +cd ${bareboxsrc}
> +
> +copy_source() {
> + local src
> + local tgt
> + src=$1
> + tgt=$2
> +
> + echo "Merging source code $src to $tgt"
> +
> + cp $src $tgt
> +
> + unifdef -D HCX_COMPAT_MODE=1 -D ENABLE_INST_ROM_WRITE=1 $tgt -o $tgt
> +
> + echo " Fixing extern/static keywords..."
> + # Statify all global variables with missing static keyword
> + sed -i 's/^const /static const /g' $tgt
> +
> + echo " Remove unused defines..."
> + # Statify all global variables with missing static keyword
This seems like an copy paste mistake.
> + sed -i 's/\[CONFIG_HPS_PINMUX_NUM\]/\[\]/g' $tgt
> +
> + echo " Translating altera int types..."
> + # Replace altera types
> + sed -i 's/alt_u32/uint32_t/g' $tgt
> + sed -i 's/alt_u16/uint16_t/g' $tgt
> + sed -i 's/alt_16/int16_t/g' $tgt
> + sed -i 's/alt_32/int32_t/g' $tgt
> + sed -i 's/alt_u8/uint8_t/g' $tgt
> + sed -i 's/alt_8/int8_t/g' $tgt
> + sed -i 's/#include "alt_types.h"//g' $tgt
> +
> + echo " Fixing include pathes..."
> + # Fix include pathes
> + sed -i 's/#include <iocsr_config_cyclone5.h>/#include <mach\/scan-manager.h>/g' $tgt
> + sed -i 's/#include <pinmux_config.h>/#include <common.h>/g' $tgt
> + sed -i 's/#include "sequencer_auto.h"//g' $tgt
> + sed -i 's/#include "sequencer_defines.h"//g' $tgt
> +
> + echo " Automated readability fixup..."
> + indent -npro -kr -i8 -ts8 -sob -l100 -ss -ncs -cp1 -il0 $tgt
> + sed -i 's/ $//g' $tgt
> +}
> +
> +copy_source ${splroot}/iocsr_config_cyclone5.c ${boardroot}/iocsr_config_cyclone5.c
> +copy_source ${splroot}/pinmux_config_cyclone5.c ${boardroot}/pinmux_config.c
> +copy_source ${splroot}/pll_config.h ${boardroot}/pll_config.h
> +copy_source ${splroot}/sdram/sdram_config.h ${boardroot}/sdram_config.h
> +
> +copy_source ${handoff}/sequencer_auto.h ${boardroot}/sequencer_auto.h
> +copy_source ${handoff}/sequencer_auto_ac_init.c ${boardroot}/sequencer_auto_ac_init.c
> +copy_source ${handoff}/sequencer_auto_inst_init.c ${boardroot}/sequencer_auto_inst_init.c
> +copy_source ${handoff}/sequencer_defines.h ${boardroot}/sequencer_defines.h
> +
> +echo "DONE"
> --
> 2.1.4
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2015-02-18 23:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-18 11:54 [PATCH 0/3] Socfpga: handoff importer updates + SOCDK support Steffen Trumtrar
2015-02-18 11:54 ` [PATCH 1/3] scripts: add socfpga preloader-files importer Steffen Trumtrar
2015-02-18 23:04 ` Michael Grzeschik [this message]
2015-02-18 11:54 ` [PATCH 2/3] scripts: socfpga: add coccinelle magic Steffen Trumtrar
2015-02-18 11:54 ` [PATCH 3/3] ARM: socfpga: add Altera SoCFPGA Development Kit support Steffen Trumtrar
2015-02-19 19:58 ` Sascha Hauer
2015-02-20 7:49 ` Steffen Trumtrar
2015-02-23 7:34 ` Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150218230455.GG21880@pengutronix.de \
--to=mgr@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=s.trumtrar@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox