>From dbeb9e14eb4b5d70775426a370681c90928d4d84 Mon Sep 17 00:00:00 2001
From: Jeremy Chang <jeremy(a)0xlab.org>
Date: Mon, 14 Feb 2011 11:28:12 +0800
Subject: [PATCH] Make adbd listen on network interface
adb through ethernet is very common that we need.
Set property service.adb.tcp.port to make adbd listen. The default port
is 5555.
Signed-off-by: Jeremy Chang <jeremy(a)0xlab.org>
---
init.rc | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/init.rc b/init.rc
index b6a92c5..50d2dc6 100644
--- a/init.rc
+++ b/init.rc
@@ -181,6 +181,7 @@ on boot
ifup lo
hostname localhost
domainname localdomain
+ setprop service.adb.tcp.port 5555
# set RLIMIT_NICE to allow priorities from 19 to -20
setrlimit 13 40 40
--
1.7.1
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
This patchset adds Samsung's SMDKV310 machine with device tree support. The
bootargs and memory information is obtained from the device tree. The
watchdog driver is also modified such that it is probed based on the information
from the device tree.
Thomas Abraham (4):
ARM: DT: Add SMDKV310 machine with device tree support.
ARM: DT: Add a basic dts file for SMDKV310 machine
ARM: DT: Add support for probing platform bus on SMDKV310 machine
watchdog: s3c2410: Add support for device tree based probe
arch/arm/mach-s5pv310/Kconfig | 7 ++
arch/arm/mach-s5pv310/Makefile | 1 +
arch/arm/mach-s5pv310/mach-smdkv310-dt.c | 107 ++++++++++++++++++++++++++++++
arch/arm/mach-s5pv310/mach-smdkv310.dts | 38 +++++++++++
drivers/watchdog/s3c2410_wdt.c | 10 +++
5 files changed, 163 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/mach-s5pv310/mach-smdkv310-dt.c
create mode 100755 arch/arm/mach-s5pv310/mach-smdkv310.dts
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.
Hi All,
Please find enclosed link to minutes and actions for multimedia wg
meeting on 8st Feb 2011.
https://wiki.linaro.org/WorkingGroups/Middleware/Multimedia/Notes/2011-02-08
Summary
- Discussions with gstreamer lead architect on improvements in gstreamer for
zero copy on going
- Discussions with Mans Rullgarg from arm on worksplit for neon optimisation
topics
- Panda instablities causing delays in pulse audio activities
- System metrics application work progressing fine, will need Panda for
validation
- Freescale engineers Jian and Kan on vacation on occasion of Chinese new
year
Thanks
Sachin
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 */
I'm investigating the powerdebug tool on all platforms for which there
is a Linaro image.
Can anyone with boards imx51, lt-s5pv310, overo and vexpress provide
access for a short period of time?
Steve,
Forwarding to linaro-dev since this might be of general interest.
Here is an experimental version of a thermal manager that allows us to
take appropriate actions in case of overheating. Since temperature
changes relatively slowly, the implementation is in userspace. If
you're interested in this problem, please download it, take it for a
spin and give us feedback.
Regards,
Amit
---------- Forwarded message ----------
From: Steve Jahnke <steve.jahnke(a)linaro.org>
Date: Thu, Feb 10, 2011 at 8:37 PM
Subject: Thermal Manager git
To: Amit Kucheria <amit.kucheria(a)linaro.org>
I have the initial user space thermal manager up on git.linaro.org -
can clone as usual:
git clone git://git.linaro.org/people/stevejahnke/thermal_manager.git
Please review the README to get an idea of what it is/is not/will be.
If anyone is so inclined to work on this, please let me know before
making a bunch of additions or anything - there will be some massive
additions over the next few weeks to start to flesh out the rest of the
work and some coordination would be needed........
<snip>
Best Regards,
Steve