Am Dienstag, 15. März 2011, um 10:00:15 schrieb Michael Olbrich: > Hi, > > some comments inline. Just a few things I noticed for now. I don't have the > time right now for a more detailed review.
Hi Michael, thanks a lot for your time ... my answers see below. br Stephan > > Michael > > On Mon, Mar 14, 2011 at 04:21:29PM +0100, Stephan Linz wrote: > > This is support for Xilinx MicroBlaze processors. MicroBlaze > > is a soft core processor designed for Xilinx FPGAs. With this > > new architecture ptxdist have to handle dynamic platform > > configurations exported by Xilinx design tools. > > > > Some essential changes and extensions inside a few ptxdist core > > scripts were made to merge external platform configurations into > > the ptxdist platform configuration. That is very important since > > the resulting build process have to know about the real CPU > > features like hardware multiplier, barrel shifter or similar high > > performance accelerators. > > > > So ptxdist knows about this specialty, parse the new platform > > directory "xlbsp" and use the content for its own platform > > configuration. The content of the new platform directory "xlbsp" > > comes from Xilinx design tools and have to be: > > * auto-config.in (Linux Kernel 2.4 configuration) > > * Kconfig.auto (Linux Kernel 2.6 configuration) > > * xilinx.dts (Linux Kernel 2.6 configuration) > > * config.mk (U-Boot configuration) > > * xparameters.h (U-Boot configuration) > > Which file contains the definitions for XILINX_MICROBLAZE0_*? in Kconfig.auto (se attachment for a example) auto-config.in provides the old 2.4 configuration (currently unsupported) > I think it > should go to platforms/. Also I'm not comfortable with using options that > are provided externaly. Why not import like we do with busybox? Ah, good idea. I'll try out to import. > > > Signed-off-by: Stephan Linz <[email protected]> > > --- > > platforms/architecture.in | 9 ++ > > platforms/kernel.in | 9 ++- > > platforms/microblaze.in | 33 +++++++ > > platforms/xlbsp_softcpu.in | 25 +++++ > > rules/post/ptxd_make_xilinx_bsp.make | 41 ++++++++ > > rules/pre/Machine.make | 68 ++++++++++++++ > > rules/pre/Rules.make | 4 +- > > scripts/lib/ptxd_lib_00-init.sh | 3 + > > scripts/lib/ptxd_lib_kgen.sh | 3 +- > > scripts/lib/ptxd_make_00-init.sh | 5 + > > scripts/lib/ptxd_make_xilinx_bsp.sh | 167 > > ++++++++++++++++++++++++++++++++++ 11 files changed, 363 insertions(+), 4 > > deletions(-) > > create mode 100644 platforms/microblaze.in > > create mode 100644 platforms/xlbsp_softcpu.in > > create mode 100644 rules/post/ptxd_make_xilinx_bsp.make > > create mode 100644 rules/pre/Machine.make > > create mode 100644 scripts/lib/ptxd_make_xilinx_bsp.sh > > > > diff --git a/platforms/architecture.in b/platforms/architecture.in > > --snip-- > > diff --git a/platforms/kernel.in b/platforms/kernel.in > > index 476bdde..0d8702e 100644 > > --- a/platforms/kernel.in > > +++ b/platforms/kernel.in > > @@ -83,6 +83,7 @@ config KERNEL_ARCH_STRING > > default "blackfin" if ARCH_BLACKFIN > > default "m68k" if ARCH_M68K > > default "sparc" if ARCH_SPARC > > + default "microblaze" if ARCH_MICROBLAZE > > default "mips" if ARCH_MIPS > > default "mips" if ARCH_MIPSEL > > default "cris" if ARCH_CRIS > > @@ -142,11 +143,16 @@ choice > > help > > This is the target to get the kernel image as an raw > > uncompressed > > binary file. > > + > > +if KERNEL_ARCH_POWERPC || ARCH_MICROBLAZE > > why make this conditional? I believe only PPC and Microblaze provides a simple image, or not? For all other acrhitectures it is useless and causes malfunctions. > > > + > > config KERNEL_IMAGE_SIMPLE > > bool > > prompt "simpleImage" > > help > > Create a simple Image with embedded DTB > > +endif > > + > > endchoice > > > > if KERNEL_IMAGE_SIMPLE > > @@ -182,7 +188,8 @@ config KERNEL_IMAGE > > default "vmImage" if KERNEL_IMAGE_VM > > default "vmlinux" if KERNEL_IMAGE_VMLINUX > > default "Image" if KERNEL_IMAGE_RAW > > - default "simpleImage.${PTXCONF_KERNEL_IMAGE_SIMPLE_TARGET}.elf" if > > KERNEL_IMAGE_SIMPLE + default > > "simpleImage.${PTXCONF_KERNEL_IMAGE_SIMPLE_TARGET}.elf" if > > KERNEL_IMAGE_SIMPLE && KERNEL_ARCH_POWERPC > > ... if KERNEL_IMAGE_SIMPLE && !ARCH_MICROBLAZE > maybe? It is uggly, I know. But in contrast to PPC the Microblaze port will generate a simple image without .elf suffix. That's why we have to make a distinction. > > > + default "simpleImage.${PTXCONF_KERNEL_IMAGE_SIMPLE_TARGET}" if > > KERNEL_IMAGE_SIMPLE && ARCH_MICROBLAZE > > > > config KERNEL_XZ > > prompt "build xz-utils hosttool" > > diff --git a/platforms/microblaze.in b/platforms/microblaze.in > > --snip-- > > diff --git a/platforms/xlbsp_softcpu.in b/platforms/xlbsp_softcpu.in > > --snip-- > > diff --git a/rules/post/ptxd_make_xilinx_bsp.make > > b/rules/post/ptxd_make_xilinx_bsp.make new file mode 100644 > > index 0000000..325714e > > --- /dev/null > > +++ b/rules/post/ptxd_make_xilinx_bsp.make > > @@ -0,0 +1,41 @@ > > +# -*-makefile-*- > > +# > > +# Copyright (C) 2011 by Stephan Linz <[email protected]> > > +# > > +# See CREDITS for details about who has contributed to this project. > > +# > > +# For further information about the PTXdist project and license > > conditions +# see the README file. > > +# > > + > > +ifeq ($(PTXCONF_ARCH_MICROBLAZE),y) > > ifdef PTXCONF_ARCH_MICROBLAZE > > the same in other places. > This part of make dependecies ar really new to ptxdist and only useful for Microblaze architectures. So I have introduced more strictness to handle all xlbsp related parts. Becaus Microblaze is a soft core processor and one important thing is the reconfiguration of the whole hardware design. The FPGA design flow produces four auto generated files which describe the hardware (Kconfig.auto, xilinx.dts, config.mk, xparameters.h). This files have to being part of Linux and U-Boot source code in a completely other way as a simple patch. This why this strictness. > > + > > +ifeq ($(PTXCONF_ARCH_MICROBLAZE_HAVE_XLBSP),y) > > +$(STATEDIR)/u-boot.prepare: $(STATEDIR)/u-boot.xlbsp > > +endif > > + > > +ifeq ($(PTXCONF_ARCH_MICROBLAZE_HAVE_XLBSP),y) > > +$(STATEDIR)/kernel.prepare: $(STATEDIR)/kernel.xlbsp > > +endif > > + > > +ifeq ($(PTXCONF_KERNEL_IMAGE_SIMPLE),y) > > +SEL_ROOTFS-$(PTXCONF_IMAGE_KERNEL) += $(IMAGEDIR)/linuximage.ub > > +endif > > + > > +$(IMAGEDIR)/linuximage.ub: $(KERNEL_IMAGE_PATH_y).ub > > $(IMAGEDIR)/linuximage + @echo -n "Creating '$(notdir $(@))' from > > '$(notdir $(<))'..." > > + @install -m 644 "$(<)" "$(@)" > > + @echo "done." One word to this ugly part: Whenever a Linux simple image will generate (for Microblaze) a U-Boot image of this simple image will generated too. There is no other way to get a uImage (the Microblaze port doesn't know about uImage). > > + > > +endif > > + > > +$(STATEDIR)/%.xlbsp: $(STATEDIR)/%.extract > > + @$(call targetinfo) > > + @$(call xilinx/bsp, $(PTX_MAP_TO_PACKAGE_$(*)), > > $($(PTX_MAP_TO_PACKAGE_$(*))_DIR)) + @$(call touch) > > + > > +xilinx/bsp = \ > > + $(call world/env, $(1)) \ > > + ptxd_make_xilinx_bsp > > + > > +# vim: syntax=make > > diff --git a/rules/pre/Machine.make b/rules/pre/Machine.make > > --snip-- > > diff --git a/scripts/lib/ptxd_lib_00-init.sh > > b/scripts/lib/ptxd_lib_00-init.sh index 02a48e7..64d09e1 100644 > > --- a/scripts/lib/ptxd_lib_00-init.sh > > +++ b/scripts/lib/ptxd_lib_00-init.sh > > @@ -101,6 +101,9 @@ ptxd_init_ptxdist_path() { > > PTXDIST_PATH_PLATFORMS="${PTXDIST_PATH//://platforms:}" > > export PTXDIST_PATH_PLATFORMS > > > > + PTXDIST_PATH_XLBSP="${PTXDIST_PATH//://xlbsp:}" > > + export PTXDIST_PATH_XLBSP > > + > > ptxd_init_ptxdist_path_sysroot > > } > > > > diff --git a/scripts/lib/ptxd_lib_kgen.sh b/scripts/lib/ptxd_lib_kgen.sh > > index 2ab7ca0..6705d20 100644 > > --- a/scripts/lib/ptxd_lib_kgen.sh > > +++ b/scripts/lib/ptxd_lib_kgen.sh > > @@ -58,6 +58,7 @@ ptxd_kgen_generate_sections() > > fi > > # '! -name ".#*"' filters out emacs's lock files > > find "${dir}/" -name *.in \! -name ".#*" -print0 > > + find "${dir}/" -name *.auto \! -name ".#*" -print0 > > done > > } | { > > # > > @@ -91,7 +92,7 @@ EOF > > local oldIFS="$IFS" > > case "${kgen_part}" in > > ptx) IFS=: kgen_dirs=( ${PTXDIST_PATH_RULES} ) ;; > > - platform) IFS=: kgen_dirs=( ${PTXDIST_PATH_PLATFORMS} ) ;; > > + platform) IFS=: kgen_dirs=( ${PTXDIST_PATH_PLATFORMS} > > ${PTXDIST_PATH_XLBSP} ) ;; board|user|collection) return 0 ;; > > *) cat <<EOF > > I don't like these changes. If it goes into platformconfig the file should > be in PTXDIST_PATH_PLATFORMS and named *.in dito, I try to use the BusyBox way. I'll get back to you. > > > diff --git a/scripts/lib/ptxd_make_00-init.sh > > --snip-- > > diff --git a/scripts/lib/ptxd_make_xilinx_bsp.sh > > b/scripts/lib/ptxd_make_xilinx_bsp.sh new file mode 100644 > > index 0000000..1d74f2d > > --- /dev/null > > +++ b/scripts/lib/ptxd_make_xilinx_bsp.sh > > @@ -0,0 +1,167 @@ > > +#!/bin/bash > > +# > > --snip-- > > +# > > +ptxd_make_xilinx_bsp_apply_init() > > +{ > > + local path="${PTXDIST_PATH_XLBSP//:/ }" > > + > > + # find patch_dir > > + if ! ptxd_get_path "${path}"; then > > ptxd_in_path PTXDIST_PATH_XLBSP OK, I do so. > > > + echo "xlbsp: no Xilinx BSP found" > > + return > > + fi > > + pkg_xlbsp_dir="${ptxd_reply}" > > + > > +} > > +export -f ptxd_make_xilinx_bsp_apply_init > > + > > + > > +# > > +# apply Xilinx BSP for U-Boot > > +# > > +ptxd_make_xilinx_bsp_apply_uboot() > > +{ > > + local \ > > + ptx_xlbsp_uboot_cfg="$(ptxd_get_ptxconf PTXCONF_U_BOOT_CONFIG)" \ > > + pkg_xlbsp_uboot_files="${pkg_xlbsp_dir}/config.mk \ > > + ${pkg_xlbsp_dir}/xparameters.h" \ > > + pkg_xlbsp_uboot_file \ > > + ptx_xlbsp_uboot_dir > > local <varname>=<value> > for each var, is better. OK. > > > --snip-- -- Viele Grüße, Stephan Linz ______________________________________________________________________________ MB-Ref: http://www.li-pro.de/xilinx_mb:mbref:start OpenDCC: http://www.li-pro.net/opendcc.phtml PC/M: http://www.li-pro.net/pcm.phtml CDK4AVR: http://cdk4avr.sourceforge.net/ CDK4NIOS: http://cdk4nios.sourceforge.net/ CDK4MSP: http://cdk4msp.sourceforge.net/ CPM4L: http://download.opensuse.org/repositories/home:/rexut:/CPM4L
# # (C) Copyright 2007-2009 Michal Simek # Michal SIMEK <[email protected]> # # (C) Copyright 2010 Li-Pro.Net # Stephan Linz <[email protected]> # # 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. # # 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 # # CAUTION: This file is automatically generated by libgen. # Version: Xilinx EDK 12.4 EDK_MS4.81d # Description: Linux 2.6 Configurations # # Generate by linux-v1.00.a # Project description at http://www.monstr.eu/ # ## SECTION=xlbsp_softcpu # Project name comment "Project name" config PROJECT_NAME string "Project name" default "Xilinx-SP3ADSP1800-MMU-full-12.4" # Microblaze is microblaze_0 comment "Microblaze is microblaze_0" config XILINX_MICROBLAZE0_FAMILY string "Targetted FPGA family" default "spartan3adsp" config XILINX_MICROBLAZE0_USE_MSR_INSTR int "USE_MSR_INSTR range (0:1)" default 1 config XILINX_MICROBLAZE0_USE_PCMP_INSTR int "USE_PCMP_INSTR range (0:1)" default 1 config XILINX_MICROBLAZE0_USE_BARREL int "USE_BARREL range (0:1)" default 1 config XILINX_MICROBLAZE0_USE_DIV int "USE_DIV range (0:1)" default 1 config XILINX_MICROBLAZE0_USE_HW_MUL int "USE_HW_MUL values (0=NONE, 1=MUL32, 2=MUL64)" default 1 config XILINX_MICROBLAZE0_USE_FPU int "USE_FPU values (0=NONE, 1=BASIC, 2=EXTENDED)" default 1 config XILINX_MICROBLAZE0_HW_VER string "Core version number" default "8.00.b" # System memory is mpmc_0 comment "System memory is mpmc_0" config KERNEL_BASE_ADDR hex "Physical address where Linux Kernel is" default 0x20000000
-- ptxdist mailing list [email protected]
