Build error in torvalds kernel 3.11 for omap2plus

2013-09-08 Thread Anil Kumar
Hi All,

I am getting below build error in torvalds kernel 3.11 for omap2plus.


scripts/kconfig/conf --silentoldconfig Kconfig
  CHK include/generated/uapi/linux/version.h
  CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
  CALLscripts/checksyscalls.sh
  CHK include/generated/compile.h
  AS  arch/arm/mm/cache-v7.o
arch/arm/mm/cache-v7.S: Assembler messages:
arch/arm/mm/cache-v7.S:285: Error: garbage following instruction -- `dsb ishst'
arch/arm/mm/cache-v7.S:297: Error: garbage following instruction -- `dsb ishst'
make[1]: *** [arch/arm/mm/cache-v7.o] Error 1
make: *** [arch/arm/mm] Error 2

Thanks
Anil
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 1/2] ARM: OMAP: Add secure function omap_smc3() which calling instruction smc #1

2013-09-08 Thread Pali Rohár
Here is new version (v4) of omap secure part patch:

Other secure functions omap_smc1() and omap_smc2() calling instruction smc #0
but Nokia RX-51 board needs to call smc #1 for PPA access.

Signed-off-by: Ivaylo Dimitrov freemangor...@abv.bg
Signed-off-by: Pali Rohár pali.ro...@gmail.com
---
diff --git a/arch/arm/mach-omap2/omap-secure.h 
b/arch/arm/mach-omap2/omap-secure.h
index 0e72917..c4586f4 100644
--- a/arch/arm/mach-omap2/omap-secure.h
+++ b/arch/arm/mach-omap2/omap-secure.h
@@ -51,6 +51,7 @@
 extern u32 omap_secure_dispatcher(u32 idx, u32 flag, u32 nargs,
u32 arg1, u32 arg2, u32 arg3, u32 arg4);
 extern u32 omap_smc2(u32 id, u32 falg, u32 pargs);
+extern u32 omap_smc3(u32 id, u32 process, u32 flag, u32 pargs);
 extern phys_addr_t omap_secure_ram_mempool_base(void);
 extern int omap_secure_ram_reserve_memblock(void);
 
diff --git a/arch/arm/mach-omap2/omap-smc.S b/arch/arm/mach-omap2/omap-smc.S
index f6441c1..fd90125 100644
--- a/arch/arm/mach-omap2/omap-smc.S
+++ b/arch/arm/mach-omap2/omap-smc.S
@@ -1,9 +1,11 @@
 /*
- * OMAP44xx secure APIs file.
+ * OMAP34xx and OMAP44xx secure APIs file.
  *
  * Copyright (C) 2010 Texas Instruments, Inc.
  * Written by Santosh Shilimkar santosh.shilim...@ti.com
  *
+ * Copyright (C) 2012 Ivaylo Dimitrov freemangor...@abv.bg
+ * Copyright (C) 2013 Pali Rohár pali.ro...@gmail.com
  *
  * This program is free software,you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -54,6 +56,23 @@ ENTRY(omap_smc2)
ldmfd   sp!, {r4-r12, pc}
 ENDPROC(omap_smc2)
 
+/**
+ * u32 omap_smc3(u32 service_id, u32 process_id, u32 flag, u32 pargs)
+ * Low level common routine for secure HAL and PPA APIs via smc #1
+ * r0 - @service_id: Secure Service ID
+ * r1 - @process_id: Process ID
+ * r2 - @flag: Flag to indicate the criticality of operation
+ * r3 - @pargs: Physical address of parameter list
+ */
+ENTRY(omap_smc3)
+   stmfd   sp!, {r4-r11, lr}
+   mov r12, r0 @ Copy the secure service ID
+   mov r6, #0xff   @ Indicate new Task call
+   dsb @ Memory Barrier (not sure if needed, copied 
from omap_smc2)
+   smc #1  @ Call PPA service
+   ldmfd   sp!, {r4-r11, pc}
+ENDPROC(omap_smc3)
+
 ENTRY(omap_modify_auxcoreboot0)
stmfd   sp!, {r1-r12, lr}
ldr r12, =0x104


-- 
Pali Rohár
pali.ro...@gmail.com


signature.asc
Description: This is a digitally signed message part.


[PATCH 3/4] power: isp1704_charger: Add callback function set_current

2013-09-08 Thread Pali Rohár
This patch add callback function set_current to platform data.
Driver will call this function when isp1704 change current
and board provided this callback funtion in platform data.

This patch is needed for Nokia RX-51 to tell bq2415x charging
chip about connected wallcharger events.

Signed-off-by: Pali Rohár pali.ro...@gmail.com
---
 drivers/power/isp1704_charger.c   |   16 
 include/linux/power/isp1704_charger.h |1 +
 2 files changed, 17 insertions(+)

