Re: [yocto] Question about remote debugging via gdbserver
Goodmorning Rudolf, thank you again for your time. I have not explained my goal very well, so I try to explain with a specific example. I'm working with gstreamer for a project I'm following for my company. Let's take the gstreamer hello world application, here is the source code: http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-helloworld.html#section-helloworld I've succesfully built and deployed the application. I can debug and follow the code of the application line by line with eclipse. Now, if I want to enter into a function of gstreamer libs (e.g. gst_pipeline_new), what should I have to do? Federico 2014-04-16 21:22 GMT+02:00 Rudolf Streif rstr...@linuxfoundation.org: Hi Federico, I knew that I can add source paths to the debugger. Ok, if that's not the issue what exactly is not working for you? I see in your debug profiles that you have some binaries eg ls. Did you import that binary from sysrootfs on your build machine? Can you please tell me the steps before adding the path? No, that's actually sample code of a simple ls application that I use for teaching a class on Linux APIs. Cheers, Rudi -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
Re: [yocto] [OE-core] [PATCH] u-boot: fix beaglebone boot issue with large kernel images
On Thu, 2014-04-17 at 15:05 -0400, Denys Dmytriyenko wrote: From: Denys Dmytriyenko de...@ti.com Fix beaglebone boot issue with large kernel images overwriting Device Tree. See very detailed comments inside the patch. The original patch is being reviewed upstream and is targeting mainline U-boot version 2014.07. This is the adaptation of the patch for 2013.07 version we use Signed-off-by: Denys Dmytriyenko de...@ti.com Thank you Denys, this works great. With a new u-boot.img I could boot any kernel that before wouldn't boot. Cheers, Stefan --- ...h-Add-use-DEFAULT_LINUX_BOOT_ENV-environm.patch | 74 ++ meta/recipes-bsp/u-boot/u-boot_2013.07.bb | 4 +- 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-bsp/u-boot/files/0001-am335x_evm.h-Add-use-DEFAULT_LINUX_BOOT_ENV-environm.patch diff --git a/meta/recipes-bsp/u-boot/files/0001-am335x_evm.h-Add-use-DEFAULT_LINUX_BOOT_ENV-environm.patch b/meta/recipes-bsp/u-boot/files/0001-am335x_evm.h-Add-use-DEFAULT_LINUX_BOOT_ENV-environm.patch new file mode 100644 index 000..77e35bb --- /dev/null +++ b/meta/recipes-bsp/u-boot/files/0001-am335x_evm.h-Add-use-DEFAULT_LINUX_BOOT_ENV-environm.patch @@ -0,0 +1,74 @@ +From 5701384cea4a829b772bf7a96a74825b58c22385 Mon Sep 17 00:00:00 2001 +From: Denys Dmytriyenko de...@ti.com +Date: Thu, 17 Apr 2014 12:25:40 -0400 +Subject: [PATCH] am335x_evm.h: Add, use DEFAULT_LINUX_BOOT_ENV environment + string + +Modified version of the patch currently being reviewed for mainline: +http://patchwork.ozlabs.org/patch/334861/ + +To deal with a reoccurring problem properly we need to specify addresses +for the Linux kernel, Flatted Device Tree and ramdisk that obey the +constraints within the kernel's Documentation/arm/Booting file but also +make sure that we relocate things within a valid address range. + +Signed-off-by: Denys Dmytriyenko de...@ti.com +Signed-off-by: Tom Rini tr...@ti.com + +Upstream-Status: Pending +--- + include/configs/am335x_evm.h | 31 ++- + 1 file changed, 26 insertions(+), 5 deletions(-) + +diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h +index c5a6d4b..01e32b3 100644 +--- a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h +@@ -54,10 +54,7 @@ + #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG + #ifndef CONFIG_SPL_BUILD + #define CONFIG_EXTRA_ENV_SETTINGS \ +-loadaddr=0x8020\0 \ +-fdtaddr=0x80F8\0 \ +-fdt_high=0x\0 \ +-rdaddr=0x8100\0 \ ++DEFAULT_LINUX_BOOT_ENV \ + bootdir=/boot\0 \ + bootfile=uImage\0 \ + fdtfile=undefined\0 \ +@@ -197,7 +194,31 @@ + #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START \ + + (8 * 1024 * 1024)) + +-#define CONFIG_SYS_LOAD_ADDR0x8100 /* Default load address */ ++/* ++ * Our DDR memory always starts at 0x8000 and U-Boot shall have ++ * relocated itself to higher in memory by the time this value is used. ++ * However, set this to a 32MB offset to allow for easier Linux kernel ++ * booting as the default is often used as the kernel load address. ++ */ ++#define CONFIG_SYS_LOAD_ADDR0x8200 /* Default load address */ ++ ++/* ++ * We setup defaults based on constraints from the Linux kernel, which should ++ * also be safe elsewhere. We have the default load at 32MB into DDR (for ++ * the kernel), FDT above 128MB (the maximum location for the end of the ++ * kernel), and the ramdisk 512KB above that (allowing for hopefully never ++ * seen large trees). We say all of this must be within the first 256MB ++ * as that will normally be within the kernel lowmem and thus visible via ++ * bootm_size and we only run on platforms with 256MB or more of memory. ++ */ ++#define DEFAULT_LINUX_BOOT_ENV \ ++loadaddr=0x8200\0 \ ++kernel_addr_r=0x8200\0 \ ++fdtaddr=0x8800\0 \ ++fdt_addr_r=0x8800\0 \ ++rdaddr=0x8808\0 \ ++ramdisk_addr_r=0x8808\0 \ ++bootm_size=0x1000\0 + + #define CONFIG_MMC + #define CONFIG_GENERIC_MMC +-- +1.9.2 + diff --git a/meta/recipes-bsp/u-boot/u-boot_2013.07.bb b/meta/recipes-bsp/u-boot/u-boot_2013.07.bb index 3141a2d..f8a8856 100644 --- a/meta/recipes-bsp/u-boot/u-boot_2013.07.bb +++ b/meta/recipes-bsp/u-boot/u-boot_2013.07.bb @@ -16,7 +16,9 @@ SRCREV = 62c175fbb8a0f9a926c88294ea9f7e88eb898f6c PV = v2013.07+git${SRCPV} -SRC_URI = git://git.denx.de/u-boot.git;branch=master +SRC_URI = git://git.denx.de/u-boot.git;branch=master \ + file://0001-am335x_evm.h-Add-use-DEFAULT_LINUX_BOOT_ENV-environm.patch \ + S = ${WORKDIR}/git -- 1.9.2 -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
[yocto] [meta-raspberrypi][PATCH] xserver-xf86-config: remove changes of THISDIR and FILESPATH
THISDIR and FILESPATH are not supposed to be changed from within recipes. This was causing troubles with other bbappend. Change-Id: I7c3c788ddb61b0b790a9fe06f86e4bd93a822c8c Signed-off-by: Michaël Burtin mbur...@connected-labs.com --- recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend | 3 --- 1 file changed, 3 deletions(-) diff --git a/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend b/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend index 3e86645..0b4dc31 100644 --- a/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend +++ b/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend @@ -3,9 +3,6 @@ FILESEXTRAPATHS_prepend := ${THISDIR}/${PN}: # Don't forget to bump PRINC if you update the extra files. PRINC := ${@int(PRINC) + 5} -THISDIR := ${@os.path.dirname(bb.data.getVar('FILE', d, True))} -FILESPATH =. ${@base_set_filespath([${THISDIR}/${PN}], d)}: - SRC_URI_append_raspberrypi = file://xorg.conf.d/10-evdev.conf do_install_append_raspberrypi () { -- 1.9.1 -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
Re: [yocto] BBB doesn't boot
On 04/17/2014 08:13 PM, Denys Dmytriyenko wrote: On Thu, Apr 17, 2014 at 04:25:51PM -0700, Khem Raj wrote: On Thu, Apr 17, 2014 at 2:31 PM, William Mills wmi...@ti.com wrote: On 04/17/2014 03:10 PM, Denys Dmytriyenko wrote: On Tue, Apr 15, 2014 at 05:07:10PM -0600, Gary Thomas wrote: On 2014-04-15 13:43, Denys Dmytriyenko wrote: On Tue, Apr 15, 2014 at 01:41:12PM -0400, Denys Dmytriyenko wrote: Some other things I tried with a long TMPDIR path (note that it's the TMPDIR path that makes the difference - in my tests I've been using /home/paul/poky/build2/much/longer/path/to/tmp). None of this helped: * kernel built with gcc 4.7.2 and binutils 2.23.2 * u-boot built with gcc 4.7.2 and binutils 2.23.2 * u-boot from http://downloads.angstrom-distribution.org/demo/beaglebone/ * earlyprintk and CONFIG_DEBUG_LL - no additional output printed I think we're now at the point where we'd benefit from someone with better knowledge debugging the issue. Ok, should we expand the search area? Since this is supposed to be vanilla 3.14 kernel, can we try other platforms and see if they are similarly affected? I'll try pinging our kernel guys for any ideas... As far as I know it has only been observed with beaglebone (both white and black, if it makes a difference). FWIW, qemuarm images from the autobuilder boot just fine, and apparently the same is true of edgerouter (different architecture but also uses u-boot). But do those other platforms use uImage or zImage? I don't yet know what is going on, but building in the same directory with sources (B = S) makes it work regarless of the path length: /OE/RAM/poky-1///tmp/work/beaglebone-poky-linux-gnueabi/linux-yocto/3.14+gitAUTOINC+928d7b2dda_0143c6ebb4-r0/linux So, I just commented out setting kernel-specific B in linux-yocto.inc and any kernel now boots with long path: #B = ${WORKDIR}/linux-${PACKAGE_ARCH}-${LINUX_KERNEL_TYPE}-build I'm copying Richard and Bruce directly to see if they may have a quick insight and/or accept it as a workaround for the release. I'll keep digging further, but if anyone cares to verify the above workaround works for them, I would appreciate. Thanks! Verified - I rebuilt the kernel in a working tree with a longer path (one in fact that had failed before) and it boots fine. Wonder what ${B} != ${S} is doing wacky...? Gary, et al, I've just submitted a patch to oe-core and yocto MLs that fixes this issue - could you please test it in your setup and confirm? Thanks! I updated Stefan's bug w/ more explanation. I verified that Stefan's uImage-bad failed for me and then added the following to uEnv.txt: fdtaddr=0x8800 hmmm so it seems kernel size grew enough to overwrite the area where uboot would put divice tree ? Exactly! The overall kernel size was very close to the limit of previous space m, allocation in U-boot and enabling another feature or growing the build path a bit would overflow into and corrupt the device tree. has happened to me on ppc with kernel+initramfs where initramfs kept growing I was told no other platforms were affected, including qemuarm! :) Yeah, I know, it can happen to anyone, even though by default it works fine... I did not look at qemuarm but I assume it was using different values for for loadaddr fdtaddr. (qemuarm is using fdt now right?) Khem, yes this would have effected initrd also if the kernel was just a touch bigger. The patch Denys pushed moves the intrd load address as well. We should be good now. If initramfs gets trashed you get a message when the kernel tries to decompresses it that it is invalid. If fdt gets trashed the kernel does not know how to send messages to uart so you get nothing. I am not sure but when I was debugging with JTAG, it looked like the kernel had actually started and was doing _something_. It just had no hardware to talk to. If a kernel boots in a forest and has no way to talk, does it have any bogomips? uImage-bad (and uImage-good) worked w/ the above change to uEnv.txt. Denys' patch fixes all the defaults in u-boot so that no uEnv.txt change is needed. -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
Re: [yocto] Thank you
Thanks back for your participation in the community! On Thu, Apr 17, 2014 at 7:38 PM, Patrick Doyle wpds...@gmail.com wrote: I just want to publicly say Thank you to all of the Yocto developers and community members, both in the general sense of Thank you for your contributions to the Open Source community and in the specific (and very self-centered) sense of Thank you for answering my newbie questions over the last couple of weeks. We made it through this week's demo thanks to the framework you provided and the specific answers to the specific questions I asked. Thank you again. --wpd -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto -- Jeff Osier-Mixon @Intel Yocto Project Community Manager http://yoctoproject.org -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
[yocto] [PATCH][daisy] distro_alias.inc: update/sort alias information.
From: Beth Flanagan elizabeth.flana...@intel.com Added new package data and resorted per http://article.gmane.org/gmane.linux.embedded.poky/9253 Signed-off-by: Beth Flanagan elizabeth.flana...@intel.com --- meta-yocto/conf/distro/include/distro_alias.inc | 25 +++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/meta-yocto/conf/distro/include/distro_alias.inc b/meta-yocto/conf/distro/include/distro_alias.inc index 96db5ba..68a82b7 100644 --- a/meta-yocto/conf/distro/include/distro_alias.inc +++ b/meta-yocto/conf/distro/include/distro_alias.inc @@ -71,6 +71,7 @@ DISTRO_PN_ALIAS_pn-core-image-sato-sdk = OE-Core DISTRO_PN_ALIAS_pn-core-image-weston = OE-Core DISTRO_PN_ALIAS_pn-core-image-x11 = OE-Core DISTRO_PN_ALIAS_pn-cross-localedef = OSPDT +DISTRO_PN_ALIAS_pn-cryptodev-linux = OE-Core DISTRO_PN_ALIAS_pn-cwautomacros = OSPDT upstream=http://cwautomacros.berlios.de/; DISTRO_PN_ALIAS_pn-damageproto = Meego=xorg-x11-proto-damageproto DISTRO_PN_ALIAS_pn-db = Debian=db5.1 Ubuntu=db5.1 @@ -122,7 +123,9 @@ DISTRO_PN_ALIAS_pn-gdk-pixbuf-csource-native = Debian=libgdk-pixbuf2.0-0 Fedora DISTRO_PN_ALIAS_pn-gettext-minimal-native = Debian=gettext Fedora=gettext DISTRO_PN_ALIAS_pn-glib-2.0 = Meego=glib2 Fedora=glib2 OpenSuSE=glib2 Ubuntu=glib2.0 Mandriva=glib2.0 Debian=glib2.0 DISTRO_PN_ALIAS_pn-glproto = Meego=xorg-x11-proto-glproto +DISTRO_PN_ALIAS_pn-gnome-desktop-testing = Debian=gnome-desktop-testing Fedora=gnome-desktop-testing DISTRO_PN_ALIAS_pn-gnu-config = OpenedHand +DISTRO_PN_ALIAS_pn-grub-efi = Debian=grub-efi Fedora=grub2-efi DISTRO_PN_ALIAS_pn-grub-efi-i586 = Ubuntu=grub Fedora=grub DISTRO_PN_ALIAS_pn-grub-efi-x86-64-native = Ubuntu=grub Fedora=grub DISTRO_PN_ALIAS_pn-gst-ffmpeg = Mandriva=gstreamer0.10-ffmpeg Debian=gstreamer0.10-ffmpeg @@ -137,6 +140,7 @@ DISTRO_PN_ALIAS_pn-gst-plugins-gl = Debian=gstreamer0.10-plugins-gl OpenSuSE=gs DISTRO_PN_ALIAS_pn-gst-plugins-good = Meego=gst-plugins-good Fedora=gstreamer-plugins-good OpenSuSE=gstreamer-plugins-good Ubuntu=gst-plugins-good0.10 Mandriva=gstreamer0.10-plugins-good Debian=gst-plugins-good0.10 DISTRO_PN_ALIAS_pn-gst-plugins-ugly = OpenSuSE=gstreamer-plugins-ugly Mandriva=gstreamer0.10-plugins-ugly Debian=gst-plugins-ugly0.10 DISTRO_PN_ALIAS_pn-gstreamer1.0 = Debian=gstreamer1.0 Ubuntu=gstreamer1.0 +DISTRO_PN_ALIAS_pn-gstreamer1.0-meta-base = Meego=gstreamer Fedora=gstreamer OpenSuSE=gstreamer Ubuntu=gstreamer0.10 DISTRO_PN_ALIAS_pn-gstreamer1.0-plugins-bad = Debian=gstreamer1.0-plugins-bad Ubuntu=gstreamer1.0-plugins-bad DISTRO_PN_ALIAS_pn-gstreamer1.0-plugins-base = Debian=gstreamer1.0-plugins-base Ubuntu=gstreamer1.0-plugins-base DISTRO_PN_ALIAS_pn-gstreamer1.0-plugins-good = Debian=gstreamer1.0-plugins-good Ubuntu=gstreamer1.0-plugins-bad @@ -148,6 +152,7 @@ DISTRO_PN_ALIAS_pn-gtk-engines = Fedora=gtk2-engines OpenSuSE=gtk2-engines Ubun DISTRO_PN_ALIAS_pn-gtk-sato-engine = OpenedHand DISTRO_PN_ALIAS_pn-gtk-theme-torturer = OSPDT upstream=http://wiki.laptop.org/go/GTK_for_OLPC; DISTRO_PN_ALIAS_pn-gtk-update-icon-cache-native = OSPDT +DISTRO_PN_ALIAS_pn-gummiboot = Debian=gummiboot Fedora=gummiboot DISTRO_PN_ALIAS_pn-hello-mod = OE-Core DISTRO_PN_ALIAS_pn-hostap-conf = OE-Core DISTRO_PN_ALIAS_pn-hwlatdetect = OSPDT @@ -158,6 +163,8 @@ DISTRO_PN_ALIAS_pn-initramfs-framework = OE-Core DISTRO_PN_ALIAS_pn-initramfs-live-boot = OE-Core DISTRO_PN_ALIAS_pn-initramfs-live-install = OE-Core DISTRO_PN_ALIAS_pn-initramfs-live-install-efi = OE-Core +DISTRO_PN_ALIAS_pn-initramfs-live-install-efi-testfs = OE-Core +DISTRO_PN_ALIAS_pn-initramfs-live-install-testfs = OE-Core DISTRO_PN_ALIAS_pn-initscripts = Fedora=initscripts Mandravia=initscripts DISTRO_PN_ALIAS_pn-inputproto = Meego=xorg-x11-proto-inputproto DISTRO_PN_ALIAS_pn-iproute2 = OSPDT @@ -195,7 +202,9 @@ DISTRO_PN_ALIAS_pn-libical = Ubuntu=libical Fedora=libical DISTRO_PN_ALIAS_pn-libiconv = Fedora=mingw-libiconv Opensuse=cross-mingw-libiconv DISTRO_PN_ALIAS_pn-libjson = Ubuntu=libjson0-dev Debian=libjson0-dev DISTRO_PN_ALIAS_pn-libksba = Fedora=libksba Debian=libksba8 +DISTRO_PN_ALIAS_pn-libksba = Fedora=libksba Ubuntu=libksba DISTRO_PN_ALIAS_pn-liblbxutil = Mandriva=liblbxutil OpenSuse=xorg-x11-devel +DISTRO_PN_ALIAS_pn-libmatchbox = Ubuntu=libmatchbox Fedora=libmatchbox DISTRO_PN_ALIAS_pn-libmpc = Fedora=libmpc OpenSuse=libmpc2 DISTRO_PN_ALIAS_pn-libnewt = Debian=libnewt0.52 Fedora=newt DISTRO_PN_ALIAS_pn-libnewt-python = Ubuntu=python-newt Fedora=newt-python @@ -224,6 +233,7 @@ DISTRO_PN_ALIAS_pn-libx11-diet = Debian=libx11-6 Fedora=libX11 Ubuntu=libx11-6 DISTRO_PN_ALIAS_pn-libxcalibrate = OSPDT upstream=http://cgit.freedesktop.org/xorg/lib/libXCalibrate/; DISTRO_PN_ALIAS_pn-libxfontcache = Mandriva=libxfontcache Debian=libxfontcache DISTRO_PN_ALIAS_pn-libxft = Mandriva=libxft Debian=libxft2 Ubuntu=libxft2 +DISTRO_PN_ALIAS_pn-libxi = Ubuntu=libxi Fedora=libXi DISTRO_PN_ALIAS_pn-libxkbcommon =
[linux-yocto] [PATCH 07/30] drivers: rapidio updates
From: Paul Butler paul.but...@windriver.com Signed-off-by: Paul Butler paul.but...@windriver.com --- drivers/misc/lsi-ncr.c | 334 +--- drivers/net/rionet.c | 132 --- 2 files changed, 282 insertions(+), 184 deletions(-) diff --git a/drivers/misc/lsi-ncr.c b/drivers/misc/lsi-ncr.c index 23bcbe6..061b350 100644 --- a/drivers/misc/lsi-ncr.c +++ b/drivers/misc/lsi-ncr.c @@ -26,14 +26,18 @@ #include lsi-ncr.h -static void __iomem *nca_address; - #ifdef CONFIG_ARCH_AXXIA -#define NCA_PHYS_ADDRESS 0x00202010ULL +#define NCA_PHYS_ADDRESS 0x00202010ULL +#define APB2SER_PHY_PHYS_ADDRESS 0x00201000ULL #else -#define NCA_PHYS_ADDRESS 0x00200052ULL +#define NCA_PHYS_ADDRESS 0x00200052ULL #endif +static void __iomem *nca_address; +#ifdef APB2SER_PHY_PHYS_ADDRESS +static void __iomem *apb2ser0_address; +#endif /* APB2SER_PHY_PHYS_ADDRESS */ + #define WFC_TIMEOUT (40) #define LOCK_DOMAIN 0 @@ -212,71 +216,96 @@ ncr_read(unsigned long region, unsigned long address, int number, if (NULL == nca_address) nca_address = ioremap(NCA_PHYS_ADDRESS, 0x2); +#ifdef APB2SER_PHY_PHYS_ADDRESS + if (NULL == apb2ser0_address) + apb2ser0_address = ioremap(APB2SER_PHY_PHYS_ADDRESS, 0x1); +#endif /* APB2SER_PHY_PHYS_ADDRESS */ if (0 != ncr_lock(LOCK_DOMAIN)) return -1; - /* - Set up the read command. - */ - - cdr2.raw = 0; - cdr2.bits.target_node_id = NCP_NODE_ID(region); - cdr2.bits.target_id_address_upper = NCP_TARGET_ID(region); - ncr_register_write(cdr2.raw, (unsigned *) (nca_address + 0xf8)); - - cdr1.raw = 0; - cdr1.bits.target_address = (address 2); - ncr_register_write(cdr1.raw, (unsigned *) (nca_address + 0xf4)); - - cdr0.raw = 0; - cdr0.bits.start_done = 1; - - if (0xff == cdr2.bits.target_id_address_upper) - cdr0.bits.local_bit = 1; - - cdr0.bits.cmd_type = 4; - /* TODO: Verify number... */ - cdr0.bits.dbs = (number - 1); - ncr_register_write(cdr0.raw, (unsigned *) (nca_address + 0xf0)); - mb(); - - /* - Wait for completion. - */ - - do { - --wfc_timeout; - } while ((0x8000UL == - ncr_register_read((unsigned *)(nca_address + 0xf0))) -0 wfc_timeout); - - if (0 == wfc_timeout) { + if (NCP_NODE_ID(region) != 0x0153) { + /* + Set up the read command. + */ + + cdr2.raw = 0; + cdr2.bits.target_node_id = NCP_NODE_ID(region); + cdr2.bits.target_id_address_upper = NCP_TARGET_ID(region); + ncr_register_write(cdr2.raw, (unsigned *) (nca_address + 0xf8)); + + cdr1.raw = 0; + cdr1.bits.target_address = (address 2); + ncr_register_write(cdr1.raw, (unsigned *) (nca_address + 0xf4)); + + cdr0.raw = 0; + cdr0.bits.start_done = 1; + + if (0xff == cdr2.bits.target_id_address_upper) + cdr0.bits.local_bit = 1; + + cdr0.bits.cmd_type = 4; + /* TODO: Verify number... */ + cdr0.bits.dbs = (number - 1); + ncr_register_write(cdr0.raw, (unsigned *) (nca_address + 0xf0)); + mb(); + + /* + Wait for completion. + */ + + do { + --wfc_timeout; + } while ((0x8000UL == + ncr_register_read((unsigned *)(nca_address + 0xf0))) + 0 wfc_timeout); + + if (0 == wfc_timeout) { + ncr_unlock(LOCK_DOMAIN); + return -1; + } + + /* + Copy data words to the buffer. + */ + + address = (unsigned long)(nca_address + 0x1000); + while (4 = number) { + *((unsigned long *) buffer) = + ncr_register_read((unsigned *) address); + address += 4; + number -= 4; + } + + if (0 number) { + unsigned long temp = + ncr_register_read((unsigned *) address); + memcpy((void *) buffer, temp, number); + } + } else { +#ifdef APB2SER_PHY_PHYS_ADDRESS + void __iomem *targ_address = apb2ser0_address + + (address (~0x3)); + /* + Copy data words to the buffer. + */ + + while (4 = number) { + *((unsigned long *) buffer) = + *((unsigned long *) targ_address); +
[linux-yocto] [PATCH 04/30] arm: rapidio updates
From: Paul Butler paul.but...@windriver.com Signed-off-by: Paul Butler paul.but...@windriver.com --- arch/arm/Kconfig | 18 + arch/arm/boot/dts/axm55xx.dts| 16 arch/arm/include/asm/axxia-rio.h | 82 ++ arch/arm/include/asm/rio.h | 33 +++ arch/arm/mach-axxia/Makefile |1 + arch/arm/mach-axxia/clock.c |5 +++ arch/arm/mach-axxia/rapidio.c| 44 7 files changed, 199 insertions(+) create mode 100644 arch/arm/include/asm/axxia-rio.h create mode 100644 arch/arm/include/asm/rio.h create mode 100644 arch/arm/mach-axxia/rapidio.c diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index c796752..e7f2815 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -345,6 +345,7 @@ config ARCH_AXXIA select PCI select PCI_DOMAINS if PCI select ARCH_SUPPORTS_MSI if PCI +select HAS_RAPIDIO if (!PREEMPT_RTB) help This enables support for the LSI Axxia boards. @@ -2359,3 +2360,20 @@ source security/Kconfig source crypto/Kconfig source lib/Kconfig + +menu RapidIO management options + +config HAS_RAPIDIO + bool + default n + +config RAPIDIO + bool RapidIO support + depends on HAS_RAPIDIO || PCI + help + If you say Y here, the kernel will include drivers and + infrastructure code to support RapidIO interconnect devices. + +source drivers/rapidio/Kconfig + +endmenu diff --git a/arch/arm/boot/dts/axm55xx.dts b/arch/arm/boot/dts/axm55xx.dts index aac791d..7ecb177 100644 --- a/arch/arm/boot/dts/axm55xx.dts +++ b/arch/arm/boot/dts/axm55xx.dts @@ -35,6 +35,7 @@ serial0 = axxia_serial0; timer = axxia_timers; ethernet0 = axxia_femac0; + rapidio0 = rio0; }; cpus { @@ -423,6 +424,21 @@ reg = 0x20 0x10098000 0 0x3000; interrupts = 0 45 4; }; + +rio0: rapidio { +index = 0; +status = disabled; +#address-cells = 2; +#size-cells = 2; +compatible = axxia,rapidio-delta; +device_type = rapidio; +reg = 0x0020 0x20142000 0x0 0x1000; /* SRIO Conf 0 region */ +ranges = 0x0 0x0 0x0031 0x 0x0 0x4000; +linkdown-reset = 0x0200 0x100 0x0020 0x1000 0x0 0x1; +interrupts = 0 89 4; +outb-dmes = 2 0x0003 1 0x; +}; + }; /* diff --git a/arch/arm/include/asm/axxia-rio.h b/arch/arm/include/asm/axxia-rio.h new file mode 100644 index 000..f244c85 --- /dev/null +++ b/arch/arm/include/asm/axxia-rio.h @@ -0,0 +1,82 @@ +/* + * RapidIO support for LSI Axxia parts + * + */ +#ifndef __ASM_AXXIA_RIO_H__ +#define __ASM_AXXIA_RIO_H__ + +/* Constants, Macros, etc. */ + +#define AXXIA_RIO_SMALL_SYSTEM + +#define AXXIA_RIO_SYSMEM_BARRIER() + +#define AXXIA_RIO_DISABLE_MACHINE_CHECK() +#define AXXIA_RIO_ENABLE_MACHINE_CHECK() +#define AXXIA_RIO_IF_MACHINE_CHECK(mcsr) (mcsr = 0) + +#define IN_SRIO8(a, v, ec) {v = inb((long unsigned int)a); ec = 0;} +#define IN_SRIO16(a, v, ec){v = inw((long unsigned int)a); ec = 0;} +#define IN_SRIO32(a, v, ec){v = inl((long unsigned int)a); ec = 0;} + +#define OUT_SRIO8(a, v)outb_p(v, (long unsigned int) a) +#define OUT_SRIO16(a, v) outw_p(v, (long unsigned int) a) +#define OUT_SRIO32(a, v) outl_p(v, (long unsigned int) a) + +#define _SWAP32(x) x) 0x00FF) 24) | (((x) 0xFF00) 8) | (((x) 0x00FF) 8) | (((x) 0xFF00) 24)) +#define CORRECT_GRIO(a)_SWAP32(a) +#define CORRECT_RAB(a) (a) + +/* ACP RIO board-specific stuff */ + +extern int axxia_rio_apio_enable(struct rio_mport *mport, u32 mask, u32 bits); +extern int axxia_rio_apio_disable(struct rio_mport *mport); +extern int axxia_rio_rpio_enable(struct rio_mport *mport, u32 mask, u32 bits); +extern int axxia_rio_rpio_disable(struct rio_mport *mport); + +extern int axxia_rapidio_board_init(void); + + +/*/ +/* ACP RIO operational stuff */ +/*/ + +/** + * CNTLZW - Count leading zeros word + * @val: value from which count number of leading zeros + * + * Return: number of zeros + */ +static inline u32 CNTLZW(u32 val) +{ + int n = 0; + if (val == 0) + return 32; + if ((val 0x) == 0) + n += 16; val = val 16; + /* + // 16 bits from left are zero! so we omit 16 left bits */ + if ((val 0xFF00) == 0) + n = n + 8; val = val 8; + /* 8 left bits are 0 */ + if ((val 0xF000) == 0) + n = n + 4; val = val 4; + /* 4 left bits are 0 */ + if ((val
[linux-yocto] [PATCH 05/30] powerpc: rapidio updates
From: Paul Butler paul.but...@windriver.com Signed-off-by: Paul Butler paul.but...@windriver.com --- arch/powerpc/boot/dts/lsi_acp342x.dts | 317 + arch/powerpc/boot/dts/lsi_acp344x.dts | 355 + arch/powerpc/include/asm/axxia-rio.h | 103 ++ arch/powerpc/include/asm/rio.h| 41 arch/powerpc/platforms/44x/Makefile |3 +- arch/powerpc/platforms/44x/acprio.c | 65 ++ arch/powerpc/platforms/44x/acpx1.c|1 + 7 files changed, 884 insertions(+), 1 deletion(-) create mode 100644 arch/powerpc/boot/dts/lsi_acp342x.dts create mode 100644 arch/powerpc/boot/dts/lsi_acp344x.dts create mode 100644 arch/powerpc/include/asm/axxia-rio.h create mode 100644 arch/powerpc/platforms/44x/acprio.c diff --git a/arch/powerpc/boot/dts/lsi_acp342x.dts b/arch/powerpc/boot/dts/lsi_acp342x.dts new file mode 100644 index 000..da6066e --- /dev/null +++ b/arch/powerpc/boot/dts/lsi_acp342x.dts @@ -0,0 +1,317 @@ +/* + * Device Tree Source for IBM Embedded PPC 476 Platform + * + * Copyright 2009 Torez Smith, IBM Corporation. + * + * Based on earlier code: + * Copyright (c) 2006, 2007 IBM Corp. + * Josh Boyer jwbo...@linux.vnet.ibm.com, David Gibson d...@au1.ibm.com + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed as is without + * any warranty of any kind, whether express or implied. + */ + +/dts-v1/; + +/memreserve/ 0x 0x0040; + +/ { + #address-cells = 2; + #size-cells = 1; + model = ibm,acpx1-4xx; + compatible = ibm,acpx1-4xx,ibm,47x-AMP; + dcr-parent = {/cpus/cpu@0}; + + aliases { + serial0 = UART0; + serial1 = UART1; + rapidio0 = rio0; + ethernet0 = FEMAC; + }; + + cpus { + #address-cells = 1; + #size-cells = 0; + + cpu@0 { + device_type = cpu; + model = PowerPC,4xx; // real CPU changed in sim + reg = 0; +clock-frequency = 0x5f5e1000; +timebase-frequency = 0x5f5e1000; + i-cache-line-size = 32; + d-cache-line-size = 32; + i-cache-size = 32768; + d-cache-size = 32768; + dcr-controller; + dcr-access-method = native; + status = ok; + reset-type = 3; // 1=core, 2=chip, 3=system (default) + }; + cpu@1 { + device_type = cpu; + model = PowerPC,4xx; // real CPU changed in sim + reg = 1; +clock-frequency = 0x5f5e1000; +timebase-frequency = 0x5f5e1000; + i-cache-line-size = 32; + d-cache-line-size = 32; + i-cache-size = 32768; + d-cache-size = 32768; + dcr-controller; + dcr-access-method = native; + status = disabled; + enable-method = spin-table; + cpu-release-addr = 0 0x2040; + reset-type = 3; // 1=core, 2=chip, 3=system (default) + }; + }; + +memory@0 { +device_type = memory; +reg = 0x 0x 0x1000; +}; + +memory@8000 { +device_type = memory; +reg = 0x 0x 0x; +}; + + MPIC: interrupt-controller { + compatible = chrp,open-pic; + interrupt-controller; + dcr-reg = 0xffc0 0x0003; + #address-cells = 0; + #size-cells = 0; + #interrupt-cells = 2; + pic-no-reset; + }; + + plb { + /* Could be PLB6, doesn't matter */ + compatible = ibm,plb-4xx, ibm,plb4; + #address-cells = 2; + #size-cells = 1; + ranges; + clock-frequency = 0; // Filled in by zImage + + POB0: opb { + compatible = ibm,opb-4xx, ibm,opb; + #address-cells = 1; + #size-cells = 1; + /* Wish there was a nicer way of specifying a full 32-bit + range */ + ranges = 0x 0x0020 0x 0x8000 + 0x8000 0x0020 0x8000 0x8000; + clock-frequency = 0; // Filled in by zImage + UART0: serial@00404000 { + device_type = serial; + compatible =
[linux-yocto] [PATCH 00/30] Resubmit LSI AXXIA updates to 3.4 standard/axxia/base
This is a resubmit of patches to the lsi/standard/axxia/base Some of the updates include splitting a patch and referencing the main line. Others included adding more information. All updated as per Bruce-A comments Anders Berg (7): axxia: Fixed earlyprintk axxia: Define arch_is_coherent() ARM: 7465/1: Handle 4GB memory sizes in device tree and mem=size@start option ARM: LPAE: use phys_addr_t in alloc_init_pud() ARM: 7499/1: mm: Fix vmalloc overlap check for !HIGHMEM arm: mmu: Fixed checkpatch issues with mmu drivers/i2c-axxia: Support I2C_M_RECV_LEN David Mercado (2): LSI AXM55xx: Enable multi-cluster wfe/sev LSI AXM55XX: Add PMU support Ivan Djelic (1): ARM: 7668/1: fix memset-related crashes caused by recent GCC (4.7.2) optimizations John Jacques (6): arch/arm/mach-axxi: Updated DDR Retention to Wokr from Interrupt Context arch/arm/mach-axxia: Clear MTC Errors During Initialization LSI: Fix Device Tree compatible fields powerpc/mpic: Disable preemption when calling mpic_processor_id() arm/mach-axxia: Same build for HW and simlation and DDR Retention Reset and clock init. axxia: Remove Wrapper Functions Michael Bringmann (1): LSI AXM55XX/rapidio: Stability and bug fix improvements , Correct boundary, Expand valid condition. Nicolas Pitre (1): ARM: 7670/1: fix the memset fix Paul Butler (8): drivers/rapidio/devices: Initial Submittal of LSI rapidio drivers/rapidio: new files drivers/rapidio: modified files arm: rapidio updates powerpc: rapidio updates include: rapidio updates drivers: rapidio updates arm/mach-axxia: Updated PCIe driver to set PCIe SangeethaRao (3): arch/powerpc/sysdev: Fixed PCIe enumeration issue on AXM3500 emulation drivers/usb: USB driver/dts on PPC was broken. Added support for ncr_read/ncr_write to access PCIe/SRIO SerDes config in 0x115 node ningligong (1): drivers/rapidio/lsi: squash a bunch rapidio stuff together and Cleanup arch/arm/Kconfig| 19 + arch/arm/Kconfig.debug |9 + arch/arm/Makefile |3 - arch/arm/boot/dts/axm-sim.dts | 403 arch/arm/boot/dts/axm55xx.dts | 50 +- arch/arm/boot/dts/axm55xxemu.dts| 21 +- arch/arm/boot/dts/axm55xxsim.dts| 94 +- arch/arm/boot/dts/axm55xxsim16.dts | 439 arch/arm/include/asm/axxia-rio.h| 135 ++ arch/arm/include/asm/rio.h | 37 + arch/arm/include/asm/setup.h| 14 +- arch/arm/include/asm/spinlock.h |4 + arch/arm/kernel/perf_event_v7.c |3 +- arch/arm/kernel/setup.c | 70 +- arch/arm/mach-axxia/Kconfig |3 - arch/arm/mach-axxia/Makefile|3 +- arch/arm/mach-axxia/axxia-gic.c | 25 +- arch/arm/mach-axxia/axxia.c | 123 +- arch/arm/mach-axxia/axxia.h |2 +- arch/arm/mach-axxia/clock.c | 185 +- arch/arm/mach-axxia/ddr_retention.c | 300 ++- arch/arm/mach-axxia/include/mach/debug-macro.S | 16 +- arch/arm/mach-axxia/include/mach/hardware.h | 25 +- arch/arm/mach-axxia/include/mach/irqs.h |1 + arch/arm/mach-axxia/include/mach/memory.h | 19 + arch/arm/mach-axxia/include/mach/ncr.h | 44 + arch/arm/mach-axxia/ncr.c | 597 + arch/arm/mach-axxia/pci.c |7 +- arch/arm/mach-axxia/platsmp.c | 155 +- arch/arm/mach-axxia/rapidio.c | 68 + arch/arm/mach-axxia/wrappers.c | 176 -- arch/arm/mm/mmu.c | 82 +- arch/powerpc/boot/dts/ACP344xV2.dts | 20 +- arch/powerpc/boot/dts/acp25xx.dts | 16 +- arch/powerpc/boot/dts/acp342x.dts | 21 +- arch/powerpc/boot/dts/acp344x.dts | 16 +- arch/powerpc/boot/dts/lsi_acp342x.dts | 317 +++ arch/powerpc/boot/dts/lsi_acp344x.dts | 355 +++ arch/powerpc/include/asm/axxia-rio.h| 107 + arch/powerpc/include/asm/rio.h | 46 + arch/powerpc/platforms/44x/Makefile |3 +- arch/powerpc/platforms/44x/acprio.c | 65 + arch/powerpc/platforms/44x/acpx1.c |1 + arch/powerpc/sysdev/Makefile|2 - arch/powerpc/sysdev/lsi_acp_wrappers.c | 132 -- arch/powerpc/sysdev/lsi_pci.c | 19 +- arch/powerpc/sysdev/mpic.c | 119 +- drivers/i2c/busses/i2c-axxia.c | 193 +- drivers/misc/Kconfig|2 +- drivers/misc/lsi-mtc.c |9 +- drivers/misc/lsi-ncr.c | 334 +--
[linux-yocto] [PATCH 06/30] include: rapidio updates
From: Paul Butler paul.but...@windriver.com Signed-off-by: Paul Butler paul.but...@windriver.com --- include/asm-generic/vmlinux.lds.h | 10 ++ include/linux/rio.h | 231 ++--- include/linux/rio_dio.h | 67 +++ include/linux/rio_drv.h | 202 +--- include/linux/rio_ids.h |7 ++ include/linux/rio_regs.h | 26 + include/linux/riopw.h | 30 + 7 files changed, 490 insertions(+), 83 deletions(-) create mode 100644 include/linux/rio_dio.h create mode 100644 include/linux/riopw.h diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 5d2ca6f..290711d 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -274,6 +274,16 @@ } \ \ /* RapidIO route ops */ \ + .rio_dev_fixup : AT(ADDR(.rio_dev_fixup) - LOAD_OFFSET) { \ + VMLINUX_SYMBOL(__start_rio_dev_fixup_early) = .;\ + *(.rio_dev_fixup_early) \ + VMLINUX_SYMBOL(__end_rio_dev_fixup_early) = .; \ + VMLINUX_SYMBOL(__start_rio_dev_fixup_enable) = .; \ + *(.rio_dev_fixup_enable)\ + VMLINUX_SYMBOL(__end_rio_dev_fixup_enable) = .; \ + } \ + \ + /* RapidIO route ops */ \ .rio_ops: AT(ADDR(.rio_ops) - LOAD_OFFSET) {\ VMLINUX_SYMBOL(__start_rio_switch_ops) = .; \ *(.rio_switch_ops) \ diff --git a/include/linux/rio.h b/include/linux/rio.h index 4d50611..ef300e2 100644 --- a/include/linux/rio.h +++ b/include/linux/rio.h @@ -20,6 +20,8 @@ #include linux/errno.h #include linux/device.h #include linux/rio_regs.h +#include linux/radix-tree.h +#include asm/rio.h #define RIO_NO_HOPCOUNT-1 #define RIO_INVALID_DESTID 0x @@ -37,10 +39,14 @@ entry is invalid (no route exists for the device ID) */ +#define RIO_INVALID_ROUTE_WEIGHT 0xff /* Indicates that a route weight + entry is invalid (no route + exists for the device ID) */ + #define RIO_MAX_ROUTE_ENTRIES(size)(size ? (1 16) : (1 8)) #define RIO_ANY_DESTID(size) (size ? 0x : 0xff) -#define RIO_MAX_MBOX 4 +#define RIO_MAX_MBOX 8 #define RIO_MAX_MSG_SIZE 0x1000 /* @@ -77,6 +83,9 @@ #define RIO_CTAG_RESRVD0xfffe /* Reserved */ #define RIO_CTAG_UDEVID0x0001 /* Unique device identifier */ +#define RIO_DEVICE_INSERTION1 +#define RIO_DEVICE_EXTRACTION 2 + extern struct bus_type rio_bus_type; extern struct device rio_bus; extern struct list_head rio_devices; /* list of all devices */ @@ -85,6 +94,15 @@ struct rio_mport; struct rio_dev; union rio_pw_msg; +struct rio_switch_port { + struct rio_dev *rdev; +#ifdef CONFIG_RAPIDIO_DYNAMIC_ROUTES + u8 *route_weights_table; +#endif +}; + +#define NEW_STYLE 1 + /** * struct rio_switch - RIO switch info * @node: Node in global list of switches @@ -104,7 +122,12 @@ union rio_pw_msg; struct rio_switch { struct list_head node; u16 switchid; +#ifdef OLD_STYLE u8 *route_table; +#else + u32 port_init; + int update_lut; +#endif u32 port_ok; int (*add_entry) (struct rio_mport *mport, u16 destid, u8 hopcount, u16 table, u16 route_destid, u8 route_port); @@ -119,7 +142,9 @@ struct rio_switch { int (*em_init) (struct rio_dev *dev); int (*em_handle) (struct rio_dev *dev, u8 swport); int (*sw_sysfs) (struct rio_dev *dev, int create); - struct rio_dev *nextdev[0]; +#ifdef OLD_STYLE + struct rio_switch_port port[0]; +#endif }; /** @@ -151,10 +176,19 @@ struct rio_switch { * @prev: Previous RIO device connected to the current one * @rswitch: struct rio_switch (if valid for this device) */ +#ifdef NEW_STYLE +struct rio_dyn { + int prev_port; + u16 prev_destid; + u32 swpinfo; +}; +#endif + struct rio_dev { struct list_head global_list; /* node in list of all RIO devices */ struct list_head net_list; /* node in per net list */ - struct rio_net *net;/* RIO net this device resides in */ + struct list_head route_list;/* node in
[linux-yocto] [PATCH 08/30] axxia: Fixed earlyprintk
From: Anders Berg anders.b...@lsi.com Add static mapping of the UART registers for CONFIG_DEBUG_LL. Also depends on commit 2f409a to fix a bug with LPAE and static mappings. Signed-off-by: Anders Berg anders.b...@lsi.com --- arch/arm/Kconfig.debug |9 + arch/arm/mach-axxia/axxia.c| 13 arch/arm/mach-axxia/include/mach/debug-macro.S | 16 --- arch/arm/mach-axxia/include/mach/hardware.h| 25 +++- 4 files changed, 50 insertions(+), 13 deletions(-) diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 85348a0..762903c 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -89,6 +89,15 @@ choice bool Kernel low-level debugging on 9263 and 9g45 depends on HAVE_AT91_DBGU1 + config AXXIA_DEBUG_LL_UART0 + bool Kernel low-level debugging via UART0 + depends on ARCH_AXXIA + help + This enables the low-level debugging via the UART0 + and should be used + with the + AXXIA hardware + config DEBUG_CLPS711X_UART1 bool Kernel low-level debugging messages via UART1 depends on ARCH_CLPS711X diff --git a/arch/arm/mach-axxia/axxia.c b/arch/arm/mach-axxia/axxia.c index df63dbd..7b725ef 100644 --- a/arch/arm/mach-axxia/axxia.c +++ b/arch/arm/mach-axxia/axxia.c @@ -46,6 +46,7 @@ #include asm/mach/time.h #include asm/hardware/cache-l2x0.h #include asm/hardware/gic.h +#include mach/hardware.h #include mach/timers.h #include mach/axxia-gic.h #include axxia.h @@ -62,8 +63,20 @@ static const char *axxia_dt_match[] __initconst = { static void __iomem *ssp_base; +static struct map_desc axxia_static_mappings[] __initdata = { +#ifdef CONFIG_DEBUG_LL + { + .virtual= AXXIA_DEBUG_UART_VIRT, + .pfn= __phys_to_pfn(AXXIA_DEBUG_UART_PHYS), + .length = SZ_4K, + .type = MT_DEVICE + }, +#endif +}; + void __init axxia_dt_map_io(void) { + iotable_init(axxia_static_mappings, ARRAY_SIZE(axxia_static_mappings)); } void __init axxia_dt_init_early(void) diff --git a/arch/arm/mach-axxia/include/mach/debug-macro.S b/arch/arm/mach-axxia/include/mach/debug-macro.S index 83d6670..3a3755b 100644 --- a/arch/arm/mach-axxia/include/mach/debug-macro.S +++ b/arch/arm/mach-axxia/include/mach/debug-macro.S @@ -10,6 +10,8 @@ * published by the Free Software Foundation. */ +#include mach/hardware.h + /* * -- NOTE -- * @@ -19,19 +21,9 @@ #error Axxia Peripherals Are Only Accessible Using the LPAE! #endif -#define UART0_PHYSICAL_ADDRESS 0x00201008ULL -#define UART1_PHYSICAL_ADDRESS 0x002010081000ULL -#define UART2_PHYSICAL_ADDRESS 0x002010082000ULL -#define UART3_PHYSICAL_ADDRESS 0x002010083000ULL - -#define UART0_VIRTUAL_ADDRESS 0xf008 -#define UART1_VIRTUAL_ADDRESS 0xf0081000 -#define UART2_VIRTUAL_ADDRESS 0xf0082000 -#define UART3_VIRTUAL_ADDRESS 0xf0083000 - .macro addruart, rp, rv, tmp - ldr \rp, =0x1008 - ldr \rv, =0xf008 + ldr \rp, =(AXXIA_DEBUG_UART_PHYS 0x) + ldr \rv, =AXXIA_DEBUG_UART_VIRT .endm #include asm/hardware/debug-pl01x.S diff --git a/arch/arm/mach-axxia/include/mach/hardware.h b/arch/arm/mach-axxia/include/mach/hardware.h index 40a8c17..ce3790f 100644 --- a/arch/arm/mach-axxia/include/mach/hardware.h +++ b/arch/arm/mach-axxia/include/mach/hardware.h @@ -1 +1,24 @@ -/* empty */ +/* + * arch/arm/mach-axxia/include/mach/hardware.h + * + * Copyright (c) 2013 LSI Corporation + * + * 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. + */ +#ifndef __MACH_HARDWARE_H +#define __MACH_HARDWARE_H + +#define AXXIA_UART0_PHYS 0x201008 +#define AXXIA_UART1_PHYS 0x2010081000 +#define AXXIA_UART2_PHYS 0x2010082000 +#define AXXIA_UART3_PHYS 0x2010083000 + +#ifdef CONFIG_AXXIA_DEBUG_LL_UART0 +#define AXXIA_DEBUG_UART_VIRT 0xf008 +#define AXXIA_DEBUG_UART_PHYS AXXIA_UART0_PHYS +#endif + +#endif -- 1.7.9.5 -- ___ linux-yocto mailing list linux-yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/linux-yocto
[linux-yocto] [PATCH 18/30] drivers/usb: USB driver/dts on PPC was broken.
From: SangeethaRao sangeetha@lsi.com Fixed the DTS to have correct entries and updated USB driver to exclude 55xx relevant code from PPC build drivers/usb: added a new ehci halt function New halt function halts the EHCI controller. This is to be called during startup since spinlocks are not initialized at that point. Signed-off-by: SangeethaRao sangeetha@lsi.com --- arch/powerpc/boot/dts/acp342x.dts |7 --- drivers/usb/host/ehci-ci13612.c | 30 +- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/boot/dts/acp342x.dts b/arch/powerpc/boot/dts/acp342x.dts index 4db67df..8e400e3 100644 --- a/arch/powerpc/boot/dts/acp342x.dts +++ b/arch/powerpc/boot/dts/acp342x.dts @@ -112,9 +112,10 @@ }; USB0: usb@004a4000 { device_type = usb; -compatible = acp-usb; -enabled = 0; -reg = 0x004a4000 0x0002; +compatible = lsi,acp-usb; +enabled = 1; + reg = 0x20 0x004A 0x0 002, + 0x20 0x0040C000 0x0 0001000; interrupt-parent = MPIC; interrupts = 31; }; diff --git a/drivers/usb/host/ehci-ci13612.c b/drivers/usb/host/ehci-ci13612.c index b995a32..3badbd8 100644 --- a/drivers/usb/host/ehci-ci13612.c +++ b/drivers/usb/host/ehci-ci13612.c @@ -32,6 +32,8 @@ #include ehci-ci13612.h +static int ci13612_ehci_halt(struct ehci_hcd *ehci); + #ifdef CONFIG_LSI_USB_SW_WORKAROUND static void ci13612_usb_setup(struct usb_hcd *hcd) { @@ -104,7 +106,7 @@ static int ci13612_ehci_init(struct usb_hcd *hcd) ehci-sbrn = 0x20; /* Reset is only allowed on a stopped controller */ - ehci_halt(ehci); + ci13612_ehci_halt(ehci); /* reset controller */ ehci_reset(ehci); @@ -183,8 +185,11 @@ static int ci13612_ehci_run(struct usb_hcd *hcd) if (retval) return retval; + +#ifndef CONFIG_LSI_USB_SW_WORKAROUND /* Setup AMBA interface to force INCR16 busts when possible */ writel(3, USB_SBUSCFG); +#endif retval = ehci_run(hcd); if (retval) @@ -192,10 +197,12 @@ static int ci13612_ehci_run(struct usb_hcd *hcd) ci13612_fixup_txpburst(ehci); +#ifndef CONFIG_LSI_USB_SW_WORKAROUND /* Set ITC (bits [23:16]) to zero for interrupt on every micro-frame */ tmp = ehci_readl(ehci, ehci-regs-command); tmp = 0x; ehci_writel(ehci, tmp 0x, ehci-regs-command); +#endif return retval; } @@ -238,6 +245,7 @@ static int ci13612_ehci_probe(struct platform_device *pdev) irq = platform_get_irq(pdev, 0); if (irq 0) { + dev_dbg(pdev-dev, error getting irq number\n); retval = irq; goto fail_create_hcd; } @@ -255,9 +263,12 @@ static int ci13612_ehci_probe(struct platform_device *pdev) return -ENODEV; } + +#ifndef CONFIG_LSI_USB_SW_WORKAROUND /* Device using 32-bit addressing */ pdev-dev.coherent_dma_mask = DMA_BIT_MASK(32); pdev-dev.dma_mask = pdev-dev.coherent_dma_mask; +#endif hcd = usb_create_hcd(ci13612_hc_driver, pdev-dev, dev_name(pdev-dev)); @@ -316,6 +327,18 @@ static int ci13612_ehci_remove(struct platform_device *pdev) return 0; } +static int ci13612_ehci_halt(struct ehci_hcd *ehci) +{ + u32 temp; + + temp = ehci_readl(ehci, ehci-regs-command); + temp = ~CMD_RUN; + ehci_writel(ehci, temp, ehci-regs-command); + + return handshake(ehci, ehci-regs-status, + STS_HALT, STS_HALT, 16 * 125); +} + MODULE_ALIAS(platform:ci13612-ehci); static struct of_device_id ci13612_match[] = { @@ -323,6 +346,10 @@ static struct of_device_id ci13612_match[] = { .type = usb, .compatible = lsi,acp-usb, }, + { + .type = usb, + .compatible = acp-usb, + }, {}, }; @@ -333,4 +360,5 @@ static struct platform_driver ci13612_ehci_driver = { .name = ci13612-ehci, .of_match_table = ci13612_match, }, + }; -- 1.7.9.5 -- ___ linux-yocto mailing list linux-yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/linux-yocto
[linux-yocto] [PATCH 12/30] ARM: LPAE: use phys_addr_t in alloc_init_pud()
From: Anders Berg anders.b...@lsi.com commit 20d6956d8cd2452cec0889ff040f18afc03c2e6b upstream This patch fixes the alloc_init_pud() function to use phys_addr_t instead of unsigned long when passing in the phys argument. This is an extension to commit 97092e0 (ARM: pgtable: use phys_addr_t for physical addresses), which applied similar changes elsewhere in the ARM memory management code. Signed-off-by: Vitaly Andrianov vita...@ti.com Signed-off-by: Cyril Chemparathy cy...@ti.com Acked-by: Nicolas Pitre n...@linaro.org Acked-by: Catalin Marinas catalin.mari...@arm.com Tested-by: Santosh Shilimkar santosh.shilim...@ti.com Tested-by: Subash Patel subash...@samsung.com Signed-off-by: Will Deacon will.dea...@arm.comarm: mmu: Fix truncated 40-bit physaddr (LPAE) Signed-off-by: Anders Berg anders.b...@lsi.com --- arch/arm/mm/mmu.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index f117e1f..0acc475 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -628,7 +628,7 @@ static void __init alloc_init_section(pud_t *pud, unsigned long addr, } static void __init alloc_init_pud(pgd_t *pgd, unsigned long addr, - unsigned long end, unsigned long phys, const struct mem_type *type) + unsigned long end, phys_addr_t phys, const struct mem_type *type) { pud_t *pud = pud_offset(pgd, addr); unsigned long next; -- 1.7.9.5 -- ___ linux-yocto mailing list linux-yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/linux-yocto
[linux-yocto] [PATCH 14/30] arm: mmu: Fixed checkpatch issues with mmu
From: Anders Berg anders.b...@lsi.com This patch fixes the checkpatch issues with mmu. This patch is separate to keep the continuity of the previous patches that used copies of upstream patches to update. Signed-off-by: Anders Berg anders.b...@lsi.com --- arch/arm/mm/mmu.c | 76 +++-- 1 file changed, 33 insertions(+), 43 deletions(-) diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 571102e..f3f16dc 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -53,13 +53,13 @@ pmd_t *top_pmd; #define CPOLICY_WRITEALLOC 4 static unsigned int cachepolicy __initdata = CPOLICY_WRITEBACK; -static unsigned int ecc_mask __initdata = 0; +static unsigned int ecc_mask __initdata; pgprot_t pgprot_user; -pgprot_t pgprot_kernel; - EXPORT_SYMBOL(pgprot_user); +pgprot_t pgprot_kernel; EXPORT_SYMBOL(pgprot_kernel); + struct cachepolicy { const char policy[16]; unsigned intcr_mask; @@ -194,8 +194,8 @@ void adjust_cr(unsigned long mask, unsigned long set) } #endif -#define PROT_PTE_DEVICE L_PTE_PRESENT|L_PTE_YOUNG|L_PTE_DIRTY|L_PTE_XN -#define PROT_SECT_DEVICE PMD_TYPE_SECT|PMD_SECT_AP_WRITE +#define PROT_PTE_DEVICE (L_PTE_PRESENT|L_PTE_YOUNG|L_PTE_DIRTY|L_PTE_XN) +#define PROT_SECT_DEVICE (PMD_TYPE_SECT|PMD_SECT_AP_WRITE) static struct mem_type mem_types[] = { [MT_DEVICE] = { /* Strongly ordered / ARMv6 shared device */ @@ -216,7 +216,7 @@ static struct mem_type mem_types[] = { .prot_l1= PMD_TYPE_TABLE, .prot_sect = PROT_SECT_DEVICE | PMD_SECT_WB, .domain = DOMAIN_IO, - }, + }, [MT_DEVICE_WC] = { /* ioremap_wc */ .prot_pte = PROT_PTE_DEVICE | L_PTE_MT_DEV_WC, .prot_l1= PMD_TYPE_TABLE, @@ -532,7 +532,7 @@ static void __init build_mem_type_table(void) mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_WB; break; } - printk(Memory policy: ECC %sabled, Data cache %s\n, + printk(KERN_INFO Memory policy: ECC %sabled, Data cache %s\n, ecc_mask ? en : dis, cp-policy); for (i = 0; i ARRAY_SIZE(mem_types); i++) { @@ -653,9 +653,8 @@ static void __init create_36bit_mapping(struct map_desc *md, length = PAGE_ALIGN(md-length); if (!(cpu_architecture() = CPU_ARCH_ARMv6 || cpu_is_xsc3())) { - printk(KERN_ERR MM: CPU does not support supersection - mapping for 0x%08llx at 0x%08lx\n, - (long long)__pfn_to_phys((u64)md-pfn), addr); + printk(KERN_ERR MM: CPU does not support supersection mapping for 0x%08llx at 0x%08lx\n, + (long long)__pfn_to_phys((u64)md-pfn), addr); return; } @@ -666,16 +665,14 @@ static void __init create_36bit_mapping(struct map_desc *md, * of the actual domain assignments in use. */ if (type-domain) { - printk(KERN_ERR MM: invalid domain in supersection - mapping for 0x%08llx at 0x%08lx\n, - (long long)__pfn_to_phys((u64)md-pfn), addr); + printk(KERN_ERR MM: invalid domain in supersection mapping for 0x%08llx at 0x%08lx\n, + (long long)__pfn_to_phys((u64)md-pfn), addr); return; } if ((addr | length | __pfn_to_phys(md-pfn)) ~SUPERSECTION_MASK) { - printk(KERN_ERR MM: cannot create mapping for 0x%08llx - at 0x%08lx invalid alignment\n, - (long long)__pfn_to_phys((u64)md-pfn), addr); + printk(KERN_ERR MM: cannot create mapping for 0x%08llx at 0x%08lx invalid alignment\n, + (long long)__pfn_to_phys((u64)md-pfn), addr); return; } @@ -717,18 +714,16 @@ static void __init create_mapping(struct map_desc *md) pgd_t *pgd; if (md-virtual != vectors_base() md-virtual TASK_SIZE) { - printk(KERN_WARNING BUG: not creating mapping for 0x%08llx - at 0x%08lx in user region\n, - (long long)__pfn_to_phys((u64)md-pfn), md-virtual); + printk(KERN_WARNING BUG: not creating mapping for 0x%08llx at 0x%08lx in user region\n, + (long long)__pfn_to_phys((u64)md-pfn), md-virtual); return; } if ((md-type == MT_DEVICE || md-type == MT_ROM) md-virtual = PAGE_OFFSET (md-virtual VMALLOC_START || md-virtual = VMALLOC_END)) { - printk(KERN_WARNING BUG: mapping for 0x%08llx - at 0x%08lx out of vmalloc space\n, - (long long)__pfn_to_phys((u64)md-pfn), md-virtual); +
[linux-yocto] [PATCH 23/30] powerpc/mpic: Disable preemption when calling mpic_processor_id()
From: John Jacques john.jacq...@lsi.com commit 32dda05f4ec2b854b594bd91590c46c5197d77e1 upstream Otherwise, we get a debug traceback due to the use of smp_processor_id() (or get_paca()) inside hard_smp_processor_id(). mpic_host_map() is just looking for a default CPU, so it doesn't matter if we migrate after getting the CPU ID. Signed-off-by: Scott Wood scottw...@freescale.com Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org Signed-off-by: John Jacques john.jacq...@lsi.com --- arch/powerpc/sysdev/mpic.c | 119 +--- 1 file changed, 68 insertions(+), 51 deletions(-) diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index 9ee7043..a3d7951 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c @@ -142,7 +142,7 @@ static u32 mpic_infos[][MPIC_IDX_END] = { }, }; -#define MPIC_INFO(name) mpic-hw_set[MPIC_IDX_##name] +#define MPIC_INFO(name) (mpic-hw_set[MPIC_IDX_##name]) #else /* CONFIG_MPIC_WEIRD */ @@ -169,7 +169,7 @@ static inline u32 _mpic_read(enum mpic_reg_type type, struct mpic_reg_bank *rb, unsigned int reg) { - switch(type) { + switch (type) { #ifdef CONFIG_PPC_DCR case mpic_access_dcr: return dcr_read(rb-dhost, reg); @@ -183,10 +183,10 @@ static inline u32 _mpic_read(enum mpic_reg_type type, } static inline void _mpic_write(enum mpic_reg_type type, - struct mpic_reg_bank *rb, - unsigned int reg, u32 value) + struct mpic_reg_bank *rb, + unsigned int reg, u32 value) { - switch(type) { + switch (type) { #ifdef CONFIG_PPC_DCR case mpic_access_dcr: dcr_write(rb-dhost, reg, value); @@ -213,7 +213,8 @@ static inline u32 _mpic_ipi_read(struct mpic *mpic, unsigned int ipi) return _mpic_read(type, mpic-gregs, offset); } -static inline void _mpic_ipi_write(struct mpic *mpic, unsigned int ipi, u32 value) +static inline void _mpic_ipi_write(struct mpic *mpic, + unsigned int ipi, u32 value) { unsigned int offset = MPIC_INFO(GREG_IPI_VECTOR_PRI_0) + (ipi * MPIC_INFO(GREG_IPI_STRIDE)); @@ -250,14 +251,16 @@ static inline u32 _mpic_cpu_read(struct mpic *mpic, unsigned int reg) return _mpic_read(mpic-reg_type, mpic-cpuregs[cpu], reg); } -static inline void _mpic_cpu_write(struct mpic *mpic, unsigned int reg, u32 value) +static inline void _mpic_cpu_write(struct mpic *mpic, + unsigned int reg, u32 value) { unsigned int cpu = mpic_processor_id(mpic); _mpic_write(mpic-reg_type, mpic-cpuregs[cpu], reg, value); } -static inline u32 _mpic_irq_read(struct mpic *mpic, unsigned int src_no, unsigned int reg) +static inline u32 _mpic_irq_read(struct mpic *mpic, + unsigned int src_no, unsigned int reg) { unsigned intisu = src_no mpic-isu_shift; unsigned intidx = src_no mpic-isu_mask; @@ -289,16 +292,16 @@ static inline void _mpic_irq_write(struct mpic *mpic, unsigned int src_no, #endif } -#define mpic_read(b,r) _mpic_read(mpic-reg_type,(b),(r)) -#define mpic_write(b,r,v) _mpic_write(mpic-reg_type,(b),(r),(v)) -#define mpic_ipi_read(i) _mpic_ipi_read(mpic,(i)) -#define mpic_ipi_write(i,v)_mpic_ipi_write(mpic,(i),(v)) -#define mpic_tm_read(i)_mpic_tm_read(mpic,(i)) -#define mpic_tm_write(i,v) _mpic_tm_write(mpic,(i),(v)) -#define mpic_cpu_read(i) _mpic_cpu_read(mpic,(i)) -#define mpic_cpu_write(i,v)_mpic_cpu_write(mpic,(i),(v)) -#define mpic_irq_read(s,r) _mpic_irq_read(mpic,(s),(r)) -#define mpic_irq_write(s,r,v) _mpic_irq_write(mpic,(s),(r),(v)) +#define mpic_read(b, r)_mpic_read(mpic-reg_type, (b), (r)) +#define mpic_write(b, r, v)_mpic_write(mpic-reg_type, (b), (r), (v)) +#define mpic_ipi_read(i) _mpic_ipi_read(mpic, (i)) +#define mpic_ipi_write(i, v) _mpic_ipi_write(mpic, (i), (v)) +#define mpic_tm_read(i)_mpic_tm_read(mpic, (i)) +#define mpic_tm_write(i, v)_mpic_tm_write(mpic, (i), (v)) +#define mpic_cpu_read(i) _mpic_cpu_read(mpic, (i)) +#define mpic_cpu_write(i, v) _mpic_cpu_write(mpic, (i), (v)) +#define mpic_irq_read(s, r)_mpic_irq_read(mpic, (s), (r)) +#define mpic_irq_write(s, r, v)_mpic_irq_write(mpic, (s), (r), (v)) /* @@ -333,7 +336,7 @@ static inline void mpic_map(struct mpic *mpic, _mpic_map_mmio(mpic, phys_addr, rb, offset, size); } #else /* CONFIG_PPC_DCR */ -#define mpic_map(m,p,b,o,s)_mpic_map_mmio(m,p,b,o,s) +#define mpic_map(m, p, b, o, s)_mpic_map_mmio(m, p, b, o, s) #endif /* !CONFIG_PPC_DCR */ @@ -345,7 +348,8 @@ static void __init mpic_test_broken_ipi(struct mpic *mpic) { u32 r; -
[linux-yocto] [PATCH 22/30] LSI: Fix Device Tree compatible fields
From: John Jacques john.jacq...@lsi.com The latest boot loader updates the frequency of the clocks in the device tree; it expects there to be a place to put them. Fix the device trees for ACP and AXM platforms such that the compatible field uses the form manufacturer,model. Signed-off-by: John Jacques john.jacq...@lsi.com Signed-off-by: David Mercado david.merc...@windriver.com Signed-off-by: Paul Butler paul.but...@windriver.com --- arch/arm/boot/dts/axm55xx.dts |4 ++-- arch/arm/boot/dts/axm55xxemu.dts| 21 +++-- arch/powerpc/boot/dts/ACP344xV2.dts | 20 ++-- arch/powerpc/boot/dts/acp25xx.dts | 16 arch/powerpc/boot/dts/acp342x.dts | 14 +++--- arch/powerpc/boot/dts/acp344x.dts | 16 6 files changed, 54 insertions(+), 37 deletions(-) diff --git a/arch/arm/boot/dts/axm55xx.dts b/arch/arm/boot/dts/axm55xx.dts index f18550b..f0b325d 100644 --- a/arch/arm/boot/dts/axm55xx.dts +++ b/arch/arm/boot/dts/axm55xx.dts @@ -232,7 +232,7 @@ }; axxia_femac0: femac@0x201012 { - compatible = acp-femac; + compatible = lsi,acp-femac; device_type = network; reg = 0x20 0x1012 0 0x1000, 0x20 0x10121000 0 0x1000, @@ -314,7 +314,7 @@ USB0: usb@004a4000 { device_type = usb; - compatible = acp-usb; + compatible = lsi,acp-usb; enabled = 0; reg = 0x20 0x1014 0x0 002, 0x20 0x10094000 0x0 0002000; diff --git a/arch/arm/boot/dts/axm55xxemu.dts b/arch/arm/boot/dts/axm55xxemu.dts index 99d7a70..1b22b33 100644 --- a/arch/arm/boot/dts/axm55xxemu.dts +++ b/arch/arm/boot/dts/axm55xxemu.dts @@ -1,5 +1,5 @@ /* - * arch/arm/boot/dts/axm5500-sim.dts + * arch/arm/boot/dts/axm55xxemu.dts * * Copyright (C) 2012 LSI * @@ -93,6 +93,23 @@ */ }; + clocks { + #address-cells = 1; + #size-cells = 0; + + cpu { + frequency = 0; /* Filled in by the boot loader. */ + }; + + peripheral { + frequency = 0; /* Filled in by the boot loader. */ + }; + + emmc { + frequency = 0; /* Filled in by the boot loader. */ + }; + }; + memory@ { device_type = memory; reg = 0 0x 0 0x1000; @@ -153,7 +170,7 @@ }; axxia_femac0: femac@0x201012 { -compatible = acp-femac; +compatible = lsi,acp-femac; device_type = network; reg = 0x20 0x1012 0 0x1000, 0x20 0x10121000 0 0x1000, diff --git a/arch/powerpc/boot/dts/ACP344xV2.dts b/arch/powerpc/boot/dts/ACP344xV2.dts index 1a4040f..72db6b4 100644 --- a/arch/powerpc/boot/dts/ACP344xV2.dts +++ b/arch/powerpc/boot/dts/ACP344xV2.dts @@ -135,7 +135,7 @@ clock-frequency = 0; // Filled in by zImage UART0: serial@00404000 { device_type = serial; -compatible = acp-uart0; +compatible = lsi,acp-uart0; enabled = 0; reg = 0x00404000 0x1000; clock-reg = 0x00408040 0x20; @@ -146,7 +146,7 @@ }; UART1: serial@00405000 { device_type = serial; -compatible = acp-uart1; +compatible = lsi,acp-uart1; enabled = 0; reg = 0x00405000 0x1000; clock-reg = 0x00408060 0x20; @@ -157,7 +157,7 @@ }; USB0: usb@004a4000 { device_type = usb; -compatible = acp-usb; +compatible = lsi,acp-usb; enabled = 0; reg = 0x004a 0x0002 0x0040c000 0x1000; @@ -167,7 +167,7 @@ I2C: i2c@00403000 { #address-cells = 1; #size-cells = 0; -compatible = acp-i2c; +compatible = lsi,acp-i2c; enabled = 0; reg = 0x403000 0x1000 0x408020 0x1000; interrupt-parent = MPIC; @@ -182,7 +182,7 @@ #address-cells = 1; #size-cells = 0;
[linux-yocto] [PATCH 27/30] LSI AXM55XX/rapidio: Stability and bug fix improvements , Correct boundary, Expand valid condition.
From: Michael Bringmann michael.bringm...@lsi.com Add additional spinlocks/mutexes to each controller state to increase concurrency and performance. Fix some bound checks for full outbound DME descriptor chains, correct a lockup/delay issue with errors in the outbound DME chains, and remove a delay loop. rapidio/LSI AXM55xx: Correct some boundary checks for argument values. Also correct formatting of platform-specific function code. LSI AXM55xx: Expand valid condition checks for inbound message DME chains. Signed-off-by: Michael Bringmann michael.bringm...@lsi.com --- arch/arm/include/asm/axxia-rio.h| 31 -- drivers/rapidio/devices/lsi/axxia-rio-ds.c | 22 ++-- drivers/rapidio/devices/lsi/axxia-rio-irq.c | 156 --- drivers/rapidio/devices/lsi/axxia-rio-irq.h | 13 +-- drivers/rapidio/devices/lsi/axxia-rio.c |3 +- drivers/rapidio/devices/lsi/axxia-rio.h | 16 ++- 6 files changed, 101 insertions(+), 140 deletions(-) diff --git a/arch/arm/include/asm/axxia-rio.h b/arch/arm/include/asm/axxia-rio.h index e01d6a3..492d476 100644 --- a/arch/arm/include/asm/axxia-rio.h +++ b/arch/arm/include/asm/axxia-rio.h @@ -94,21 +94,32 @@ static inline u32 CNTLZW(u32 val) int n = 0; if (val == 0) return 32; - if ((val 0x) == 0) - n += 16; val = val 16; + + if ((val 0x) == 0) { + n += 16; + val = val 16; + } /* // 16 bits from left are zero! so we omit 16 left bits */ - if ((val 0xFF00) == 0) - n = n + 8; val = val 8; + if ((val 0xFF00) == 0) { + n = n + 8; + val = val 8; + } /* 8 left bits are 0 */ - if ((val 0xF000) == 0) - n = n + 4; val = val 4; + if ((val 0xF000) == 0) { + n = n + 4; + val = val 4; + } /* 4 left bits are 0 */ - if ((val 0xC000) == 0) - n = n + 2, val = val 2; + if ((val 0xC000) == 0) { + n = n + 2; + val = val 2; + } /* 110 2 left bits are zero */ - if ((val 0x8000) == 0) - n = n + 1, val = val 1; + if ((val 0x8000) == 0) { + n = n + 1; + val = val 1; + } /* first left bit is zero */ return n; } diff --git a/drivers/rapidio/devices/lsi/axxia-rio-ds.c b/drivers/rapidio/devices/lsi/axxia-rio-ds.c index f4f44a6..02d3751 100755 --- a/drivers/rapidio/devices/lsi/axxia-rio-ds.c +++ b/drivers/rapidio/devices/lsi/axxia-rio-ds.c @@ -240,9 +240,10 @@ int axxia_open_ob_data_stream( int num_header_entries, int num_data_entries) { + struct rio_priv *priv = mport-priv; int rc = 0; - axxia_api_lock(); + axxia_api_lock(priv); rc = open_ob_data_stream(mport, dev_id, @@ -250,7 +251,7 @@ int axxia_open_ob_data_stream( num_header_entries, num_data_entries); - axxia_api_unlock(); + axxia_api_unlock(priv); return rc; } @@ -747,12 +748,12 @@ int axxia_close_ob_data_stream( struct rio_ds_hdr_desc *ptr_hdr_desc; u32dse_ctrl, i; - axxia_api_lock(); + axxia_api_lock(priv); ptr_dse_cfg = (ptr_ds_priv-obds_dse_cfg[dse_id]); if (ptr_dse_cfg-in_use == RIO_DS_FALSE) { - axxia_api_unlock(); + axxia_api_unlock(priv); return 0; } @@ -791,7 +792,7 @@ int axxia_close_ob_data_stream( /* release the IRQ handler */ release_irq_handler((ptr_ds_priv-ob_dse_irq[dse_id])); - axxia_api_unlock(); + axxia_api_unlock(priv); return 0; } @@ -830,9 +831,10 @@ int axxia_open_ib_data_stream( int desc_dbuf_size, int num_entries) { + struct rio_priv *priv = mport-priv; int rc = 0; - axxia_api_lock(); + axxia_api_lock(priv); rc = open_ib_data_stream(mport, dev_id, @@ -840,7 +842,7 @@ int axxia_open_ib_data_stream( cos, desc_dbuf_size, num_entries); - axxia_api_unlock(); + axxia_api_unlock(priv); return rc; } @@ -1522,7 +1524,7 @@ int axxia_close_ib_data_stream( struct rio_ids_data_desc *ptr_data_desc; u8 virt_vsid; - axxia_api_lock(); + axxia_api_lock(priv); for (i = 0; i (ptr_ds_priv-num_ibds_virtual_m); i++) { ptr_virt_m_cfg = (ptr_ds_priv-ibds_vsid_m_cfg[i]); @@