Hi,
I tried booting linux-linaro-2.6.37 kernel on my beagle board C4. I executed
following:
1. Installed linaro on a 4 GB SD card using linaro-image-tools 0.4.1 with
hwpack daily snapshot hwpack_linaro-omap3_20110125-0_armel_supported.tar.gz
and linaro-natty-headless-tar-20101202-1.tar.gz. It was booting properly on
my BB.
2. Cloned linux-linaro-2.6.37. Changed to source directory
3. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- omap2plus_defconfig
4. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- menuconfig (enabled
EARLY_PRINTK)
5. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage
6. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules
7. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules_install
INSTALL_MOD_PATH=/media/rootfs
8. cp arch/arm/boot/uImage /media/boot; sync
Everything went on smoothly. Then I put the SD card on BB and powered it on.
I got a kernel panic: http://paste.ubuntu.com/560562
Please help me figuring out the problem. Is it because I didn't create
uInitrd? If so, then how to create it for ARM?
Regards,
Avik
Hi,
If I mess up the u-boot in my efikamx smart book how can I install a new one?
I tried booting with an SD-card image from
http://www.powerdeveloper.org/asset/by-id/116. I guess this only works
if I have a working u-boot in place.
I don't have the serial/JTAG connector. Is this what I need in order to recover?
Thanks,
Per
Hi
Commit r99457 on linaro 4.5 branch is causing a ICE when compiling the
attached file with following options
gcc-4_5-branch/build.i686-linux.armeb-oe-linux-gnueabi/gcc/cc1 -O2
-mtune=xscale a.i
It only happens when I use -mtune=xscale otherwise it compiles fine
It was tested on armeb I have not done a test on LE.
I have attached the testcase to this email as well.
Thanks
-Khem
Hello list,
I'm a developer at 0xlab and focus on toolchain development.
While Android WG was working on integrating Linaro toolchain to Android
system, we encountered prelink error since there are some empty symbols in
symtab produced by toolchain linaro gcc-4.5 + binutils-2.20. The error
message is:
target Prelink: libc
(out/target/product/beagleboard/symbols/system/lib/libc.so)
ASSERTION FAILURE external/elfcopy/elfcopy.c:2457:
[!(shdr_info[sym->st_shndx].shdr.sh_flags & SHF_ALLOC)]
However, we verified it by linaro gcc-4.5 + google binutils-2.19. There is
no prelink problem on this toolchain combination.
(Google binutils-2.19 is not compatible to linaro gcc-4.5 since some new
feature and new instructions used in linaro gcc-4.5).
We produced the link map file and traced this problem, the symbols are
merged by linker optimization (relax) and empty entires are inserted in
symtab. In function elf_link_output_sym at bfd/elflink.c:
if (name == NULL || *name == '\0')
elfsym->st_name = 0;
else if (input_sec->flags & SEC_EXCLUDE)
elfsym->st_name = 0; // st_name will be set to emtry
else
{
elfsym->st_name = (unsigned long) _bfd_stringtab_add (finfo->symstrtab,
name, TRUE,
FALSE);
if (elfsym->st_name == (unsigned long) -1)
return 0;
}
When const strings are merged, the bit of SEC_EXCLUDE in input_sec->flags
will be set.
The bfd elf linker will set the elfsym->st_name to 0.
Before binutils-2.19, the merged string is pushed in section 'glue_t' and
the path is not be traveled.
I think it's not make sense that the address of NOTYPE symbol *not* behind
its section. The zero must be not behind section "rodata.str1.1".
So I filed a bug in
https://bugs.launchpad.net/binutils-linaro/+bug/707487<https://bugs.launchpad.net/binutils-linaro/+bug/707487/+subscribe>
.
The log is readelf -a libc.so | grep 00000000 | grep -v FILE | grep -v
SECTION | grep -v UND
3372: 00000000 0 NOTYPE LOCAL DEFAULT 8
3375: 00000000 0 NOTYPE LOCAL DEFAULT 8
3381: 00000000 0 NOTYPE LOCAL DEFAULT 8
3382: 00000000 0 NOTYPE LOCAL DEFAULT 8
3397: 00000000 0 NOTYPE LOCAL DEFAULT 8
3408: 00000000 0 NOTYPE LOCAL DEFAULT 8
3409: 00000000 0 NOTYPE LOCAL DEFAULT 8
3411: 00000000 0 NOTYPE LOCAL DEFAULT 8
3415: 00000000 0 NOTYPE LOCAL DEFAULT 8
3424: 00000000 0 NOTYPE LOCAL DEFAULT 8
3437: 00000000 0 NOTYPE LOCAL DEFAULT 8
3439: 00000000 0 NOTYPE LOCAL DEFAULT 8
Any comments?
Thanks,
Luse
http://0xlab.org/
Any plan for armv5te support?
It should compatible to Ubuntu of 30MB that seems possible
[http://lists.linaro.org/pipermail/linaro-dev/2011-January/002109.html]
.
There are a lot of arm9 boards in the world.
We have to think that arm9 is the past?
Thanks for any reply,
Recalcati
Hi guys,
Nicolas, thanks for taking a look at the basic device tree patches.
I've fixed up the defects you've pointed out and pushed the fixed
versions out to my tree. Other than that, does it look okay to you?
With that series it is possible to turn on device tree booting for any
arm platform by turning on CONFIG_OF and adding a dt_compat string
table to the existing machine_desc. It is far from complete support
since it only decodes the kernel parameters, the initrd location and
the memory size, but it is enough for others to start playing with the
infrastructure.
On the u-boot side of things, everything needed to support device tree
appears to be complete and working, other than a bug I ran into on
systems with memory based at 0. (fix sent to list). Turning on
CONFIG_OF_LIBFDT was simple on Tegra, and I expect it will be on the
other platforms too.
If I were able to get all the supported Linaro platforms modified and
tested to support dt booting, would you be okay with picking up the
current dt support series and having CONFIG_OF turned on by default
for the next Linaro release? There are also some details to nail down
with respect to packaging the .dtb files, but I'm working out those
details with Loïc.
Cheers,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
This patch implements an alternate method for using device tree data
for populating machine device registration. Traditionally, board
support has directly generated and registered devices based on nodes
in the device tree. The board support code starts at the root of the
tree and begins allocating devices for each device node it finds.
Similarly, bus drivers (i2c, spi, etc.) use their child nodes to
register child devices. This model can be seen in almost all the powerpc
board ports (arch/powerpc/platforms/*).
However, for many of the ARM SoCs, there already exists complete board
support for many SoCs that have their own code for registering the
basic set of platform devices with non-trivial dependencies on clock
structure and machine specific platform code. While starting at the
base of the tree and working up is certainly possible, it requires
modifying a lot of machine support code to get it working.
Instead, this patch provides an alternate approach. Instead of
starting at the root of the tree and working up, this patch allows the
SoC support code to register its standard set of platform devices in
the normal way. However, it also registers a platform_bus notifier
function which compares platform_device registrations with data in the
device tree. Whenever it finds a matching node, it increments the
node reference count and assigns it to the device's of_node pointer so
that it is available for the device driver to use and bind against.
For example, an spi master driver would have access to the spi node
which contains information about all the spi slaves on the bus.
An example usage of this facility is to allow a single 'devicetree'
board support file to support multiple machines all using the same
SoC. The common code would register SoC devices unconditionally, and
the board support code would depend entirely on device tree data.
Note: Board ports using this facility are still required to provide a
fully populated device tree blob. It is not a shortcut to providing
an accurate device tree model of the machine to the point that it
would be reasonably possible to switch to a direct registration model
for all devices without change the device tree. ie. The SoC still
needs to be correctly identified and there should be nodes for all the
discrete devices.
I'm not convinced that this is the model to pursue over the long term,
but it greatly simplifies the task of getting device tree support up
and running, and it provides a migration path to full dt device
registration (if it makes sense to do so).
Signed-off-by: Grant Likely <grant.likely(a)secretlab.ca>
---
This patch can be found in my devicetree/test branch (frequently rebased)
git://git.secretlab.ca/git/linux-2.6 devicetree/test
I'll move it to devicetree/arm (never rebased) once it is stable.
g.
arch/arm/mach-versatile/core.c | 3 +
drivers/of/address.c | 14 ++
drivers/of/base.c | 3 +
drivers/of/platform.c | 230 ++++++++++++++++++++++++++++++++++++++++
include/linux/of_address.h | 1
include/linux/of_platform.h | 2
6 files changed, 253 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index 136c32e..86ad01d 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -21,6 +21,7 @@
#include <linux/init.h>
#include <linux/device.h>
#include <linux/dma-mapping.h>
+#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/sysdev.h>
#include <linux/interrupt.h>
@@ -873,6 +874,8 @@ void __init versatile_init(void)
clkdev_add_table(lookups, ARRAY_SIZE(lookups));
+ of_platform_bus_snoop(NULL, NULL);
+
platform_device_register(&versatile_flash_device);
platform_device_register(&versatile_i2c_device);
platform_device_register(&smc91x_device);
diff --git a/drivers/of/address.c b/drivers/of/address.c
index b4559c5..b43ff66 100644
--- a/drivers/of/address.c
+++ b/drivers/of/address.c
@@ -556,6 +556,20 @@ static int __of_address_to_resource(struct device_node *dev,
}
/**
+ * of_address_count - Return the number of entries in the reg property
+ */
+int of_address_count(struct device_node *np)
+{
+ struct resource temp_res;
+ int num_reg = 0;
+
+ while (of_address_to_resource(np, num_reg, &temp_res) == 0)
+ num_reg++;
+ return num_reg;
+}
+EXPORT_SYMBOL_GPL(of_address_count);
+
+/**
* of_address_to_resource - Translate device tree address and return as resource
*
* Note that if your address is a PIO address, the conversion will fail if
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 710b53b..632ebae 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -496,6 +496,9 @@ EXPORT_SYMBOL(of_find_node_with_property);
const struct of_device_id *of_match_node(const struct of_device_id *matches,
const struct device_node *node)
{
+ if (!matches)
+ return NULL;
+
while (matches->name[0] || matches->type[0] || matches->compatible[0]) {
int match = 1;
if (matches->name[0])
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index c01cd1a..559bfe3 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -11,11 +11,15 @@
* 2 of the License, or (at your option) any later version.
*
*/
+
+#define DEBUG
+
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/dma-mapping.h>
#include <linux/slab.h>
+#include <linux/notifier.h>
#include <linux/of_address.h>
#include <linux/of_device.h>
#include <linux/of_irq.h>
@@ -767,4 +771,230 @@ int of_platform_bus_probe(struct device_node *root,
return rc;
}
EXPORT_SYMBOL(of_platform_bus_probe);
+
+
+struct of_platform_bus_snoop_node_data {
+ struct list_head list;
+ struct device_node *node;
+ struct device *dev; /* assigned device */
+
+ int num_resources;
+ struct resource resource[0];
+};
+
+struct of_platform_bus_snoop_data {
+ struct list_head nodes;
+ struct notifier_block nb;
+};
+
+static bool of_pdev_match_resources(struct platform_device *pdev,
+ struct of_platform_bus_snoop_node_data *node_data)
+{
+ struct resource *node_res = node_data->resource;
+ struct resource *pdev_res = pdev->resource;
+ int i, j;
+
+ /* Compare both resource tables and make sure every node resource
+ * is represented by the platform device. Here we check that each
+ * resource has corresponding entry with the same type and start
+ * values, and the end value falls inside the range specified
+ * in the device tree node. */
+ for (i = 0; i < node_data->num_resources; i++, node_res++) {
+ for (j = 0; j < pdev->num_resources; j++, pdev_res++) {
+ if ((pdev_res->start == node_res->start) &&
+ (pdev_res->end >= node_res->start) &&
+ (pdev_res->end <= node_res->end) &&
+ (pdev_res->flags == node_res->flags))
+ break;
+ }
+ if (j >= pdev->num_resources)
+ return false;
+ }
+ return true;
+}
+
+static int of_platform_bus_snoop_notifier_call(struct notifier_block *nb,
+ unsigned long event, void *_dev)
+{
+ struct platform_device *pdev = to_platform_device(_dev);
+ struct of_platform_bus_snoop_data *data;
+ struct of_platform_bus_snoop_node_data *node_data;
+
+#ifdef DEBUG
+ struct resource *res = pdev->resource;
+ int i;
+ pr_debug("snooping: '%s':\n", dev_name(&pdev->dev));
+ for (i = 0; i < pdev->num_resources; i++, res++)
+ pr_debug("snooping: %2i:%.8x..%.8x[%lx]\n", i,
+ res->start, res->end, res->flags);
+#endif
+
+ if (pdev->dev.of_node)
+ return NOTIFY_DONE;
+
+ data = container_of(nb, struct of_platform_bus_snoop_data, nb);
+
+ switch (event) {
+ case BUS_NOTIFY_ADD_DEVICE:
+ list_for_each_entry(node_data, &data->nodes, list) {
+ if (node_data->dev)
+ continue;
+
+ if (!of_pdev_match_resources(pdev, node_data))
+ continue;
+
+ pr_debug("%s: add reference to node %s\n",
+ dev_name(&pdev->dev),
+ node_data->node->full_name);
+ node_data->dev = get_device(&pdev->dev);
+ pdev->dev.of_node = of_node_get(node_data->node);
+ return NOTIFY_OK;
+ }
+ break;
+
+ case BUS_NOTIFY_DEL_DEVICE:
+ list_for_each_entry(node_data, &data->nodes, list) {
+ if (node_data->dev == &pdev->dev) {
+ pr_debug("%s: removing reference to %s\n",
+ dev_name(&pdev->dev),
+ node_data->node->full_name);
+ of_node_put(pdev->dev.of_node);
+ put_device(node_data->dev);
+ pdev->dev.of_node = NULL;
+ node_data->dev = NULL;
+ return NOTIFY_OK;
+ }
+ }
+ break;
+ }
+
+ return NOTIFY_DONE;
+}
+
+int of_platform_bus_snoop_children(struct of_platform_bus_snoop_data *data,
+ struct device_node *parent,
+ const struct of_device_id *bus_match)
+{
+ struct device_node *child;
+
+ /* Loop over children and record the details */
+ for_each_child_of_node(parent, child) {
+ struct of_platform_bus_snoop_node_data *node_data;
+ struct resource *res;
+ int num_irq, num_reg, i, rc;
+
+ /* Make sure it has a compatible property */
+ if (!of_get_property(child, "compatible", NULL))
+ continue;
+
+ num_irq = of_irq_count(child);
+ num_reg = of_address_count(child);
+ node_data = kzalloc(sizeof(*node_data) +
+ (sizeof(struct resource) * (num_irq + num_reg)),
+ GFP_KERNEL);
+ if (!node_data)
+ return -ENOMEM;
+ INIT_LIST_HEAD(&node_data->list);
+
+ res = &node_data->resource[0];
+ for (i = 0; i < num_reg; i++, res++)
+ WARN_ON(of_address_to_resource(child, i, res));
+ WARN_ON(of_irq_to_resource_table(child, res, num_irq) != num_irq);
+ node_data->num_resources = num_reg + num_irq;
+ node_data->node = of_node_get(child);
+
+ list_add_tail(&node_data->list, &data->nodes);
+
+ /* If this is a bus node, recursively inspect the children */
+ if (of_match_node(bus_match, child)) {
+ rc = of_platform_bus_snoop_children(data, child, bus_match);
+ if (rc)
+ return rc;
+ }
+ }
+
+ return 0;
+}
+
+/**
+ * of_platform_bus_snoop - Attach device nodes to platform bus registrations.
+ * @root: parent of the first level to probe or NULL for the root of the tree
+ * @bus_match: match table for child bus nodes, or NULL
+ *
+ * This function sets up 'snooping' of device tree registrations and
+ * when a device registration is found that matches a node in the
+ * device tree, it populates the platform_device with a pointer to the
+ * matching node.
+ *
+ * A bus notifier is used to implement this behaviour. When this
+ * function is called, it will parse all the child nodes of @root and
+ * create a lookup table of eligible device nodes. A device node is
+ * considered eligible if it:
+ * a) has a compatible property,
+ * b) has memory mapped registers, and
+ * c) has a mappable interrupt.
+ *
+ * It will also recursively parse child buses providing
+ * a) the child bus node has a ranges property (children have
+ * memory-mapped registers), and
+ * b) it is compatible with the @matches list.
+ *
+ * The lookup table will be used as data for a platform bus notifier
+ * that will compare each new device registration with the table
+ * before a device driver is bound to it. If there is a match, then
+ * the of_node pointer will be added to the device. Therefore it is
+ * important to call this function *before* any platform devices get
+ * registered.
+ */
+int __init of_platform_bus_snoop(struct device_node *root,
+ const struct of_device_id *bus_match)
+{
+ struct of_platform_bus_snoop_data *data;
+ struct of_platform_bus_snoop_node_data *node_data, *tmp;
+ int rc;
+
+ if (!root)
+ root = of_find_node_by_path("/");
+ else
+ of_node_get(root);
+ if (root == NULL)
+ return -EINVAL;
+
+ pr_debug("of_platform_bus_snoop()\n");
+ pr_debug(" starting at: %s\n", root->full_name);
+
+ data = kzalloc(sizeof(*data), GFP_KERNEL);
+ if (!data)
+ return -ENOMEM;
+ INIT_LIST_HEAD(&data->nodes);
+
+ rc = of_platform_bus_snoop_children(data, root, bus_match);
+ if (rc)
+ goto bail;
+
+#ifdef DEBUG
+ list_for_each_entry(node_data, &data->nodes, list) {
+ struct resource *res = node_data->resource;
+ int i;
+ pr_info("snoop: '%s':\n", node_data->node->full_name);
+ for (i = 0; i < node_data->num_resources; i++, res++)
+ pr_info("snoop: %2i:%.8x..%.8x[%lx]\n", i,
+ res->start, res->end, res->flags);
+ }
+#endif
+
+ data->nb.notifier_call = of_platform_bus_snoop_notifier_call;
+ bus_register_notifier(&platform_bus_type, &data->nb);
+
+ return 0;
+
+ bail:
+ list_for_each_entry_safe(node_data, tmp, &data->nodes, list) {
+ list_del(&node_data->list);
+ of_node_put(node_data->node);
+ kfree(node_data);
+ }
+ kfree(data);
+ return rc;
+}
#endif /* !CONFIG_SPARC */
diff --git a/include/linux/of_address.h b/include/linux/of_address.h
index 2feda6e..6711d5f 100644
--- a/include/linux/of_address.h
+++ b/include/linux/of_address.h
@@ -3,6 +3,7 @@
#include <linux/ioport.h>
#include <linux/of.h>
+extern int of_address_count(struct device_node *np);
extern u64 of_translate_address(struct device_node *np, const __be32 *addr);
extern int of_address_to_resource(struct device_node *dev, int index,
struct resource *r);
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index a68716a..bf40328 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -74,6 +74,8 @@ extern struct platform_device *of_platform_device_create(struct device_node *np,
extern int of_platform_bus_probe(struct device_node *root,
const struct of_device_id *matches,
struct device *parent);
+extern int of_platform_bus_snoop(struct device_node *root,
+ const struct of_device_id *bus_match);
#endif /* !CONFIG_SPARC */
#endif /* CONFIG_OF_DEVICE */
Hi there,
When booting linaro snapshots on my PandaBoard the system hangs a few seconds
after the bash prompt is shown (sometimes a little earlier). My first step was
to enable magic-sysrq but the system doesn't react on them. It looks like it's
already powered off - very strange. I've tried various hwpacks and headless
images and also an SD-card image that works works on a pandaboard of a
colleague (20110127 hwpack with 20110126 headless) but everything fails with
the same symptoms. I used two different power supplies and several SD cards -
also no difference. The board itself doesn't seem to be defective as the
ubuntu-netbook-10.10-preinstalled-netbook-armel+omap4.img runs flawlessly for
hours. I replaced the 2.6.35 omap4 kernel of the ubuntu 10.10 image with a
kernel built from the latest git://git.linaro.org/ubuntu/linux-linaro-
natty.git - but then the board hangs again. Attached is the output of the
serial console. Any hints/suggestions on how to get the linaro kernel working
on this board are much appreciated.
Regards
Ken
Hi there,
I did a talk at LCA yesterday evening that covered Embedded GPUs and
Open Source (or the lack thereof); slides are available here:
https://wiki.linaro.org/ChristianReis
and a video recording may be available as well later; I'll tack it into
the thread if I get a URL for it.
I'm happy to answer questions about the presentations or to talk about
the problems and possible solutions. One interesting outcome was the
idea of a one-day cross-vendor summit that we could tack onto an
existing open source event; Plumbers would be an interesting event for
that and if enough people are interested I'd be willing to put effort
into helping make that happen.
Thanks to Jesse and Paul for the help they put into preparing for the
presentation. Your comments welcome,
--
Christian Robottom Reis | [+55] 16 9112 6430 | http://launchpad.net/~kiko
Linaro Engineering VP | [ +1] 612 216 4935 | http://async.com.br/~kiko