diff --git a/drivers/power/isp1704_charger.c b/drivers/power/isp1704_charger.c
index f726cb6..4f20a1a 100644
--- a/drivers/power/isp1704_charger.c
+++ b/drivers/power/isp1704_charger.c
@@ -91,6 +91,18 @@ static void isp1704_charger_set_power(struct isp1704_charger 
*isp, bool on)
 }
 
 /*
+ * Set charger current from isp1704 if a function for it
+ * has been provided with platform data.
+ */
+static void isp1704_charger_set_current(struct isp1704_charger *isp, int mA)
+{
+   struct isp1704_charger_data *board = isp-dev-platform_data;
+
+   if (board  board-set_current)
+   board-set_current(mA);
+}
+
+/*
  * Determine is the charging port DCP (dedicated charger) or CDP (Host/HUB
  * chargers).
  *
@@ -257,6 +269,7 @@ static void isp1704_charger_work(struct work_struct *data)
if (isp1704_charger_detect_dcp(isp)) {
isp-psy.type = POWER_SUPPLY_TYPE_USB_DCP;
isp-current_max = 1800;
+   isp1704_charger_set_current(isp, 1800);
} else {
isp-psy.type = POWER_SUPPLY_TYPE_USB;
isp-current_max = 500;
@@ -277,6 +290,8 @@ static void isp1704_charger_work(struct work_struct *data)
 
if (isp-current_max  100)
isp-psy.type = POWER_SUPPLY_TYPE_USB_CDP;
+
+   isp1704_charger_set_current(isp, isp-current_max);
}
break;
case USB_EVENT_NONE:
@@ -297,6 +312,7 @@ static void isp1704_charger_work(struct work_struct *data)
usb_gadget_disconnect(isp-phy-otg-gadget);
 
isp1704_charger_set_power(isp, 0);
+   isp1704_charger_set_current(isp, 0);
break;
default:
goto out;
diff --git a/include/linux/power/isp1704_charger.h 
b/include/linux/power/isp1704_charger.h
index 68096a6..d154b02 100644
--- a/include/linux/power/isp1704_charger.h
+++ b/include/linux/power/isp1704_charger.h
@@ -24,6 +24,7 @@
 
 struct isp1704_charger_data {
void(*set_power)(bool on);
+   void(*set_current)(int mA);
 };
 
 #endif
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/4] RX-51: Add platform function and data for bq24150a charger

2013-09-08 Thread Pali Rohár
This patch will register bq24150a charger in RX-51 board data.
Patch also adding platform function between isp1704 and bq2415x
drivers for detecting charger type.

So finally charging battery on Nokia N900 (RX-51) working
automatically without any proprietary Nokia bits in userspace.

Signed-off-by: Pali Rohár pali.ro...@gmail.com
---
 arch/arm/mach-omap2/board-rx51-peripherals.c |   56 +-
 1 file changed, 55 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c 
b/arch/arm/mach-omap2/board-rx51-peripherals.c
index 9c2dd10..a993ffe 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -25,6 +25,7 @@
 #include linux/gpio_keys.h
 #include linux/mmc/host.h
 #include linux/power/isp1704_charger.h
+#include linux/power/bq2415x_charger.h
 #include linux/platform_data/spi-omap2-mcspi.h
 #include linux/platform_data/mtd-onenand-omap2.h
 
@@ -270,6 +271,44 @@ static struct platform_device rx51_battery_device = {
.id = -1,
 };
 
+static enum bq2415x_mode rx51_charger_mode = BQ2415X_MODE_OFF;
+static void *rx51_charger_hook_data;
+static void (*rx51_charger_hook)(enum bq2415x_mode mode, void *data);
+
+static int rx51_charger_set_hook(
+   void (*hook)(enum bq2415x_mode mode, void *data), void *data)
+{
+   rx51_charger_hook = hook;
+   rx51_charger_hook_data = data;
+   if (rx51_charger_hook)
+   rx51_charger_hook(rx51_charger_mode, rx51_charger_hook_data);
+   return 1;
+}
+
+static void rx51_charger_set_current(int mA)
+{
+   enum bq2415x_mode mode;
+
+   pr_info(RX-51: Charger current limit is %d mA\n, mA);
+
+   if (mA == 0)
+   mode = BQ2415X_MODE_OFF;
+   else if (mA  500)
+   mode = BQ2415X_MODE_NONE;
+   else if (mA  1800)
+   mode = BQ2415X_MODE_HOST_CHARGER;
+   else
+   mode = BQ2415X_MODE_DEDICATED_CHARGER;
+
+   if (rx51_charger_mode == mode)
+   return;
+
+   rx51_charger_mode = mode;
+
+   if (rx51_charger_hook)
+   rx51_charger_hook(rx51_charger_mode, rx51_charger_hook_data);
+}
+
 static void rx51_charger_set_power(bool on)
 {
gpio_set_value(RX51_USB_TRANSCEIVER_RST_GPIO, on);
@@ -277,6 +316,7 @@ static void rx51_charger_set_power(bool on)
 
 static struct isp1704_charger_data rx51_charger_data = {
.set_power  = rx51_charger_set_power,
+   .set_current= rx51_charger_set_current,
 };
 
 static struct platform_device rx51_charger_device = {
@@ -1017,6 +1057,16 @@ static struct aic3x_pdata rx51_aic3x_data2 = {
.gpio_reset = 60,
 };
 
+static struct bq2415x_platform_data rx51_bq24150a_platform_data = {
+   .current_limit = 100,   /* mA */
+   .weak_battery_voltage = 3400,   /* mV */
+   .battery_regulation_voltage = 4200, /* mV */
+   .charge_current = 650,  /* mA */
+   .termination_current = 100, /* mA */
+   .resistor_sense = 68,   /* m ohm */
+   .set_mode_hook = rx51_charger_set_hook,
+};
+
 static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_2[] = {
{
I2C_BOARD_INFO(tlv320aic3x, 0x18),
@@ -1044,7 +1094,11 @@ static struct i2c_board_info __initdata 
rx51_peripherals_i2c_board_info_2[] = {
{
I2C_BOARD_INFO(tpa6130a2, 0x60),
.platform_data = rx51_tpa6130a2_data,
-   }
+   },
+   {
+   I2C_BOARD_INFO(bq24150a, 0x6b),
+   .platform_data = rx51_bq24150a_platform_data,
+   },
 };
 
 static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_3[] = {
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/4] power: isp1704_charger: Fix driver to work with changes introduced in v3.5

2013-09-08 Thread Pali Rohár
* omap musb driver does not report USB_EVENT_ENUMERATED event anymore
* omap musb driver reporting USB_EVENT_VBUS when charger is connected
* read last event from phy-last_event (instead from ulpi register)
* do not call wall charger detection more times

Signed-off-by: Pali Rohár pali.ro...@gmail.com
---
 drivers/power/isp1704_charger.c |   91 +--
 1 file changed, 40 insertions(+), 51 deletions(-)

diff --git a/drivers/power/isp1704_charger.c b/drivers/power/isp1704_charger.c
index fc04d19..f726cb6 100644
--- a/drivers/power/isp1704_charger.c
+++ b/drivers/power/isp1704_charger.c
@@ -2,6 +2,7 @@
  * ISP1704 USB Charger Detection driver
  *
  * Copyright (C) 2010 Nokia Corporation
+ * Copyright (C) 2012 - 2013 Pali Rohár pali.ro...@gmail.com
  *
  * 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
@@ -65,10 +66,6 @@ struct isp1704_charger {
unsignedpresent:1;
unsignedonline:1;
unsignedcurrent_max;
-
-   /* temp storage variables */
-   unsigned long   event;
-   unsignedmax_power;
 };
 
 static inline int isp1704_read(struct isp1704_charger *isp, u32 reg)
@@ -231,56 +228,59 @@ static inline int isp1704_charger_detect(struct 
isp1704_charger *isp)
return ret;
 }
 
