Tegra's I2C driver has a unique feature built in (although not mainlined
yet); it can multiplex the I2C bus onto different sets of pins using the
Tegra pinmux module, and hence can register more than 1 I2C bus with the
I2C core for each controller. The exact number of busses registers, and
the pinmux settings to be used, are provided by platform data. See:
http://git.chromium.org/git/kernel-next.git chromeos-2.6.38
include/linux/i2c-tegra.h
arch/arm/mach-tegra/board-seaboard.c
If I understand the direction of devicetree on ARM, there should be a
single devicetree node for the Tegra I2C controller, which will get
matched up with a static platform device registration in e.g.
mach-tegra/board-dt.c
I can easily see how to provide the appropriate platform data to the
Tegra I2C driver, by definining the appropriate fields in a custom
devicetree binding.
To cater for the multiple child busses, the simplest solution seems to
be to define each child node's reg property to be a tuple, <sub_bus_id,
i2c_address> (c.f. existing <i2c_address>). E.g.:
IIC0: i2c@00000000 {
compatible = "nvidia,tegra250-iic";
#address-cells = <2>;
#size-cells = <0>;
bus_muxes = <pinmuxid_1 pinmux_value_1 pinmuxid_2 pinmux_value_2>;
rtc@68 {
compatible = "stm,m41t80";
reg = <0 0x68>;
};
sttm@48 {
compatible = "ad,ad7414";
reg = <1 0x48>;
};
};
The problem is then that of_i2c_register_devices won't work well for the
Tegra I2C controller, since it enforces that each child node's reg
property be a single value, the I2C address.
To solve this, should we:
a) Have each mux'd bus have a separate devicetree node underneath the
main I2C device, e.g.:
IIC0: i2c@00000000 {
compatible = "nvidia,tegra250-iic";
// @0 doesn't really end up matching a
// reg property within the child though
bus@0 {
#address-cells = <1>;
#size-cells = <0>;
pinmux_group = <N>;
pinmux_value = <M>;
rtc@68 {
compatible = "stm,m41t80";
reg = <0x68>;
};
}
bus@1 {
#address-cells = <1>;
#size-cells = <0>;
pinmux_group = <N>;
pinmux_value = <M>;
sttm@48 {
compatible = "ad,ad7414";
reg = <0x48>;
};
}
};
Then, the bus@0 or bus@1 nodes could be placed into adap->dev.of_node,
since the devices are hung off there.
b)
Implement custom devicetree child enumeration code in the Tegra I2C
driver to replace of_i2c_register_devices, which implements the
two-entry reg format. The first devicetree example in this email could
then be used.
c)
Perhaps remove the bus mux functionality from the Tegra I2C driver, and
implement a separate I2C mux driver for it.
I'm not sure if devicetree has a defined representation for I2C bus
muxes, and even if it does, since the mux control isn't accessed by I2C
registers (as most standalone I2C bus muxes are), but rather Tegra-
specific pinmux API calls, I'm not quite sure how to represent it in
device-tree.
Thanks for any thoughts!
--
nvpublic
Enclosed you'll find a link to the agenda, notes and actions from the
Linaro Developer Platforms Weekly Status meeting held on April 27th
in #linaro-meeting on irc.freenode.net at 15:00 UTC.
https://wiki.linaro.org/Platform/DevPlatform/Meetings/2011-04-27
Action carried over was:
* hrw to write improved test cases for QA tracker, to cover
https://wiki.linaro.org/Platform/Ubuntu/EvaluationBuild/MemberDeliverables
New Actions:
* tgall_foo to seed a wiki page to discuss how to approach 1111 TR P1
(LEB as base for product builders)
Regards,
Tom (tgall_foo)
Developer Platforms Team
"We want great men who, when fortune frowns will not be discouraged."
- Colonel Henry Knox
w) tom.gall att linaro.org
w) tom_gall att vnet.ibm.com
h) tom_gall att mac.com
Enclosed you'll find a link to the agenda, minutes, actions and IRC logs
from the
Linaro kernel working group weekly meetings of April 25, 2011.
https://wiki.linaro.org/WorkingGroups/Kernel/Meetings/2011-04-25
== Summary ==
* Introduce Deepak Saxena (AKA dsaxena1), who will be taking over the
Kernel WG lead starting on May 1st.
* Cycle 11.11 planning - See
https://wiki.linaro.org/Cycles/1111/TechnicalTopics/Kernel for technical
requirements description
* K9 One UDS Session for Improve Linux Kernel RAS
* K8 One UDS session for Improve Linux Kernel General Performance
* K7 One UDS session for Improve Linux Storage performance
* K6 One UDS session for monthly releases to be combined with validation
discussion - Nico & Paul Larson
* K5 One UDS session Standard Architecture and H/W support - Nico, Dave,
Tixy
* K4 Android - John
* K3 boot architecture Grant already registered a session
* K2 Grant is covering the sessions
* K1 One UDS session for planning
* K1.1 5 daily sessions for ARM / Linux interface 1.5-3 hours each (as a
mini-summit)
* Paul to cover for John at UDS
Regards,
Mounir
Otherwise, some applications which expect touchscreen device would crash
due to lacking of related resources.
This change is essential to LEB.
---
tasks/fake-ts/Android.mk | 29 +++++++++++++++++
tasks/fake-ts/fake-ts.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 105 insertions(+), 0 deletions(-)
create mode 100644 tasks/fake-ts/Android.mk
create mode 100644 tasks/fake-ts/fake-ts.c
diff --git a/tasks/fake-ts/Android.mk b/tasks/fake-ts/Android.mk
new file mode 100644
index 0000000..27a9298
--- /dev/null
+++ b/tasks/fake-ts/Android.mk
@@ -0,0 +1,29 @@
+# Copyright (C) 2011 Linaro Ltd.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH:= $(call my-dir)
+
+ifneq ($(TARGET_SIMULATOR),true)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := faketsd
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SRC_FILES := fake-ts.c
+LOCAL_PRELINK_MODULE := false
+
+include $(BUILD_EXECUTABLE)
+
+endif # !TARGET_SIMULATOR
diff --git a/tasks/fake-ts/fake-ts.c b/tasks/fake-ts/fake-ts.c
new file mode 100644
index 0000000..b5ec551
--- /dev/null
+++ b/tasks/fake-ts/fake-ts.c
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2009 0xlab - http://0xlab.org/
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ */
+
+#include <stdio.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+
+#include <linux/uinput.h>
+
+/* look up source file system/core/init/devices.c for exact node */
+#define UINPUT_DEV "/dev/uinput"
+
+#define DEV_NAME "Fake Touchscreen"
+
+static int uinput_fd = 0;
+
+static void uinput_touch_init(const char* uinput_dev,
+ const char* dev_name)
+{
+ struct uinput_user_dev dev;
+
+ uinput_fd = open(uinput_dev, O_WRONLY);
+ if (uinput_fd <= 0) {
+ perror("Error opening uinput device.\n");
+ return;
+ }
+ memset(&dev, 0, sizeof(dev));
+ strcpy(dev.name, dev_name);
+ write(uinput_fd, &dev, sizeof(dev));
+
+ /* touch screen event */
+ ioctl(uinput_fd, UI_SET_EVBIT, EV_ABS);
+ ioctl(uinput_fd, UI_SET_ABSBIT, ABS_X);
+ ioctl(uinput_fd, UI_SET_ABSBIT, ABS_Y);
+ ioctl(uinput_fd, UI_SET_EVBIT, EV_KEY);
+ ioctl(uinput_fd, UI_SET_KEYBIT, BTN_TOUCH);
+
+ /* register userspace input device */
+ ioctl(uinput_fd, UI_DEV_CREATE, 0);
+}
+
+static void uinput_touch_deinit()
+{
+ if (uinput_fd > 0) {
+ close(uinput_fd);
+ }
+}
+
+int main(int argc, char* argv[])
+{
+ uinput_touch_init(UINPUT_DEV, DEV_NAME);
+
+ while (1) {
+ sleep(60);
+ }
+
+ uinput_touch_deinit();
+
+ return 0;
+}
+
--
1.7.4.1
See https://wiki.linaro.org/OfficeofCTO/2011-04-26:
== Actions from previous meeting ==
* CARRIEDOVER: Steve to investigate Samsung bits
* ACTION: Grant to mail David with the exact sessions / meetings he would like to have
* Superseded, Grant has added blueprints to LDS, ready for scheduling
== Attendees ==
* David Rusling
* Patrik Ryd
* Grant Likely
=== Holiday ===
* Loïc Minier
* Steve !McIntyre
== Minutes ==
* Discussed Developer Summit
* Blueprints coming together, see [[https://blueprints.launchpad.net/sprints/uds-o?searchtext=linaro-]]
* David
* OCTO update to Linaro board, slides circulated
* ACTION: all, please review
* Monthly executive newsletter
* Emphasis on memory management
* Organising subarchitecture kernel maintenance in time for LDS
* Grant
* Working towards getting stuff merged into the device tree
* Russell looking at the device tree
* UDS: documents need to be readied for presenting
* ACTION: dig into device tree blueprint for Qemu / toolchain
* Patrik
* Busy getting things to work (Panda does, Beagle doesn't)
* Trying to get first Android LEB up and running, might demo at LDS
David Rusling, CTO
http://www.linaro.org
Linaro
Lockton House
Clarendon Rd
Cambridge
CB2 8FH
How significant is the cache maintenance over head?
It depends, the eMMC are much faster now
compared to a few years ago and cache maintenance cost more due to
multiple cache levels and speculative cache pre-fetch. In relation the
cost for handling the caches have increased and is now a bottle neck
dealing with fast eMMC together with DMA.
The intention for introducing none blocking mmc requests is to minimize the
time between a mmc request ends and another mmc request starts. In the
current implementation the MMC controller is idle when dma_map_sg and
dma_unmap_sg is processing. Introducing none blocking mmc request makes it
possible to prepare the caches for next job parallel with an active
mmc request.
This is done by making the issue_rw_rq() none blocking.
The increase in throughput is proportional to the time it takes to
prepare (major part of preparations is dma_map_sg and dma_unmap_sg)
a request and how fast the memory is. The faster the MMC/SD is
the more significant the prepare request time becomes. Measurements on U5500
and Panda on eMMC and SD shows significant performance gain for for large
reads when running DMA mode. In the PIO case the performance is unchanged.
There are two optional hooks pre_req() and post_req() that the host driver
may implement in order to move work to before and after the actual mmc_request
function is called. In the DMA case pre_req() may do dma_map_sg() and prepare
the dma descriptor and post_req runs the dma_unmap_sg.
Details on measurements from IOZone and mmc_test:
https://wiki.linaro.org/WorkingGroups/KernelConsolidation/Specs/StoragePerf…
Changes since v1:
* Add support for omap_hsmmc
* Add test in mmc_test to compare performance with
and without none blocking request.
* Add random fault injection in mmc core to exercise error
handling in the mmc block code.
* Fix serveral issue in the mmc block error handling.
* Add a host_cookie member in mmc_data to be used by
pre_req to mark the data. The host driver will then
check this mark to see if the data is prepared or not.
* Previous patch subject was
"add double buffering for mmc block requests".
Per Forlin (12):
mmc: add none blocking mmc request function
mmc: mmc_test: add debugfs file to list all tests
mmc: mmc_test: add test for none blocking transfers
mmc: add member in mmc queue struct to hold request data
mmc: add a block request prepare function
mmc: move error code in mmc_block_issue_rw_rq to a separate function.
mmc: add a second mmc queue request member
mmc: add handling for two parallel block requests in issue_rw_rq
mmc: test: add random fault injection in core.c
omap_hsmmc: use original sg_len for dma_unmap_sg
omap_hsmmc: add support for pre_req and post_req
mmci: implement pre_req() and post_req()
drivers/mmc/card/block.c | 493 +++++++++++++++++++++++++++--------------
drivers/mmc/card/mmc_test.c | 342 ++++++++++++++++++++++++++++-
drivers/mmc/card/queue.c | 171 +++++++++------
drivers/mmc/card/queue.h | 31 ++-
drivers/mmc/core/core.c | 132 ++++++++++-
drivers/mmc/core/debugfs.c | 5 +
drivers/mmc/host/mmci.c | 146 +++++++++++-
drivers/mmc/host/mmci.h | 8 +
drivers/mmc/host/omap_hsmmc.c | 90 +++++++-
include/linux/mmc/core.h | 9 +-
include/linux/mmc/host.h | 13 +-
lib/Kconfig.debug | 11 +
12 files changed, 1172 insertions(+), 279 deletions(-)
--
1.7.4.1
Here are what the patch set does.
* Remove .probe and .remove hooks from sdhci-pltfm.c and make it be
a pure common helper function providers.
* Add .probe and .remove hooks for sdhci pltfm drivers sdhci-cns3xxx,
sdhci-dove, sdhci-tegra, and sdhci-esdhc-imx to make them self
registered with calling helper functions created above.
* Migrate the use of sdhci_of_host and sdhci_of_data to
sdhci_pltfm_host and sdhci_pltfm_data, so that OF version host and
data structure works can be saved, and pltfm version works for both
cases.
* Add OF common helper stuff into sdhci-pltfm.c, and make OF version
sdhci drivers sdhci-of-esdhc and sdhci-of-hlwd become self
registered as well, so that sdhci-of-core.c and sdhci-of.h can be
removed.
* Consolidate the OF and pltfm esdhc drivers into one with sharing
the same pair of .probe and .remove hooks. As a result,
sdhci-esdhc-imx.c and sdhci-of-esdhc.c go away, while
sdhci-esdhc.c comes in and works for both MPCxxx and i.MX.
* Eliminate include/linux/mmc/sdhci-pltfm.h with moving stuff into
drivers/mmc/host/sdhci-pltfm.h.
And the benefits we gain from the changes are:
* Get the sdhci device driver follow the Linux trend that driver
makes the registration by its own.
* sdhci-pltfm.c becomes simple and clean as it only has common helper
stuff there now.
* All sdhci device specific things are going back its own driver.
* The dt and non-dt drivers are consolidated to use the same pair of
.probe and .remove hooks.
* SDHCI driver for Freescale eSDHC controller found on both MPCxxx
and i.MX platforms is consolidated to use the same one .probe
function.
The patch set works against the tree below, and was only tested on
i.mx51 babbage board, all other targets were build tested.
git://git.secretlab.ca/git/linux-2.6.git devicetree/test
Comments are welcomed and appreciated.
Regards,
Shawn
PS: The first patch is a squashing of the patch set below, which was
posted for review a few days back.
[PATCH 0/5] make sdhci device drivers self registered
Some patches in this series are relatively large, involving more
changes than expected, I chose to not split considering they are
logically integral, and doing so can reduce the patch quantity much,
and make bisect much easier. But sorry for that it makes reviewers'
life harder.
Shawn Guo (5):
mmc: sdhci: make sdhci-pltfm device drivers self registered
mmc: sdhci: eliminate sdhci_of_host and sdhci_of_data
mmc: sdhci: make sdhci-of device drivers self registered
mmc: sdhci: consolidate sdhci-of-esdhc and sdhci-esdhc-imx
mmc: sdhci: merge two sdhci-pltfm.h into one
drivers/mmc/host/Kconfig | 71 ++++---
drivers/mmc/host/Makefile | 17 +-
drivers/mmc/host/sdhci-cns3xxx.c | 68 ++++++-
drivers/mmc/host/sdhci-dove.c | 69 ++++++-
drivers/mmc/host/sdhci-esdhc-imx.c | 149 -------------
drivers/mmc/host/sdhci-esdhc.c | 412 ++++++++++++++++++++++++++++++++++++
drivers/mmc/host/sdhci-of-core.c | 247 ---------------------
drivers/mmc/host/sdhci-of-esdhc.c | 89 --------
drivers/mmc/host/sdhci-of-hlwd.c | 89 +++++++-
drivers/mmc/host/sdhci-of.h | 42 ----
drivers/mmc/host/sdhci-pltfm.c | 251 +++++++++-------------
drivers/mmc/host/sdhci-pltfm.h | 36 +++-
drivers/mmc/host/sdhci-tegra.c | 187 ++++++++++-------
include/linux/mmc/sdhci-pltfm.h | 35 ---
14 files changed, 912 insertions(+), 850 deletions(-)