+static inline int isp1704_charger_detect_dcp(struct isp1704_charger *isp)
+{
+   if (isp1704_charger_detect(isp) 
+   isp1704_charger_type(isp) == POWER_SUPPLY_TYPE_USB_DCP)
+   return true;
+   else
+   return false;
+}
+
 static void isp1704_charger_work(struct work_struct *data)
 {
-   int detect;
-   unsigned long   event;
-   unsignedpower;
struct isp1704_charger  *isp =
container_of(data, struct isp1704_charger, work);
static DEFINE_MUTEX(lock);
 
-   event = isp-event;
-   power = isp-max_power;
-
mutex_lock(lock);
 
-   if (event != USB_EVENT_NONE)
-   isp1704_charger_set_power(isp, 1);
-
-   switch (event) {
+   switch (isp-phy-last_event) {
case USB_EVENT_VBUS:
-   isp-online = true;
+   /* do not call wall charger detection more times */
+   if (!isp-present) {
+   isp-online = true;
+   isp-present = 1;
+   isp1704_charger_set_power(isp, 1);
+
+   /* detect wall charger */
+   if (isp1704_charger_detect_dcp(isp)) {
+   isp-psy.type = POWER_SUPPLY_TYPE_USB_DCP;
+   isp-current_max = 1800;
+   } else {
+   isp-psy.type = POWER_SUPPLY_TYPE_USB;
+   isp-current_max = 500;
+   }
 
-   /* detect charger */
-   detect = isp1704_charger_detect(isp);
-
-   if (detect) {
-   isp-present = detect;
-   isp-psy.type = isp1704_charger_type(isp);
+   /* enable data pullups */
+   if (isp-phy-otg-gadget)
+   usb_gadget_connect(isp-phy-otg-gadget);
}
 
-   switch (isp-psy.type) {
-   case POWER_SUPPLY_TYPE_USB_DCP:
-   isp-current_max = 1800;
-   break;
-   case POWER_SUPPLY_TYPE_USB_CDP:
+   if (isp-psy.type != POWER_SUPPLY_TYPE_USB_DCP) {
/*
 * Only 500mA here or high speed chirp
 * handshaking may break
 */
-   isp-current_max = 500;
-   /* FALLTHROUGH */
-   case POWER_SUPPLY_TYPE_USB:
-   default:
-   /* enable data pullups */
-   if (isp-phy-otg-gadget)
-   usb_gadget_connect(isp-phy-otg-gadget);
+   if (isp-current_max  500)
+   isp-current_max = 500;
+
+   if (isp-current_max  100)
+   isp-psy.type = POWER_SUPPLY_TYPE_USB_CDP;
}
break;
case USB_EVENT_NONE:
isp-online = false;
-   isp-current_max = 0;
isp-present = 0;
isp-current_max = 0;
isp-psy.type = POWER_SUPPLY_TYPE_USB;
@@ -298,12 +298,6 @@ static void isp1704_charger_work(struct work_struct *data)
 
isp1704_charger_set_power(isp, 0);
break;
-   case USB_EVENT_ENUMERATED:
-   if (isp-present)
-   isp-current_max = 1800;
-   else
-  

[PATCH 0/4] Add support for charging battery in Nokia RX-51

2013-09-08 Thread Pali Rohár
This patch series finally bringing support for charging battery on
Nokia N900 (RX-51) without any proprietary Nokia bits in userspace.

Pali Rohár (4):
  usb: musb: Call atomic_notifier_call_chain when status is changed
  power: isp1704_charger: Fix driver to work with changes introduced in
v3.5
  power: isp1704_charger: Add callback function set_current
  RX-51: Add platform function and data for bq24150a charger

 arch/arm/mach-omap2/board-rx51-peripherals.c |   56 +-
 drivers/power/isp1704_charger.c  |  107 ++
 drivers/usb/musb/omap2430.c  |3 +
 drivers/usb/phy/phy-twl4030-usb.c|2 +
 include/linux/power/isp1704_charger.h|1 +
 5 files changed, 117 insertions(+), 52 deletions(-)

-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/4] usb: musb: Call atomic_notifier_call_chain when status is changed

2013-09-08 Thread Pali Rohár
More power supply drivers depends on vbus events and without it they not
working. Power supply drivers using usb_register_notifier, so to deliver
events it is needed to call atomic_notifier_call_chain.

So without atomic notifier power supply driver isp1704 not retrieving
vbus status and reporting bogus values to userspace and also to board
platform data functions. Without proper data charger drivers trying to
charge battery also when charger is disconnected or do not start charging
when wallcharger connects.

Atomic notifier in musb driver was used before v3.5 and was replaced with
omap mailbox. This patch adding atomic_notifier_call_chain call from
function omap_musb_set_mailbox.

Signed-off-by: Pali Rohár pali.ro...@gmail.com
---
 drivers/usb/musb/omap2430.c   |3 +++
 drivers/usb/phy/phy-twl4030-usb.c |2 ++
 2 files changed, 5 insertions(+)

diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index f44e8b5..5c40252 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -305,6 +305,9 @@ static void omap_musb_set_mailbox(struct omap2430_glue 
*glue)
default:
dev_dbg(dev, ID float\n);
}
+
+   atomic_notifier_call_chain(musb-xceiv-notifier,
+   musb-xceiv-last_event, NULL);
 }
 
 
diff --git a/drivers/usb/phy/phy-twl4030-usb.c 
b/drivers/usb/phy/phy-twl4030-usb.c
index 8f78d2d..efe6155 100644
--- a/drivers/usb/phy/phy-twl4030-usb.c
+++ b/drivers/usb/phy/phy-twl4030-usb.c
@@ -705,6 +705,8 @@ static int twl4030_usb_probe(struct platform_device *pdev)
if (device_create_file(pdev-dev, dev_attr_vbus))
dev_warn(pdev-dev, could not create sysfs file\n);
 
+   ATOMIC_INIT_NOTIFIER_HEAD(twl-phy.notifier);
+
/* Our job is to use irqs and status from the power module
 * to keep the transceiver disabled when nothing's connected.
 *
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Build error in torvalds kernel 3.11 for omap2plus

2013-09-08 Thread Russell King - ARM Linux
On Sun, Sep 08, 2013 at 11:34:10AM +0530, Anil Kumar wrote:
 scripts/kconfig/conf --silentoldconfig Kconfig
   CHK include/generated/uapi/linux/version.h
   CHK include/generated/utsrelease.h
 make[1]: `include/generated/mach-types.h' is up to date.
   CALLscripts/checksyscalls.sh
   CHK include/generated/compile.h
   AS  arch/arm/mm/cache-v7.o
 arch/arm/mm/cache-v7.S: Assembler messages:
 arch/arm/mm/cache-v7.S:285: Error: garbage following instruction -- `dsb 
 ishst'
 arch/arm/mm/cache-v7.S:297: Error: garbage following instruction -- `dsb 
 ishst'
 make[1]: *** [arch/arm/mm/cache-v7.o] Error 1
 make: *** [arch/arm/mm] Error 2

You need a later binutils for these instructions - 2.22 works just fine,
even with gcc 4.5.x.
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv3] ARM: OMAP2+: am335x-bone*: add DT for BeagleBone Black

2013-09-08 Thread Koen Kooi
The BeagleBone Black is basically a regular BeagleBone with eMMC and HDMI added,
so create a common dtsi both can use.

IMPORTANT: booting the existing am335x-bone.dts will blow up the HDMI 
transceiver 
after a dozen boots with an uSD card inserted because LDO will be at 3.3V 
instead
of 1.8. 

MMC support for AM335x still isn't in, so only the LDO change has been added.

Signed-off-by: Koen Kooi k...@dominion.thruhere.net
---

Changes since 2:
Updated commit message to point out that the existing DT will damage 
the board.
Changes since v1:
Added the Makefile entry for the new dts

 arch/arm/boot/dts/Makefile |   1 +
 .../{am335x-bone.dts = am335x-bone-common.dtsi}   |   3 -
 arch/arm/boot/dts/am335x-bone.dts  | 256 +
 arch/arm/boot/dts/am335x-boneblack.dts |  18 ++
 4 files changed, 20 insertions(+), 258 deletions(-)
 copy arch/arm/boot/dts/{am335x-bone.dts = am335x-bone-common.dtsi} (99%)
 create mode 100644 arch/arm/boot/dts/am335x-boneblack.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 641b3c9a..b7c0c52 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -171,6 +171,7 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
am335x-evm.dtb \
am335x-evmsk.dtb \
am335x-bone.dtb \
+   am335x-boneblack.dtb \
am3517-evm.dtb \
am3517_mt_ventoux.dtb \
am43x-epos-evm.dtb
diff --git a/arch/arm/boot/dts/am335x-bone.dts 
b/arch/arm/boot/dts/am335x-bone-common.dtsi
similarity index 99%
copy from arch/arm/boot/dts/am335x-bone.dts
copy to arch/arm/boot/dts/am335x-bone-common.dtsi
index d318987..2f66ded 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone-common.dtsi
@@ -5,9 +5,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-/dts-v1/;
-
-#include am33xx.dtsi
 
 / {
model = TI AM335x BeagleBone;
diff --git a/arch/arm/boot/dts/am335x-bone.dts 
b/arch/arm/boot/dts/am335x-bone.dts
index d318987..7993c48 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -8,258 +8,4 @@
 /dts-v1/;
 
 #include am33xx.dtsi
-
-/ {
-   model = TI AM335x BeagleBone;
-   compatible = ti,am335x-bone, ti,am33xx;
-
-   cpus {
-   cpu@0 {
-   cpu0-supply = dcdc2_reg;
-   };
-   };
-
-   memory {
-   device_type = memory;
-   reg = 0x8000 0x1000; /* 256 MB */
-   };
-
-   am33xx_pinmux: pinmux@44e10800 {
-   pinctrl-names = default;
-   pinctrl-0 = clkout2_pin;
-
-   user_leds_s0: user_leds_s0 {
-   pinctrl-single,pins = 
-   0x54 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)  /* 
gpmc_a5.gpio1_21 */
-   0x58 (PIN_OUTPUT_PULLUP | MUX_MODE7)/* 
gpmc_a6.gpio1_22 */
-   0x5c (PIN_OUTPUT_PULLDOWN | MUX_MODE7)  /* 
gpmc_a7.gpio1_23 */
-   0x60 (PIN_OUTPUT_PULLUP | MUX_MODE7)/* 
gpmc_a8.gpio1_24 */
-   ;
-   };
-
-   i2c0_pins: pinmux_i2c0_pins {
-   pinctrl-single,pins = 
-   0x188 (PIN_INPUT_PULLUP | MUX_MODE0)/* 
i2c0_sda.i2c0_sda */
-   0x18c (PIN_INPUT_PULLUP | MUX_MODE0)/* 
i2c0_scl.i2c0_scl */
-   ;
-   };
-
-   uart0_pins: pinmux_uart0_pins {
-   pinctrl-single,pins = 
-   0x170 (PIN_INPUT_PULLUP | MUX_MODE0)/* 
uart0_rxd.uart0_rxd */
-   0x174 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* 
uart0_txd.uart0_txd */
-   ;
-   };
-
-   clkout2_pin: pinmux_clkout2_pin {
-   pinctrl-single,pins = 
-   0x1b4 (PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* 
xdma_event_intr1.clkout2 */
-   ;
-   };
-
-   cpsw_default: cpsw_default {
-   pinctrl-single,pins = 
-   /* Slave 1 */
-   0x110 (PIN_INPUT_PULLUP | MUX_MODE0)/* 
mii1_rxerr.mii1_rxerr */
-   0x114 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* 
mii1_txen.mii1_txen */
-   0x118 (PIN_INPUT_PULLUP | MUX_MODE0)/* 
mii1_rxdv.mii1_rxdv */
-   0x11c (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* 
mii1_txd3.mii1_txd3 */
-   0x120 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* 
mii1_txd2.mii1_txd2 */
-   0x124 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* 
mii1_txd1.mii1_txd1 */
-   0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* 

[RFC PATCH 4/4] ARM: dts: am33xx: adopt to cpsw-phy-sel driver to configure phy mode

2013-09-08 Thread Mugunthan V N
Add DT entries for the phy mode selection in AM33xx SoC using cpsw-phy-sel
driver.

Signed-off-by: Mugunthan V N mugunthan...@ti.com
---
 arch/arm/boot/dts/am33xx.dtsi | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index f9c5da9..4359672 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -594,6 +594,12 @@
/* Filled in by U-Boot */
mac-address = [ 00 00 00 00 00 00 ];
};
+
+   phy_sel: cpsw_phy_sel@44e10650 {
+   compatible = ti,am3352-cpsw-phy-sel;
+   reg= 0x44e10650 0x4;
+   reg-names = gmii-sel;
+   };
};
 
ocmcram: ocmcram@4030 {
-- 
1.8.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC PATCH 0/4] cpsw: support for control module register

2013-09-08 Thread Mugunthan V N
This patch series adds the support for configuring GMII_SEL register
of control module to select the phy mode type and also to configure
the clock source for RMII phy mode whether to use internal clock or
the external clock from the phy itself.

Till now CPSW works as this configuration is done in U-Boot and carried
over to the kernel. But during suspend/resume Control module tends to
lose its configured value for GMII_SEL register in AM33xx PG1.0, so
if CPSW is used in RMII or RGMII mode, on resume cpsw is not working
as GMII_SEL register lost its configuration values.

The initial version of the patch is done by Daniel Mack but as per
Tony's comment he wants it as a seperate driver as it is done in USB
control module. I have created a seperate driver for the same and as
the merge window is open now and no feature request is accepted I am
submitting it as RFC for reviews.

Daniel Mack (1):
  net: ethernet: cpsw: switch to devres allocations

Mugunthan V N (3):
  drivers: net: cpsw-phy-sel: Add new driver for phy mode selection for
cpsw
  drivers: net: cpsw: use cpsw-phy-sel driver to configure phy mode
  ARM: dts: am33xx: adopt to cpsw-phy-sel driver to configure phy mode

 .../devicetree/bindings/net/cpsw-phy-sel.txt   |  28 
 arch/arm/boot/dts/am33xx.dtsi  |   6 +
 drivers/net/ethernet/ti/Kconfig|   8 +
 drivers/net/ethernet/ti/Makefile   |   1 +
 drivers/net/ethernet/ti/cpsw-phy-sel.c | 161 +
 drivers/net/ethernet/ti/cpsw.c | 157 ++--
 drivers/net/ethernet/ti/cpsw.h |   2 +
 7 files changed, 253 insertions(+), 110 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/cpsw-phy-sel.txt
 create mode 100644 drivers/net/ethernet/ti/cpsw-phy-sel.c

-- 
1.8.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC PATCH 3/4] drivers: net: cpsw: use cpsw-phy-sel driver to configure phy mode

2013-09-08 Thread Mugunthan V N
Phy mode can be configured via the cpsw-phy-sel driver, this patch enabled the
cpsw driver to utilise the api provided by the cpsw-phy-sel driver to configure
the phy mode.

Signed-off-by: Mugunthan V N mugunthan...@ti.com
---
 drivers/net/ethernet/ti/cpsw.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 01c42e1..5efb37b 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -1021,6 +1021,10 @@ static void cpsw_slave_open(struct cpsw_slave *slave, 
struct cpsw_priv *priv)
dev_info(priv-dev, phy found : id is : 0x%x\n,
 slave-phy-phy_id);
phy_start(slave-phy);
+
+   /* Configure GMII_SEL register */
+   cpsw_phy_sel(priv-pdev-dev, slave-phy-interface,
+slave-slave_num);
}
 }
 
-- 
1.8.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC PATCH 2/4] drivers: net: cpsw-phy-sel: Add new driver for phy mode selection for cpsw

2013-09-08 Thread Mugunthan V N
The cpsw currently lacks code to properly set up the hardware interface
mode on AM33xx. Other platforms might be equally affected.

Usually, the bootloader will configure the control module register, so
probably that's why such support wasn't needed in the past. In suspend
mode though, this register is modified, and so it needs reprogramming
after resume.

This patch adds a new driver in which hardware interface can configure
correct register bits when the slave is opened.

The AM33xx also has a bit for each slave to configure the RMII reference
clock direction. Setting it is now supported by a per-slave DT property.

This code path introducted by this patch is currently exclusive for
am33xx and same can be extened to various platforms via the DT compatibility
property.

Signed-off-by: Mugunthan V N mugunthan...@ti.com
---
 .../devicetree/bindings/net/cpsw-phy-sel.txt   |  28 
 drivers/net/ethernet/ti/Kconfig|   8 +
 drivers/net/ethernet/ti/Makefile   |   1 +
 drivers/net/ethernet/ti/cpsw-phy-sel.c | 161 +
 drivers/net/ethernet/ti/cpsw.h |   2 +
 5 files changed, 200 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/cpsw-phy-sel.txt
 create mode 100644 drivers/net/ethernet/ti/cpsw-phy-sel.c

diff --git a/Documentation/devicetree/bindings/net/cpsw-phy-sel.txt 
b/Documentation/devicetree/bindings/net/cpsw-phy-sel.txt
new file mode 100644
index 000..d45fc83
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/cpsw-phy-sel.txt
@@ -0,0 +1,28 @@
+TI CPSW Phy mode Selection Device Tree Bindings
+---
+
+Required properties:
+- compatible   : Should be ti,am3352-cpsw-phy-sel
+- reg  : physical base address and size of the cpsw
+ registers map
+- reg-names: names of the register map given in reg node
+
+Optional properties:
+-rmii-clock-ext: If present, the driver will configure the RMII
+ interface to external clock usage
+
+Examples:
+
+   phy_sel: cpsw_phy_sel@44e10650 {
+   compatible = ti,am3352-cpsw-phy-sel;
+   reg= 0x44e10650 0x4;
+   reg-names = gmii-sel;
+   };
+
+(or)
+   phy_sel: cpsw_phy_sel@44e10650 {
+   compatible = ti,am3352-cpsw-phy-sel;
+   reg= 0x44e10650 0x4;
+   reg-names = gmii-sel;
+   rmii-clock-ext;
+   };
diff --git a/drivers/net/ethernet/ti/Kconfig b/drivers/net/ethernet/ti/Kconfig
index de71b1e..53150c2 100644
--- a/drivers/net/ethernet/ti/Kconfig
+++ b/drivers/net/ethernet/ti/Kconfig
@@ -49,11 +49,19 @@ config TI_DAVINCI_CPDMA
  To compile this driver as a module, choose M here: the module
  will be called davinci_cpdma.  This is recommended.
 
+config TI_CPSW_PHY_SEL
+   boolean TI CPSW Switch Phy sel Support
+   depends on TI_CPSW
+   ---help---
+ This driver supports configuring of the phy mode connected to
+ the CPSW.
+
 config TI_CPSW
tristate TI CPSW Switch Support
depends on ARM  (ARCH_DAVINCI || SOC_AM33XX)
select TI_DAVINCI_CPDMA
select TI_DAVINCI_MDIO
+   select TI_CPSW_PHY_SEL
---help---
  This driver supports TI's CPSW Ethernet Switch.
 
diff --git a/drivers/net/ethernet/ti/Makefile b/drivers/net/ethernet/ti/Makefile
index c65148e..9cfaab8 100644
--- a/drivers/net/ethernet/ti/Makefile
+++ b/drivers/net/ethernet/ti/Makefile
@@ -7,5 +7,6 @@ obj-$(CONFIG_CPMAC) += cpmac.o
 obj-$(CONFIG_TI_DAVINCI_EMAC) += davinci_emac.o
 obj-$(CONFIG_TI_DAVINCI_MDIO) += davinci_mdio.o
 obj-$(CONFIG_TI_DAVINCI_CPDMA) += davinci_cpdma.o
+obj-$(CONFIG_TI_CPSW_PHY_SEL) += cpsw-phy-sel.o
 obj-$(CONFIG_TI_CPSW) += ti_cpsw.o
 ti_cpsw-y := cpsw_ale.o cpsw.o cpts.o
diff --git a/drivers/net/ethernet/ti/cpsw-phy-sel.c 
b/drivers/net/ethernet/ti/cpsw-phy-sel.c
new file mode 100644
index 000..593f459
--- /dev/null
+++ b/drivers/net/ethernet/ti/cpsw-phy-sel.c
@@ -0,0 +1,161 @@
+/* Texas Instruments Ethernet Switch Driver
+ *
+ * Copyright (C) 2013 Texas Instruments
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include linux/platform_device.h
+#include linux/module.h
+#include linux/netdevice.h
+#include linux/phy.h
+#include linux/of.h
+#include linux/of_device.h
+
+#include cpsw.h
+
+/* AM33xx SoC specific definitions for the CONTROL port */
+#define AM33XX_GMII_SEL_MODE_MII   0
+#define AM33XX_GMII_SEL_MODE_RMII  1
+#define 

[RFC PATCH 1/4] net: ethernet: cpsw: switch to devres allocations

2013-09-08 Thread Mugunthan V N
From: Daniel Mack zon...@gmail.com

This patch cleans up the allocation and error unwind paths, which
allows us to carry less information in struct cpsw_priv and reduce the
amount of jump labels in the probe functions.

Signed-off-by: Daniel Mack zon...@gmail.com
Acked-by: Mugunthan V N mugunthan...@ti.com
Signed-off-by: Mugunthan V N mugunthan...@ti.com
---
 drivers/net/ethernet/ti/cpsw.c | 153 -
 1 file changed, 43 insertions(+), 110 deletions(-)

diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 79974e3..01c42e1 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -367,8 +367,6 @@ struct cpsw_priv {
spinlock_t  lock;
struct platform_device  *pdev;
struct net_device   *ndev;
-   struct resource *cpsw_res;
-   struct resource *cpsw_wr_res;
struct napi_struct  napi;
struct device   *dev;
struct cpsw_platform_data   data;
@@ -1712,62 +1710,55 @@ static int cpsw_probe_dt(struct cpsw_platform_data 
*data,
 
if (of_property_read_u32(node, active_slave, prop)) {
pr_err(Missing active_slave property in the DT.\n);
-   ret = -EINVAL;
-   goto error_ret;
+   return -EINVAL;
}
data-active_slave = prop;
 
if (of_property_read_u32(node, cpts_clock_mult, prop)) {
pr_err(Missing cpts_clock_mult property in the DT.\n);
-   ret = -EINVAL;
-   goto error_ret;
+   return -EINVAL;
}
data-cpts_clock_mult = prop;
 
if (of_property_read_u32(node, cpts_clock_shift, prop)) {
pr_err(Missing cpts_clock_shift property in the DT.\n);
-   ret = -EINVAL;
-   goto error_ret;
+   return -EINVAL;
}
data-cpts_clock_shift = prop;
 
-   data-slave_data = kcalloc(data-slaves, sizeof(struct cpsw_slave_data),
-  GFP_KERNEL);
+   data-slave_data = devm_kzalloc(pdev-dev, data-slaves
+   * sizeof(struct cpsw_slave_data),
+   GFP_KERNEL);
if (!data-slave_data)
-   return -EINVAL;
+   return -ENOMEM;
 
if (of_property_read_u32(node, cpdma_channels, prop)) {
pr_err(Missing cpdma_channels property in the DT.\n);
-   ret = -EINVAL;
-   goto error_ret;
+   return -EINVAL;
}
data-channels = prop;
 
if (of_property_read_u32(node, ale_entries, prop)) {
pr_err(Missing ale_entries property in the DT.\n);
-   ret = -EINVAL;
-   goto error_ret;
+   return -EINVAL;
}
data-ale_entries = prop;
 
if (of_property_read_u32(node, bd_ram_size, prop)) {
pr_err(Missing bd_ram_size property in the DT.\n);
-   ret = -EINVAL;
-   goto error_ret;
+   return -EINVAL;
}
data-bd_ram_size = prop;
 
if (of_property_read_u32(node, rx_descs, prop)) {
pr_err(Missing rx_descs property in the DT.\n);
-   ret = -EINVAL;
-   goto error_ret;
+   return -EINVAL;
}
data-rx_descs = prop;
 
if (of_property_read_u32(node, mac_control, prop)) {
pr_err(Missing mac_control property in the DT.\n);
-   ret = -EINVAL;
-   goto error_ret;
+   return -EINVAL;
}
data-mac_control = prop;
 
@@ -1794,8 +1785,7 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data,
parp = of_get_property(slave_node, phy_id, lenp);
if ((parp == NULL) || (lenp != (sizeof(void *) * 2))) {
pr_err(Missing slave[%d] phy_id property\n, i);
-   ret = -EINVAL;
-   goto error_ret;
+   return -EINVAL;
}
mdio_node = of_find_node_by_phandle(be32_to_cpup(parp));
phyid = be32_to_cpup(parp+1);
@@ -1825,10 +1815,6 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data,
}
 
return 0;
-
-error_ret:
-   kfree(data-slave_data);
-   return ret;
 }
 
 static int cpsw_probe_dual_emac(struct platform_device *pdev,
@@ -1870,7 +1856,6 @@ static int cpsw_probe_dual_emac(struct platform_device 
*pdev,
priv_sl2-coal_intvl = 0;
priv_sl2-bus_freq_mhz = priv-bus_freq_mhz;
 
-   priv_sl2-cpsw_res = priv-cpsw_res;
priv_sl2-regs = priv-regs;
priv_sl2-host_port = priv-host_port;
priv_sl2-host_port_regs = priv-host_port_regs;
@@ -1914,8 +1899,8 @@ static int cpsw_probe(struct platform_device *pdev)
struct 

Re: Build error in torvalds kernel 3.11 for omap2plus

2013-09-08 Thread Guenter Roeck

On 09/08/2013 02:02 AM, Russell King - ARM Linux wrote:

On Sun, Sep 08, 2013 at 11:34:10AM +0530, Anil Kumar wrote:

scripts/kconfig/conf --silentoldconfig Kconfig
   CHK include/generated/uapi/linux/version.h
   CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
   CALLscripts/checksyscalls.sh
   CHK include/generated/compile.h
   AS  arch/arm/mm/cache-v7.o
arch/arm/mm/cache-v7.S: Assembler messages:
arch/arm/mm/cache-v7.S:285: Error: garbage following instruction -- `dsb ishst'
arch/arm/mm/cache-v7.S:297: Error: garbage following instruction -- `dsb ishst'
make[1]: *** [arch/arm/mm/cache-v7.o] Error 1
make: *** [arch/arm/mm] Error 2


You need a later binutils for these instructions - 2.22 works just fine,
even with gcc 4.5.x.


Since we are at it:

Build reference: v3.11-7887-gb409624

Building arm:defconfig ... passed
Building arm:allmodconfig ... failed
--
Error log:
arch/arm/mach-cns3xxx/pcie.c: In function 'cns3xxx_pcie_hw_init':
arch/arm/mach-cns3xxx/pcie.c:350:1: warning: the frame size of 1064 bytes is 
larger than 1024 bytes [-Wframe-larger-than=]
arch/arm/kernel/return_address.c:63:2: warning: #warning TODO: return_address 
should use unwind tables [-Wcpp]
arch/arm/kernel/return_address.c:63:2: warning: #warning TODO: return_address 
should use unwind tables [-Wcpp]
/tmp/cce439dZ.s: Assembler messages:
/tmp/cce439dZ.s:506: Error: selected processor does not support ARM mode `isb '
/tmp/cce439dZ.s:512: Error: selected processor does not support ARM mode `isb '
/tmp/cce439dZ.s:513: Error: selected processor does not support ARM mode `dsb '
/tmp/cce439dZ.s:583: Error: selected processor does not support ARM mode `isb '
/tmp/cce439dZ.s:589: Error: selected processor does not support ARM mode `isb '
/tmp/cce439dZ.s:590: Error: selected processor does not support ARM mode `dsb '
make[1]: *** [arch/arm/mach-vexpress/dcscb.o] Error 1
make: *** [arch/arm/mach-vexpress] Error 2
make: *** Waiting for unfinished jobs
--

Any solution for this one ? omap2plus passes for me.

gcc version used is arm-poky-linux-gnueabi-gcc (GCC) 4.7.2 from poky 1.3.

Thanks,
Guenter

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC PATCH 4/4] ARM: dts: am33xx: adopt to cpsw-phy-sel driver to configure phy mode

2013-09-08 Thread Sergei Shtylyov

Hello.

On 09/08/2013 03:23 PM, Mugunthan V N wrote:


Add DT entries for the phy mode selection in AM33xx SoC using cpsw-phy-sel
driver.



Signed-off-by: Mugunthan V N mugunthan...@ti.com
---
  arch/arm/boot/dts/am33xx.dtsi | 6 ++
  1 file changed, 6 insertions(+)



diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index f9c5da9..4359672 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -594,6 +594,12 @@
/* Filled in by U-Boot */
mac-address = [ 00 00 00 00 00 00 ];
};
+
+   phy_sel: cpsw_phy_sel@44e10650 {


   Dashes are preferred to uderscores in the device tree names.


+   compatible = ti,am3352-cpsw-phy-sel;
+   reg= 0x44e10650 0x4;
+   reg-names = gmii-sel;
+   };


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Клиентские базы тeл +79IЗ79З63Ч2

2013-09-08 Thread linux-omap
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html