* [RESEND PATCH v5 7/7] usb: chipidea: imx: add internal vbus regulator control
From: Peter Chen @ 2013-01-21 1:56 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1358733418-17969-1-git-send-email-peter.chen@freescale.com>
- For host, the vbus should always be on.
- For otg, the vbus is off defaultly, the vbus needs to be
turned on/off when usb role switches.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
---
drivers/usb/chipidea/ci.h | 2 +
drivers/usb/chipidea/ci13xxx_imx.c | 80 ++++++++++++++++++++++++++++--------
2 files changed, 64 insertions(+), 18 deletions(-)
diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h
index 00939e6..342b430 100644
--- a/drivers/usb/chipidea/ci.h
+++ b/drivers/usb/chipidea/ci.h
@@ -135,6 +135,7 @@ struct hw_bank {
* @hcd: pointer to usb_hcd for ehci host driver
* @otg: for otg support
* @events: events for otg, and handled at ci_role_work
+ * @reg_vbus: used to control internal vbus regulator
*/
struct ci13xxx {
struct device *dev;
@@ -174,6 +175,7 @@ struct ci13xxx {
struct usb_otg otg;
bool id_event;
bool b_sess_valid_event;
+ struct regulator *reg_vbus;
};
static inline struct ci_role_driver *ci_role(struct ci13xxx *ci)
diff --git a/drivers/usb/chipidea/ci13xxx_imx.c b/drivers/usb/chipidea/ci13xxx_imx.c
index 3b91ff4..4c9df98 100644
--- a/drivers/usb/chipidea/ci13xxx_imx.c
+++ b/drivers/usb/chipidea/ci13xxx_imx.c
@@ -88,14 +88,47 @@ EXPORT_SYMBOL_GPL(usbmisc_get_init_data);
static struct ci13xxx_platform_data ci13xxx_imx_platdata = {
.name = "ci13xxx_imx",
.flags = CI13XXX_REQUIRE_TRANSCEIVER |
- CI13XXX_DISABLE_STREAMING,
+ CI13XXX_DISABLE_STREAMING |
+ CI13XXX_REGS_SHARED,
.capoffset = DEF_CAPOFFSET,
};
+static int ci13xxx_otg_set_vbus(struct usb_otg *otg, bool enabled)
+{
+ struct ci13xxx *ci = container_of(otg, struct ci13xxx, otg);
+ struct regulator *reg_vbus = ci->reg_vbus;
+ int ret;
+
+ WARN_ON(!reg_vbus);
+
+ if (reg_vbus) {
+ if (enabled) {
+ ret = regulator_enable(reg_vbus);
+ if (ret) {
+ dev_err(ci->dev,
+ "Failed to enable vbus regulator, ret=%d\n",
+ ret);
+ return ret;
+ }
+ } else {
+ ret = regulator_disable(reg_vbus);
+ if (ret) {
+ dev_err(ci->dev,
+ "Failed to disable vbus regulator, ret=%d\n",
+ ret);
+ return ret;
+ }
+ }
+ }
+
+ return 0;
+}
+
static int ci13xxx_imx_probe(struct platform_device *pdev)
{
struct ci13xxx_imx_data *data;
struct platform_device *plat_ci, *phy_pdev;
+ struct ci13xxx *ci;
struct device_node *phy_np;
struct resource *res;
struct regulator *reg_vbus;
@@ -152,20 +185,11 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
}
}
- /* we only support host now, so enable vbus here */
reg_vbus = devm_regulator_get(&pdev->dev, "vbus");
- if (!IS_ERR(reg_vbus)) {
- ret = regulator_enable(reg_vbus);
- if (ret) {
- dev_err(&pdev->dev,
- "Failed to enable vbus regulator, err=%d\n",
- ret);
- goto put_np;
- }
+ if (!IS_ERR(reg_vbus))
data->reg_vbus = reg_vbus;
- } else {
+ else
reg_vbus = NULL;
- }
ci13xxx_imx_platdata.phy = data->phy;
@@ -175,7 +199,7 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
if (!pdev->dev.dma_mask) {
ret = -ENOMEM;
dev_err(&pdev->dev, "Failed to alloc dma_mask!\n");
- goto err;
+ goto put_np;
}
*pdev->dev.dma_mask = DMA_BIT_MASK(32);
dma_set_coherent_mask(&pdev->dev, *pdev->dev.dma_mask);
@@ -186,7 +210,7 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
if (ret) {
dev_err(&pdev->dev,
"usbmisc init failed, ret=%d\n", ret);
- goto err;
+ goto put_np;
}
}
@@ -198,24 +222,44 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
dev_err(&pdev->dev,
"Can't register ci_hdrc platform device, err=%d\n",
ret);
- goto err;
+ goto put_np;
}
data->ci_pdev = plat_ci;
platform_set_drvdata(pdev, data);
+ ci = platform_get_drvdata(plat_ci);
+ /*
+ * Internal vbus on/off policy
+ * - Always on for host only function
+ * - Always off for gadget only function
+ * - call otg.set_vbus to control on/off according usb role
+ */
+
+ if (ci->roles[CI_ROLE_HOST] && !ci->roles[CI_ROLE_GADGET]
+ && reg_vbus) {
+ ret = regulator_enable(reg_vbus);
+ if (ret) {
+ dev_err(&pdev->dev,
+ "Failed to enable vbus regulator, ret=%d\n",
+ ret);
+ goto put_np;
+ }
+ } else if (ci->is_otg) {
+ ci->otg.set_vbus = ci13xxx_otg_set_vbus;
+ ci->reg_vbus = data->reg_vbus;
+ }
+
pm_runtime_no_callbacks(&pdev->dev);
pm_runtime_enable(&pdev->dev);
return 0;
-err:
- if (reg_vbus)
- regulator_disable(reg_vbus);
put_np:
if (phy_np)
of_node_put(phy_np);
clk_disable_unprepare(data->clk);
+
return ret;
}
--
1.7.0.4
^ permalink raw reply related
* [RESEND PATCH v5 6/7] usb: chipidea: udc: retire the flag CI13_PULLUP_ON_VBUS
From: Peter Chen @ 2013-01-21 1:56 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1358733418-17969-1-git-send-email-peter.chen@freescale.com>
(change CI13XXX to CI13 to avoid junk email check)
Now, we have handled vbus session in core driver when the
vbus interrupt occurs, so our pullup operations are all
according to vbus.
Of cource, the software can still call .pullup when device connects
to host if it wants to connect/disconnect with host.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
---
drivers/usb/chipidea/ci13xxx_imx.c | 1 -
drivers/usb/chipidea/ci13xxx_msm.c | 1 -
drivers/usb/chipidea/udc.c | 23 ++++++++---------------
include/linux/usb/chipidea.h | 1 -
4 files changed, 8 insertions(+), 18 deletions(-)
diff --git a/drivers/usb/chipidea/ci13xxx_imx.c b/drivers/usb/chipidea/ci13xxx_imx.c
index 8c29122..3b91ff4 100644
--- a/drivers/usb/chipidea/ci13xxx_imx.c
+++ b/drivers/usb/chipidea/ci13xxx_imx.c
@@ -88,7 +88,6 @@ EXPORT_SYMBOL_GPL(usbmisc_get_init_data);
static struct ci13xxx_platform_data ci13xxx_imx_platdata = {
.name = "ci13xxx_imx",
.flags = CI13XXX_REQUIRE_TRANSCEIVER |
- CI13XXX_PULLUP_ON_VBUS |
CI13XXX_DISABLE_STREAMING,
.capoffset = DEF_CAPOFFSET,
};
diff --git a/drivers/usb/chipidea/ci13xxx_msm.c b/drivers/usb/chipidea/ci13xxx_msm.c
index 7d16681..5755ee8 100644
--- a/drivers/usb/chipidea/ci13xxx_msm.c
+++ b/drivers/usb/chipidea/ci13xxx_msm.c
@@ -49,7 +49,6 @@ static struct ci13xxx_platform_data ci13xxx_msm_platdata = {
.name = "ci13xxx_msm",
.flags = CI13XXX_REGS_SHARED |
CI13XXX_REQUIRE_TRANSCEIVER |
- CI13XXX_PULLUP_ON_VBUS |
CI13XXX_DISABLE_STREAMING,
.notify_event = ci13xxx_msm_notify_event,
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index aab20bb..dcac77c 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -1360,9 +1360,6 @@ static int ci13xxx_vbus_session(struct usb_gadget *_gadget, int is_active)
unsigned long flags;
int gadget_ready = 0;
- if (!(ci->platdata->flags & CI13XXX_PULLUP_ON_VBUS))
- return -EOPNOTSUPP;
-
spin_lock_irqsave(&ci->lock, flags);
ci->vbus_active = is_active;
if (ci->driver)
@@ -1426,8 +1423,7 @@ static int ci13xxx_pullup(struct usb_gadget *_gadget, int is_on)
{
struct ci13xxx *ci = container_of(_gadget, struct ci13xxx, gadget);
- if ((ci->platdata->flags & CI13XXX_PULLUP_ON_VBUS) &&
- !ci->vbus_active)
+ if (!ci->vbus_active)
return -ENOTSUPP;
if (is_on)
@@ -1551,14 +1547,12 @@ static int ci13xxx_start(struct usb_gadget *gadget,
ci->driver = driver;
pm_runtime_get_sync(&ci->gadget.dev);
- if (ci->platdata->flags & CI13XXX_PULLUP_ON_VBUS) {
- if (ci->vbus_active) {
- if (ci->platdata->flags & CI13XXX_REGS_SHARED)
- hw_device_reset(ci, USBMODE_CM_DC);
- } else {
- pm_runtime_put_sync(&ci->gadget.dev);
- goto done;
- }
+ if (ci->vbus_active) {
+ if (ci->platdata->flags & CI13XXX_REGS_SHARED)
+ hw_device_reset(ci, USBMODE_CM_DC);
+ } else {
+ pm_runtime_put_sync(&ci->gadget.dev);
+ goto done;
}
retval = hw_device_state(ci, ci->ep0out->qh.dma);
@@ -1581,8 +1575,7 @@ static int ci13xxx_stop(struct usb_gadget *gadget,
spin_lock_irqsave(&ci->lock, flags);
- if (!(ci->platdata->flags & CI13XXX_PULLUP_ON_VBUS) ||
- ci->vbus_active) {
+ if (ci->vbus_active) {
hw_device_state(ci, 0);
if (ci->platdata->notify_event)
ci->platdata->notify_event(ci,
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h
index 544825d..37821b3 100644
--- a/include/linux/usb/chipidea.h
+++ b/include/linux/usb/chipidea.h
@@ -17,7 +17,6 @@ struct ci13xxx_platform_data {
unsigned long flags;
#define CI13XXX_REGS_SHARED BIT(0)
#define CI13XXX_REQUIRE_TRANSCEIVER BIT(1)
-#define CI13XXX_PULLUP_ON_VBUS BIT(2)
#define CI13XXX_DISABLE_STREAMING BIT(3)
#define CI13XXX_CONTROLLER_RESET_EVENT 0
--
1.7.0.4
^ permalink raw reply related
* [RESEND PATCH v5 5/7] usb: chipidea: udc: add pullup/pulldown dp at hw_device_state
From: Peter Chen @ 2013-01-21 1:56 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1358733418-17969-1-git-send-email-peter.chen@freescale.com>
- During the connect/disconnect host, we need to pullup
and pulldown dp
- Make sure the dp is not pullup until the vbus is on when
flag CI13XXX_PULLUP_ON_VBUS is set
- Using hw_device_state when set run/stop bit
Signed-off-by: Peter Chen <peter.chen@freescale.com>
---
drivers/usb/chipidea/udc.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index e6a4ec0..aab20bb 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -91,8 +91,10 @@ static int hw_device_state(struct ci13xxx *ci, u32 dma)
/* interrupt, error, port change, reset, sleep/suspend */
hw_write(ci, OP_USBINTR, ~0,
USBi_UI|USBi_UEI|USBi_PCI|USBi_URI|USBi_SLI);
+ hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS);
} else {
hw_write(ci, OP_USBINTR, ~0, 0);
+ hw_write(ci, OP_USBCMD, USBCMD_RS, 0);
}
return 0;
}
@@ -1424,10 +1426,14 @@ static int ci13xxx_pullup(struct usb_gadget *_gadget, int is_on)
{
struct ci13xxx *ci = container_of(_gadget, struct ci13xxx, gadget);
+ if ((ci->platdata->flags & CI13XXX_PULLUP_ON_VBUS) &&
+ !ci->vbus_active)
+ return -ENOTSUPP;
+
if (is_on)
- hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS);
+ hw_device_state(ci, ci->ep0out->qh.dma);
else
- hw_write(ci, OP_USBCMD, USBCMD_RS, 0);
+ hw_device_state(ci, 0);
return 0;
}
--
1.7.0.4
^ permalink raw reply related
* [RESEND PATCH v5 4/7] usb: chipidea: consolidate ci_role_driver's API for both roles
From: Peter Chen @ 2013-01-21 1:56 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1358733418-17969-1-git-send-email-peter.chen@freescale.com>
- Create init/destroy API for probe and remove
- start/stop API are only used otg id switch process
- Create the gadget at ci_hdrc_probe if the gadget is supported
at that port, the main purpose for this is to avoid gadget module
load fail at init.rc
Signed-off-by: Peter Chen <peter.chen@freescale.com>
---
drivers/usb/chipidea/ci.h | 19 +++++++++++-
drivers/usb/chipidea/core.c | 65 ++++++++++++++++++------------------------
drivers/usb/chipidea/host.c | 2 +
drivers/usb/chipidea/udc.c | 33 ++++++++++++++++++++-
4 files changed, 78 insertions(+), 41 deletions(-)
diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h
index 325d790..00939e6 100644
--- a/drivers/usb/chipidea/ci.h
+++ b/drivers/usb/chipidea/ci.h
@@ -67,14 +67,18 @@ enum ci_role {
/**
* struct ci_role_driver - host/gadget role driver
- * start: start this role
- * stop: stop this role
+ * init: init this role (used at module probe)
+ * start: start this role (used at id switch)
+ * stop: stop this role (used at id switch)
+ * destroy: destroy this role (used at module remove)
* irq: irq handler for this role
* name: role name string (host/gadget)
*/
struct ci_role_driver {
+ int (*init)(struct ci13xxx *);
int (*start)(struct ci13xxx *);
void (*stop)(struct ci13xxx *);
+ void (*destroy)(struct ci13xxx *);
irqreturn_t (*irq)(struct ci13xxx *);
const char *name;
};
@@ -206,6 +210,17 @@ static inline void ci_role_stop(struct ci13xxx *ci)
ci->roles[role]->stop(ci);
}
+static inline void ci_role_destroy(struct ci13xxx *ci)
+{
+ enum ci_role role = ci->role;
+
+ if (role == CI_ROLE_END)
+ return;
+
+ ci->role = CI_ROLE_END;
+
+ ci->roles[role]->destroy(ci);
+}
/******************************************************************************
* REGISTERS
*****************************************************************************/
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index f8f8484..a5adf1a 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -315,27 +315,16 @@ static void ci_handle_id_switch(struct ci13xxx *ci)
ci_role(ci)->name, ci->roles[role]->name);
/* 1. Finish the current role */
- if (ci->role == CI_ROLE_GADGET) {
- usb_gadget_vbus_disconnect(&ci->gadget);
- /* host doesn't care B_SESSION_VALID event */
- ci_clear_otg_interrupt(ci, OTGSC_BSVIS);
- ci_disable_otg_interrupt(ci, OTGSC_BSVIE);
- ci->role = CI_ROLE_END;
- /* reset controller */
- hw_device_reset(ci, USBMODE_CM_IDLE);
- } else if (ci->role == CI_ROLE_HOST) {
- ci_role_stop(ci);
- /* reset controller */
- hw_device_reset(ci, USBMODE_CM_IDLE);
- }
+ ci_role_stop(ci);
+ hw_device_reset(ci, USBMODE_CM_IDLE);
/* 2. Turn on/off vbus according to coming role */
- if (ci_otg_role(ci) == CI_ROLE_GADGET) {
+ if (role == CI_ROLE_GADGET) {
otg_set_vbus(&ci->otg, false);
/* wait vbus lower than OTGSC_BSV */
hw_wait_reg(ci, OP_OTGSC, OTGSC_BSV, 0,
CI_VBUS_STABLE_TIMEOUT);
- } else if (ci_otg_role(ci) == CI_ROLE_HOST) {
+ } else if (role == CI_ROLE_HOST) {
otg_set_vbus(&ci->otg, true);
/* wait vbus higher than OTGSC_AVV */
hw_wait_reg(ci, OP_OTGSC, OTGSC_AVV, OTGSC_AVV,
@@ -343,13 +332,7 @@ static void ci_handle_id_switch(struct ci13xxx *ci)
}
/* 3. Begin the new role */
- if (ci_otg_role(ci) == CI_ROLE_GADGET) {
- ci->role = role;
- ci_clear_otg_interrupt(ci, OTGSC_BSVIS);
- ci_enable_otg_interrupt(ci, OTGSC_BSVIE);
- } else if (ci_otg_role(ci) == CI_ROLE_HOST) {
- ci_role_start(ci, role);
- }
+ ci_role_start(ci, role);
}
}
@@ -585,7 +568,7 @@ static int ci_hdrc_probe(struct platform_device *pdev)
ret = ci_hdrc_gadget_init(ci);
if (ret)
- dev_info(dev, "doesn't support gadget\n");
+ dev_info(dev, "doesn't support gadget, ret=%d\n", ret);
if (!ci->roles[CI_ROLE_HOST] && !ci->roles[CI_ROLE_GADGET]) {
dev_err(dev, "no supported roles\n");
@@ -607,22 +590,30 @@ static int ci_hdrc_probe(struct platform_device *pdev)
: CI_ROLE_GADGET;
}
- ret = ci_role_start(ci, ci->role);
- if (ret) {
- dev_err(dev, "can't start %s role\n", ci_role(ci)->name);
- ret = -ENODEV;
- goto rm_wq;
- }
-
otgsc = hw_read(ci, OP_OTGSC, ~0);
+
/*
- * if it is device mode:
- * - Enable vbus detect
- * - If it has already connected to host, notify udc
+ * If the gadget is supported, call its init unconditionally,
+ * We need to support load gadget module at init.rc.
*/
- if (ci->role == CI_ROLE_GADGET) {
- ci_enable_otg_interrupt(ci, OTGSC_BSVIE);
- ci_handle_vbus_change(ci);
+ if (ci->roles[CI_ROLE_GADGET]) {
+ ret = ci->roles[CI_ROLE_GADGET]->init(ci);
+ if (ret) {
+ dev_err(dev, "can't init %s role, ret=%d\n",
+ ci_role(ci)->name, ret);
+ ret = -ENODEV;
+ goto rm_wq;
+ }
+ }
+
+ if (ci->role == CI_ROLE_HOST) {
+ ret = ci->roles[CI_ROLE_HOST]->init(ci);
+ if (ret) {
+ dev_err(dev, "can't init %s role, ret=%d\n",
+ ci_role(ci)->name, ret);
+ ret = -ENODEV;
+ goto rm_wq;
+ }
}
platform_set_drvdata(pdev, ci);
@@ -660,7 +651,7 @@ static int ci_hdrc_remove(struct platform_device *pdev)
destroy_workqueue(ci->wq);
device_remove_file(ci->dev, &dev_attr_role);
free_irq(ci->irq, ci);
- ci_role_stop(ci);
+ ci_role_destroy(ci);
return 0;
}
diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c
index caecad9..6024a4f 100644
--- a/drivers/usb/chipidea/host.c
+++ b/drivers/usb/chipidea/host.c
@@ -92,8 +92,10 @@ int ci_hdrc_host_init(struct ci13xxx *ci)
if (!rdrv)
return -ENOMEM;
+ rdrv->init = host_start;
rdrv->start = host_start;
rdrv->stop = host_stop;
+ rdrv->destroy = host_stop;
rdrv->irq = host_irq;
rdrv->name = "host";
ci->roles[CI_ROLE_HOST] = rdrv;
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index 83e54bb..e6a4ec0 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -31,6 +31,7 @@
#include "ci.h"
#include "udc.h"
+#include "otg.h"
#include "bits.h"
#include "debug.h"
@@ -1754,6 +1755,16 @@ static int udc_start(struct ci13xxx *ci)
pm_runtime_no_callbacks(&ci->gadget.dev);
pm_runtime_enable(&ci->gadget.dev);
+ /*
+ * if it is device mode:
+ * - Enable vbus detect
+ * - If it has already connected to host, notify udc
+ */
+ if (ci->role == CI_ROLE_GADGET) {
+ ci_enable_otg_interrupt(ci, OTGSC_BSVIE);
+ ci_handle_vbus_change(ci);
+ }
+
return retval;
remove_trans:
@@ -1780,6 +1791,22 @@ free_qh_pool:
return retval;
}
+static int udc_id_switch_for_device(struct ci13xxx *ci)
+{
+ ci_clear_otg_interrupt(ci, OTGSC_BSVIS);
+ ci_enable_otg_interrupt(ci, OTGSC_BSVIE);
+
+ return 0;
+}
+
+static void udc_id_switch_for_host(struct ci13xxx *ci)
+{
+ usb_gadget_vbus_disconnect(&ci->gadget);
+ /* host doesn't care B_SESSION_VALID event */
+ ci_clear_otg_interrupt(ci, OTGSC_BSVIS);
+ ci_disable_otg_interrupt(ci, OTGSC_BSVIE);
+}
+
/**
* udc_remove: parent remove must call this to remove UDC
*
@@ -1825,8 +1852,10 @@ int ci_hdrc_gadget_init(struct ci13xxx *ci)
if (!rdrv)
return -ENOMEM;
- rdrv->start = udc_start;
- rdrv->stop = udc_stop;
+ rdrv->init = udc_start;
+ rdrv->start = udc_id_switch_for_device;
+ rdrv->stop = udc_id_switch_for_host;
+ rdrv->destroy = udc_stop;
rdrv->irq = udc_irq;
rdrv->name = "gadget";
ci->roles[CI_ROLE_GADGET] = rdrv;
--
1.7.0.4
^ permalink raw reply related
* [RESEND PATCH v5 3/7] usb: chipidea: add otg id switch and vbus connect/disconnect detect
From: Peter Chen @ 2013-01-21 1:56 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1358733418-17969-1-git-send-email-peter.chen@freescale.com>
The main design flow is the same with msm otg driver, that is the id and
vbus interrupt are handled at core driver, others are handled by
individual drivers.
- At former design, when switch usb role from device->host, it will call
udc_stop, it will remove the gadget driver, so when switch role
from host->device, it can't add gadget driver any more.
At new design, when role switch occurs, the gadget just calls
usb_gadget_vbus_disconnect/usb_gadget_vbus_connect as well as
reset controller, it will not free any device/gadget structure
- Add vbus connect and disconnect to core interrupt handler, it can
notify udc driver by calling usb_gadget_vbus_disconnect
/usb_gadget_vbus_connect.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
---
drivers/usb/chipidea/bits.h | 10 +++
drivers/usb/chipidea/ci.h | 8 ++-
drivers/usb/chipidea/core.c | 177 ++++++++++++++++++++++++++++++++++++++----
drivers/usb/chipidea/otg.c | 28 +++++---
drivers/usb/chipidea/otg.h | 3 +
drivers/usb/chipidea/udc.c | 2 +
6 files changed, 200 insertions(+), 28 deletions(-)
diff --git a/drivers/usb/chipidea/bits.h b/drivers/usb/chipidea/bits.h
index 050de85..ba9c6ef 100644
--- a/drivers/usb/chipidea/bits.h
+++ b/drivers/usb/chipidea/bits.h
@@ -65,11 +65,21 @@
#define OTGSC_ASVIS BIT(18)
#define OTGSC_BSVIS BIT(19)
#define OTGSC_BSEIS BIT(20)
+#define OTGSC_1MSIS BIT(21)
+#define OTGSC_DPIS BIT(22)
#define OTGSC_IDIE BIT(24)
#define OTGSC_AVVIE BIT(25)
#define OTGSC_ASVIE BIT(26)
#define OTGSC_BSVIE BIT(27)
#define OTGSC_BSEIE BIT(28)
+#define OTGSC_1MSIE BIT(29)
+#define OTGSC_DPIE BIT(30)
+#define OTGSC_INT_EN_BITS (OTGSC_IDIE | OTGSC_AVVIE | OTGSC_ASVIE \
+ | OTGSC_BSVIE | OTGSC_BSEIE | OTGSC_1MSIE \
+ | OTGSC_DPIE)
+#define OTGSC_INT_STATUS_BITS (OTGSC_IDIS | OTGSC_AVVIS | OTGSC_ASVIS \
+ | OTGSC_BSVIS | OTGSC_BSEIS | OTGSC_1MSIS \
+ | OTGSC_DPIS)
/* USBMODE */
#define USBMODE_CM (0x03UL << 0)
diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h
index 8702871..325d790 100644
--- a/drivers/usb/chipidea/ci.h
+++ b/drivers/usb/chipidea/ci.h
@@ -130,6 +130,7 @@ struct hw_bank {
* @transceiver: pointer to USB PHY, if any
* @hcd: pointer to usb_hcd for ehci host driver
* @otg: for otg support
+ * @events: events for otg, and handled@ci_role_work
*/
struct ci13xxx {
struct device *dev;
@@ -140,6 +141,7 @@ struct ci13xxx {
enum ci_role role;
bool is_otg;
struct work_struct work;
+ struct delayed_work dwork;
struct workqueue_struct *wq;
struct dma_pool *qh_pool;
@@ -165,7 +167,9 @@ struct ci13xxx {
bool global_phy;
struct usb_phy *transceiver;
struct usb_hcd *hcd;
- struct usb_otg otg;
+ struct usb_otg otg;
+ bool id_event;
+ bool b_sess_valid_event;
};
static inline struct ci_role_driver *ci_role(struct ci13xxx *ci)
@@ -314,4 +318,6 @@ int hw_port_test_set(struct ci13xxx *ci, u8 mode);
u8 hw_port_test_get(struct ci13xxx *ci);
+void ci_handle_vbus_change(struct ci13xxx *ci);
+
#endif /* __DRIVERS_USB_CHIPIDEA_CI_H */
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index aebf695..f8f8484 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -73,6 +73,7 @@
#include "bits.h"
#include "host.h"
#include "debug.h"
+#include "otg.h"
/* Controller register map */
static uintptr_t ci_regs_nolpm[] = {
@@ -199,6 +200,14 @@ static int hw_device_init(struct ci13xxx *ci, void __iomem *base)
if (ci->hw_ep_max > ENDPT_MAX)
return -ENODEV;
+ /* Disable all interrupts bits */
+ hw_write(ci, OP_USBINTR, 0xffffffff, 0);
+ ci_disable_otg_interrupt(ci, OTGSC_INT_EN_BITS);
+
+ /* Clear all interrupts status bits*/
+ hw_write(ci, OP_USBSTS, 0xffffffff, 0xffffffff);
+ ci_clear_otg_interrupt(ci, OTGSC_INT_STATUS_BITS);
+
dev_dbg(ci->dev, "ChipIdea HDRC found, lpm: %d; cap: %p op: %p\n",
ci->hw_bank.lpm, ci->hw_bank.cap, ci->hw_bank.op);
@@ -265,24 +274,124 @@ static enum ci_role ci_otg_role(struct ci13xxx *ci)
}
/**
- * ci_role_work - perform role changing based on ID pin
- * @work: work struct
+ * hw_wait_reg: wait the register value
+ *
+ * Sometimes, it needs to wait register value before going on.
+ * Eg, when switch to device mode, the vbus value should be lower
+ * than OTGSC_BSV before connects to host.
+ *
+ * @ci: the controller
+ * @reg: register index
+ * @mask: mast bit
+ * @value: the bit value to wait
+ * @timeout: timeout to indicate an error
+ *
+ * This function returns an error code if timeout
*/
-static void ci_role_work(struct work_struct *work)
+static int hw_wait_reg(struct ci13xxx *ci, enum ci13xxx_regs reg, u32 mask,
+ u32 value, unsigned long timeout)
+{
+ unsigned long elapse = jiffies + timeout;
+
+ while (hw_read(ci, reg, mask) != value) {
+ if (time_after(jiffies, elapse)) {
+ dev_err(ci->dev, "timeout waiting for %08x in %d\n",
+ mask, reg);
+ return -ETIMEDOUT;
+ }
+ msleep(20);
+ }
+
+ return 0;
+}
+
+#define CI_VBUS_STABLE_TIMEOUT 500
+static void ci_handle_id_switch(struct ci13xxx *ci)
{
- struct ci13xxx *ci = container_of(work, struct ci13xxx, work);
enum ci_role role = ci_otg_role(ci);
if (role != ci->role) {
dev_dbg(ci->dev, "switching from %s to %s\n",
ci_role(ci)->name, ci->roles[role]->name);
- ci_role_stop(ci);
- ci_role_start(ci, role);
- enable_irq(ci->irq);
+ /* 1. Finish the current role */
+ if (ci->role == CI_ROLE_GADGET) {
+ usb_gadget_vbus_disconnect(&ci->gadget);
+ /* host doesn't care B_SESSION_VALID event */
+ ci_clear_otg_interrupt(ci, OTGSC_BSVIS);
+ ci_disable_otg_interrupt(ci, OTGSC_BSVIE);
+ ci->role = CI_ROLE_END;
+ /* reset controller */
+ hw_device_reset(ci, USBMODE_CM_IDLE);
+ } else if (ci->role == CI_ROLE_HOST) {
+ ci_role_stop(ci);
+ /* reset controller */
+ hw_device_reset(ci, USBMODE_CM_IDLE);
+ }
+
+ /* 2. Turn on/off vbus according to coming role */
+ if (ci_otg_role(ci) == CI_ROLE_GADGET) {
+ otg_set_vbus(&ci->otg, false);
+ /* wait vbus lower than OTGSC_BSV */
+ hw_wait_reg(ci, OP_OTGSC, OTGSC_BSV, 0,
+ CI_VBUS_STABLE_TIMEOUT);
+ } else if (ci_otg_role(ci) == CI_ROLE_HOST) {
+ otg_set_vbus(&ci->otg, true);
+ /* wait vbus higher than OTGSC_AVV */
+ hw_wait_reg(ci, OP_OTGSC, OTGSC_AVV, OTGSC_AVV,
+ CI_VBUS_STABLE_TIMEOUT);
+ }
+
+ /* 3. Begin the new role */
+ if (ci_otg_role(ci) == CI_ROLE_GADGET) {
+ ci->role = role;
+ ci_clear_otg_interrupt(ci, OTGSC_BSVIS);
+ ci_enable_otg_interrupt(ci, OTGSC_BSVIE);
+ } else if (ci_otg_role(ci) == CI_ROLE_HOST) {
+ ci_role_start(ci, role);
+ }
}
}
+void ci_handle_vbus_change(struct ci13xxx *ci)
+{
+ u32 otgsc = hw_read(ci, OP_OTGSC, ~0);
+
+ if (otgsc & OTGSC_BSV)
+ usb_gadget_vbus_connect(&ci->gadget);
+ else
+ usb_gadget_vbus_disconnect(&ci->gadget);
+}
+
+/**
+ * ci_otg_work - perform otg (vbus/id) event handle
+ * @work: work struct
+ */
+static void ci_otg_work(struct work_struct *work)
+{
+ struct ci13xxx *ci = container_of(work, struct ci13xxx, work);
+
+ if (ci->id_event) {
+ ci->id_event = false;
+ ci_handle_id_switch(ci);
+ } else if (ci->b_sess_valid_event) {
+ ci->b_sess_valid_event = false;
+ ci_handle_vbus_change(ci);
+ } else
+ dev_err(ci->dev, "unexpected event occurs at %s\n", __func__);
+
+ enable_irq(ci->irq);
+}
+
+static void ci_delayed_work(struct work_struct *work)
+{
+ struct delayed_work *dwork = to_delayed_work(work);
+ struct ci13xxx *ci = container_of(dwork, struct ci13xxx, dwork);
+
+ otg_set_vbus(&ci->otg, true);
+
+}
+
static ssize_t show_role(struct device *dev, struct device_attribute *attr,
char *buf)
{
@@ -321,19 +430,36 @@ static irqreturn_t ci_irq(int irq, void *data)
irqreturn_t ret = IRQ_NONE;
u32 otgsc = 0;
- if (ci->is_otg)
- otgsc = hw_read(ci, OP_OTGSC, ~0);
+ otgsc = hw_read(ci, OP_OTGSC, ~0);
- if (ci->role != CI_ROLE_END)
- ret = ci_role(ci)->irq(ci);
+ /*
+ * Handle id change interrupt, it indicates device/host function
+ * switch.
+ */
+ if (ci->is_otg && (otgsc & OTGSC_IDIE) && (otgsc & OTGSC_IDIS)) {
+ ci->id_event = true;
+ ci_clear_otg_interrupt(ci, OTGSC_IDIS);
+ disable_irq_nosync(ci->irq);
+ queue_work(ci->wq, &ci->work);
+ return IRQ_HANDLED;
+ }
- if (ci->is_otg && (otgsc & OTGSC_IDIS)) {
- hw_write(ci, OP_OTGSC, OTGSC_IDIS, OTGSC_IDIS);
+ /*
+ * Handle vbus change interrupt, it indicates device connection
+ * and disconnection events.
+ */
+ if ((otgsc & OTGSC_BSVIE) && (otgsc & OTGSC_BSVIS)) {
+ ci->b_sess_valid_event = true;
+ ci_clear_otg_interrupt(ci, OTGSC_BSVIS);
disable_irq_nosync(ci->irq);
queue_work(ci->wq, &ci->work);
- ret = IRQ_HANDLED;
+ return IRQ_HANDLED;
}
+ /* Handle device/host interrupt */
+ if (ci->role != CI_ROLE_END)
+ ret = ci_role(ci)->irq(ci);
+
return ret;
}
@@ -398,6 +524,7 @@ static int ci_hdrc_probe(struct platform_device *pdev)
struct resource *res;
void __iomem *base;
int ret;
+ u32 otgsc;
if (!dev->platform_data) {
dev_err(dev, "platform data missing\n");
@@ -443,7 +570,8 @@ static int ci_hdrc_probe(struct platform_device *pdev)
return -ENODEV;
}
- INIT_WORK(&ci->work, ci_role_work);
+ INIT_WORK(&ci->work, ci_otg_work);
+ INIT_DELAYED_WORK(&ci->dwork, ci_delayed_work);
ci->wq = create_singlethread_workqueue("ci_otg");
if (!ci->wq) {
dev_err(dev, "can't create workqueue\n");
@@ -466,7 +594,10 @@ static int ci_hdrc_probe(struct platform_device *pdev)
}
if (ci->roles[CI_ROLE_HOST] && ci->roles[CI_ROLE_GADGET]) {
+ dev_dbg(dev, "support otg\n");
ci->is_otg = true;
+ /* if otg is supported, create struct usb_otg */
+ ci_hdrc_otg_init(ci);
/* ID pin needs 1ms debouce time, we delay 2ms for safe */
mdelay(2);
ci->role = ci_otg_role(ci);
@@ -483,6 +614,17 @@ static int ci_hdrc_probe(struct platform_device *pdev)
goto rm_wq;
}
+ otgsc = hw_read(ci, OP_OTGSC, ~0);
+ /*
+ * if it is device mode:
+ * - Enable vbus detect
+ * - If it has already connected to host, notify udc
+ */
+ if (ci->role == CI_ROLE_GADGET) {
+ ci_enable_otg_interrupt(ci, OTGSC_BSVIE);
+ ci_handle_vbus_change(ci);
+ }
+
platform_set_drvdata(pdev, ci);
ret = request_irq(ci->irq, ci_irq, IRQF_SHARED, ci->platdata->name,
ci);
@@ -493,8 +635,9 @@ static int ci_hdrc_probe(struct platform_device *pdev)
if (ret)
goto rm_attr;
- if (ci->is_otg)
- hw_write(ci, OP_OTGSC, OTGSC_IDIE, OTGSC_IDIE);
+ /* Handle the situation that usb device at the MicroB to A cable */
+ if (ci->is_otg && !(otgsc & OTGSC_ID))
+ queue_delayed_work(ci->wq, &ci->dwork, msecs_to_jiffies(500));
return ret;
diff --git a/drivers/usb/chipidea/otg.c b/drivers/usb/chipidea/otg.c
index 7dea3b3..2986d91 100644
--- a/drivers/usb/chipidea/otg.c
+++ b/drivers/usb/chipidea/otg.c
@@ -10,21 +10,28 @@
* published by the Free Software Foundation.
*/
-#include <linux/platform_device.h>
-#include <linux/module.h>
-#include <linux/io.h>
-#include <linux/irq.h>
-#include <linux/kernel.h>
-#include <linux/slab.h>
-#include <linux/usb/gadget.h>
#include <linux/usb/otg.h>
+#include <linux/usb/gadget.h>
#include <linux/usb/chipidea.h>
#include "ci.h"
-#include "udc.h"
#include "bits.h"
-#include "host.h"
-#include "debug.h"
+
+void ci_clear_otg_interrupt(struct ci13xxx *ci, u32 bits)
+{
+ /* Only clear request bits */
+ hw_write(ci, OP_OTGSC, OTGSC_INT_STATUS_BITS, bits);
+}
+
+void ci_enable_otg_interrupt(struct ci13xxx *ci, u32 bits)
+{
+ hw_write(ci, OP_OTGSC, bits, bits);
+}
+
+void ci_disable_otg_interrupt(struct ci13xxx *ci, u32 bits)
+{
+ hw_write(ci, OP_OTGSC, bits, 0);
+}
static int ci_otg_set_peripheral(struct usb_otg *otg,
struct usb_gadget *periph)
@@ -55,6 +62,7 @@ int ci_hdrc_otg_init(struct ci13xxx *ci)
ci->otg.set_host = ci_otg_set_host;
if (!IS_ERR_OR_NULL(ci->transceiver))
ci->transceiver->otg = &ci->otg;
+ ci_enable_otg_interrupt(ci, OTGSC_IDIE);
return 0;
}
diff --git a/drivers/usb/chipidea/otg.h b/drivers/usb/chipidea/otg.h
index b4c6b3e..fa30428 100644
--- a/drivers/usb/chipidea/otg.h
+++ b/drivers/usb/chipidea/otg.h
@@ -2,5 +2,8 @@
#define __DRIVERS_USB_CHIPIDEA_OTG_H
int ci_hdrc_otg_init(struct ci13xxx *ci);
+void ci_clear_otg_interrupt(struct ci13xxx *ci, u32 bits);
+void ci_enable_otg_interrupt(struct ci13xxx *ci, u32 bits);
+void ci_disable_otg_interrupt(struct ci13xxx *ci, u32 bits);
#endif /* __DRIVERS_USB_CHIPIDEA_OTG_H */
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index d214448..83e54bb 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -1371,6 +1371,7 @@ static int ci13xxx_vbus_session(struct usb_gadget *_gadget, int is_active)
pm_runtime_get_sync(&_gadget->dev);
hw_device_reset(ci, USBMODE_CM_DC);
hw_device_state(ci, ci->ep0out->qh.dma);
+ dev_dbg(ci->dev, "Connected to host\n");
} else {
hw_device_state(ci, 0);
if (ci->platdata->notify_event)
@@ -1378,6 +1379,7 @@ static int ci13xxx_vbus_session(struct usb_gadget *_gadget, int is_active)
CI13XXX_CONTROLLER_STOPPED_EVENT);
_gadget_stop_activity(&ci->gadget);
pm_runtime_put_sync(&_gadget->dev);
+ dev_dbg(ci->dev, "Disconnected from host\n");
}
}
--
1.7.0.4
^ permalink raw reply related
* [RESEND PATCH v5 2/7] usb: chipidea: add otg file
From: Peter Chen @ 2013-01-21 1:56 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1358733418-17969-1-git-send-email-peter.chen@freescale.com>
Implement struct usb_otg, In that way, calling otg_set_peripheral
will not be failed at udc.c.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
---
drivers/usb/chipidea/Makefile | 2 +-
drivers/usb/chipidea/ci.h | 2 +
drivers/usb/chipidea/otg.c | 60 +++++++++++++++++++++++++++++++++++++++++
drivers/usb/chipidea/otg.h | 6 ++++
4 files changed, 69 insertions(+), 1 deletions(-)
diff --git a/drivers/usb/chipidea/Makefile b/drivers/usb/chipidea/Makefile
index d92ca32..11f513c 100644
--- a/drivers/usb/chipidea/Makefile
+++ b/drivers/usb/chipidea/Makefile
@@ -2,7 +2,7 @@ ccflags-$(CONFIG_USB_CHIPIDEA_DEBUG) := -DDEBUG
obj-$(CONFIG_USB_CHIPIDEA) += ci_hdrc.o
-ci_hdrc-y := core.o
+ci_hdrc-y := core.o otg.o
ci_hdrc-$(CONFIG_USB_CHIPIDEA_UDC) += udc.o
ci_hdrc-$(CONFIG_USB_CHIPIDEA_HOST) += host.o
ci_hdrc-$(CONFIG_USB_CHIPIDEA_DEBUG) += debug.o
diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h
index d738603..8702871 100644
--- a/drivers/usb/chipidea/ci.h
+++ b/drivers/usb/chipidea/ci.h
@@ -129,6 +129,7 @@ struct hw_bank {
* @vbus_active: is VBUS active
* @transceiver: pointer to USB PHY, if any
* @hcd: pointer to usb_hcd for ehci host driver
+ * @otg: for otg support
*/
struct ci13xxx {
struct device *dev;
@@ -164,6 +165,7 @@ struct ci13xxx {
bool global_phy;
struct usb_phy *transceiver;
struct usb_hcd *hcd;
+ struct usb_otg otg;
};
static inline struct ci_role_driver *ci_role(struct ci13xxx *ci)
diff --git a/drivers/usb/chipidea/otg.c b/drivers/usb/chipidea/otg.c
new file mode 100644
index 0000000..7dea3b3
--- /dev/null
+++ b/drivers/usb/chipidea/otg.c
@@ -0,0 +1,60 @@
+/*
+ * otg.c - ChipIdea USB IP core OTG driver
+ *
+ * Copyright (C) 2012 Freescale Semiconductor, Inc.
+ *
+ * Author: Peter Chen
+ *
+ * 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.
+ */
+
+#include <linux/platform_device.h>
+#include <linux/module.h>
+#include <linux/io.h>
+#include <linux/irq.h>
+#include <linux/kernel.h>
+#include <linux/slab.h>
+#include <linux/usb/gadget.h>
+#include <linux/usb/otg.h>
+#include <linux/usb/chipidea.h>
+
+#include "ci.h"
+#include "udc.h"
+#include "bits.h"
+#include "host.h"
+#include "debug.h"
+
+static int ci_otg_set_peripheral(struct usb_otg *otg,
+ struct usb_gadget *periph)
+{
+ otg->gadget = periph;
+
+ return 0;
+}
+
+static int ci_otg_set_host(struct usb_otg *otg, struct usb_bus *host)
+{
+ otg->host = host;
+
+ return 0;
+}
+
+/**
+ * ci_hdrc_otg_init - initialize device related bits
+ * ci: the controller
+ *
+ * This function create otg struct, if the device can switch between
+ * device and host.
+ */
+int ci_hdrc_otg_init(struct ci13xxx *ci)
+{
+ /* Useless at current */
+ ci->otg.set_peripheral = ci_otg_set_peripheral;
+ ci->otg.set_host = ci_otg_set_host;
+ if (!IS_ERR_OR_NULL(ci->transceiver))
+ ci->transceiver->otg = &ci->otg;
+
+ return 0;
+}
diff --git a/drivers/usb/chipidea/otg.h b/drivers/usb/chipidea/otg.h
new file mode 100644
index 0000000..b4c6b3e
--- /dev/null
+++ b/drivers/usb/chipidea/otg.h
@@ -0,0 +1,6 @@
+#ifndef __DRIVERS_USB_CHIPIDEA_OTG_H
+#define __DRIVERS_USB_CHIPIDEA_OTG_H
+
+int ci_hdrc_otg_init(struct ci13xxx *ci);
+
+#endif /* __DRIVERS_USB_CHIPIDEA_OTG_H */
--
1.7.0.4
^ permalink raw reply related
* [RESEND PATCH v5 1/7] Revert "USB: chipidea: add vbus detect for udc"
From: Peter Chen @ 2013-01-21 1:56 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1358733418-17969-1-git-send-email-peter.chen@freescale.com>
vbus register is at otgsc, and vbus detect does not belong
to device function. Revert this patch, and will move
vbus detect function to drivers/usb/chipidea/udc.c
This reverts commit 8c4fc031954b4eb72daf13d3c907a985a3eee208.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
---
drivers/usb/chipidea/ci.h | 1 -
drivers/usb/chipidea/udc.c | 39 +--------------------------------------
2 files changed, 1 insertions(+), 39 deletions(-)
diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h
index e25d126..d738603 100644
--- a/drivers/usb/chipidea/ci.h
+++ b/drivers/usb/chipidea/ci.h
@@ -139,7 +139,6 @@ struct ci13xxx {
enum ci_role role;
bool is_otg;
struct work_struct work;
- struct work_struct vbus_work;
struct workqueue_struct *wq;
struct dma_pool *qh_pool;
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index 2f45bba..d214448 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -305,18 +305,6 @@ static u32 hw_test_and_clear_intr_active(struct ci13xxx *ci)
return reg;
}
-static void hw_enable_vbus_intr(struct ci13xxx *ci)
-{
- hw_write(ci, OP_OTGSC, OTGSC_AVVIS, OTGSC_AVVIS);
- hw_write(ci, OP_OTGSC, OTGSC_AVVIE, OTGSC_AVVIE);
- queue_work(ci->wq, &ci->vbus_work);
-}
-
-static void hw_disable_vbus_intr(struct ci13xxx *ci)
-{
- hw_write(ci, OP_OTGSC, OTGSC_AVVIE, 0);
-}
-
/**
* hw_test_and_clear_setup_guard: test & clear setup guard (execute without
* interruption)
@@ -383,16 +371,6 @@ static int hw_usb_reset(struct ci13xxx *ci)
return 0;
}
-static void vbus_work(struct work_struct *work)
-{
- struct ci13xxx *ci = container_of(work, struct ci13xxx, vbus_work);
-
- if (hw_read(ci, OP_OTGSC, OTGSC_AVV))
- usb_gadget_vbus_connect(&ci->gadget);
- else
- usb_gadget_vbus_disconnect(&ci->gadget);
-}
-
/******************************************************************************
* UTIL block
*****************************************************************************/
@@ -1392,7 +1370,6 @@ static int ci13xxx_vbus_session(struct usb_gadget *_gadget, int is_active)
if (is_active) {
pm_runtime_get_sync(&_gadget->dev);
hw_device_reset(ci, USBMODE_CM_DC);
- hw_enable_vbus_intr(ci);
hw_device_state(ci, ci->ep0out->qh.dma);
} else {
hw_device_state(ci, 0);
@@ -1567,10 +1544,8 @@ static int ci13xxx_start(struct usb_gadget *gadget,
pm_runtime_get_sync(&ci->gadget.dev);
if (ci->platdata->flags & CI13XXX_PULLUP_ON_VBUS) {
if (ci->vbus_active) {
- if (ci->platdata->flags & CI13XXX_REGS_SHARED) {
+ if (ci->platdata->flags & CI13XXX_REGS_SHARED)
hw_device_reset(ci, USBMODE_CM_DC);
- hw_enable_vbus_intr(ci);
- }
} else {
pm_runtime_put_sync(&ci->gadget.dev);
goto done;
@@ -1676,13 +1651,6 @@ static irqreturn_t udc_irq(struct ci13xxx *ci)
} else {
retval = IRQ_NONE;
}
-
- intr = hw_read(ci, OP_OTGSC, ~0);
- hw_write(ci, OP_OTGSC, ~0, intr);
-
- if (intr & (OTGSC_AVVIE & OTGSC_AVVIS))
- queue_work(ci->wq, &ci->vbus_work);
-
spin_unlock(&ci->lock);
return retval;
@@ -1758,7 +1726,6 @@ static int udc_start(struct ci13xxx *ci)
retval = hw_device_reset(ci, USBMODE_CM_DC);
if (retval)
goto put_transceiver;
- hw_enable_vbus_intr(ci);
}
retval = device_register(&ci->gadget.dev);
@@ -1821,9 +1788,6 @@ static void udc_stop(struct ci13xxx *ci)
if (ci == NULL)
return;
- hw_disable_vbus_intr(ci);
- cancel_work_sync(&ci->vbus_work);
-
usb_del_gadget_udc(&ci->gadget);
destroy_eps(ci);
@@ -1864,7 +1828,6 @@ int ci_hdrc_gadget_init(struct ci13xxx *ci)
rdrv->irq = udc_irq;
rdrv->name = "gadget";
ci->roles[CI_ROLE_GADGET] = rdrv;
- INIT_WORK(&ci->vbus_work, vbus_work);
return 0;
}
--
1.7.0.4
^ permalink raw reply related
* [RESEND PATCH v5 0/7] Add fully tested id switch and vbus connect detect support for Chipidea
From: Peter Chen @ 2013-01-21 1:56 UTC (permalink / raw)
To: linux-arm-kernel
Only one typo suggestion from Marek Vasut (change "d" to "D") is added.
At this v5 version.
Anyone who have tested this patchset, please give a tested-by, thanks.
This patchset adds fully tested otg id switch function and
vbus connect/disconnect detection for chipidea driver.
The mainly design of id/vbus handling follows msm otg driver.
I hope the msm usb maintainer can have a look of this patchset,
and give some comments, and move the whole msm usb driver to
chipidea framework if possible in the future.
This patchset is fully tested at i.mx6Q saberlite board.
There is github repo for my chipdiea work:
https://github.com/hzpeterchen/linux-usb.git
branch: master
Peter Chen (7):
Revert "USB: chipidea: add vbus detect for udc"
usb: chipidea: add otg file
usb: chipidea: add otg id switch and vbus connect/disconnect detect
usb: chipidea: consolidate ci_role_driver's API for both roles
usb: chipidea: udc: add pullup/pulldown dp at hw_device_state
usb: chipidea: udc: retire the flag CI13_PULLUP_ON_VBUS
usb: chipidea: imx: add internal vbus regulator control
drivers/usb/chipidea/Makefile | 2 +-
drivers/usb/chipidea/bits.h | 10 ++
drivers/usb/chipidea/ci.h | 30 ++++++-
drivers/usb/chipidea/ci13xxx_imx.c | 81 +++++++++++++----
drivers/usb/chipidea/ci13xxx_msm.c | 1 -
drivers/usb/chipidea/core.c | 178 +++++++++++++++++++++++++++++++-----
drivers/usb/chipidea/host.c | 2 +
drivers/usb/chipidea/otg.c | 68 ++++++++++++++
drivers/usb/chipidea/otg.h | 9 ++
drivers/usb/chipidea/udc.c | 101 ++++++++++-----------
include/linux/usb/chipidea.h | 1 -
11 files changed, 382 insertions(+), 101 deletions(-)
create mode 100644 drivers/usb/chipidea/otg.c
create mode 100644 drivers/usb/chipidea/otg.h
^ permalink raw reply
* [PATCH v2 0/5] ARM: OMAP4: Enable AESS IP.
From: Paul Walmsley @ 2013-01-21 1:54 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <50F9608A.8060102@ti.com>
On Fri, 18 Jan 2013, Sebastien Guiriec wrote:
> Paul, Benoit,
>
> Any comments before I resend the serie with the minor comment for Felipe?
Not from me. The series has been queued for 3.9 with Felipe's comment
fix; thanks Felipe.
- Paul
From: Paul Walmsley <paul@pwsan.com>
Date: Sun, 20 Jan 2013 18:52:09 -0700
Subject: [PATCH] ARM: OMAP2+: hwmod: add enable_preprogram hook
After setup/enable, some IP blocks need some additional setting to
indicate the PRCM that they are inactive until they are configured.
Some examples on OMAP4 include the AESS and FSUSB IP blocks.
To fix this cleanly, this patch adds another optional function
pointer, enable_preprogram, to the IP block's hwmod data. The function
that is pointed to is called by the hwmod code immediately after the
IP block is reset.
This version of the patch includes a patch description fix from Felipe.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Sebastien Guiriec <s-guiriec@ti.com>
Cc: Beno?t Cousson <b-cousson@ti.com>
Cc: P?ter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Felipe Balbi <balbi@ti.com>
---
arch/arm/mach-omap2/omap_hwmod.c | 18 ++++++++++++++++++
arch/arm/mach-omap2/omap_hwmod.h | 2 ++
2 files changed, 20 insertions(+)
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 4653efb..f37d22c 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2053,6 +2053,23 @@ static int _omap4_get_context_lost(struct omap_hwmod *oh)
}
/**
+ * _enable_preprogram - Pre-program an IP block during the _enable() process
+ * @oh: struct omap_hwmod *
+ *
+ * Some IP blocks (such as AESS) require some additional programming
+ * after enable before they can enter idle. If a function pointer to
+ * do so is present in the hwmod data, then call it and pass along the
+ * return value; otherwise, return 0.
+ */
+static int __init _enable_preprogram(struct omap_hwmod *oh)
+{
+ if (!oh->class->enable_preprogram)
+ return 0;
+
+ return oh->class->enable_preprogram(oh);
+}
+
+/**
* _enable - enable an omap_hwmod
* @oh: struct omap_hwmod *
*
@@ -2156,6 +2173,7 @@ static int _enable(struct omap_hwmod *oh)
_update_sysc_cache(oh);
_enable_sysc(oh);
}
+ r = _enable_preprogram(oh);
} else {
if (soc_ops.disable_module)
soc_ops.disable_module(oh);
diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index 3ae852a..41066b4 100644
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -501,6 +501,7 @@ struct omap_hwmod_omap4_prcm {
* @rev: revision of the IP class
* @pre_shutdown: ptr to fn to be executed immediately prior to device shutdown
* @reset: ptr to fn to be executed in place of the standard hwmod reset fn
+ * @enable_preprogram: ptr to fn to be executed during device enable
*
* Represent the class of a OMAP hardware "modules" (e.g. timer,
* smartreflex, gpio, uart...)
@@ -524,6 +525,7 @@ struct omap_hwmod_class {
u32 rev;
int (*pre_shutdown)(struct omap_hwmod *oh);
int (*reset)(struct omap_hwmod *oh);
+ int (*enable_preprogram)(struct omap_hwmod *oh);
};
/**
--
1.7.10.4
^ permalink raw reply related
* [PATCH v4] sdma-imx: Add SDMA firmware for Freescale i.MX SOCs
From: Ben Hutchings @ 2013-01-21 1:51 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1358536921-29348-1-git-send-email-festevam@gmail.com>
On Fri, 2013-01-18 at 17:22 -0200, Fabio Estevam wrote:
[...]
> +CHOICE OF LAW; VENUE; LIMITATIONS. You agree that the statutes and
> +laws of the United States and the State of Texas, USA, without regard
> +to conflicts of laws principles, will apply to all matters relating to
> +this Agreement or the Software, and you agree that any litigation will
> +be subject to the exclusive jurisdiction of the state or federal courts
> +in Texas, USA. You agree that regardless of any statute or law to the
> +contrary, any claim or cause of action arising out of or related to
> +this Agreement or the Software must be filed within one (1) year after
> +such claim or cause of action arose or be forever barred.
[...]
I also have no intention of going to Texas if Freescale thinks I did
something wrong with this firmware. Can you ask their legal department
to have a look at some of the licences currently in linux-firmware.git,
because no-one else has insisted on stuff like this.
Most of the licences say that the firmware may be used and redistributed
for use with $vendor's products, with some or all of the restrictions:
- No modifications allowed
- No reverse-engineering
- No right to use $vendor's name for promotion
Plus the usual warranty disclaimer and requirement to keep the copyright
notice and licence text.
Ben.
--
Ben Hutchings
Q. Which is the greater problem in the world today, ignorance or apathy?
A. I don't know and I couldn't care less.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130121/c2be6108/attachment.sig>
^ permalink raw reply
* [PATCH] ARM: OMAP2+: omap_device: remove obsolete pm_lats and early_device code
From: Paul Walmsley @ 2013-01-21 1:42 UTC (permalink / raw)
To: linux-arm-kernel
Remove now-obsolete code from arch/arm/mach-omap2/omap_device.c. This
mostly consists of removing the first attempt at device PM latency
handling. This was never really used, has been replaced by the common
dev_pm_qos code, and needs to go away as part of the DT conversion.
Also, the early platform_device creation code has been removed, as it
appears to be unused.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
---
arch/arm/mach-omap2/am35xx-emac.c | 2 +-
arch/arm/mach-omap2/devices.c | 25 +-
arch/arm/mach-omap2/display.c | 2 +-
arch/arm/mach-omap2/dma.c | 2 +-
arch/arm/mach-omap2/drm.c | 3 +-
arch/arm/mach-omap2/gpio.c | 3 +-
arch/arm/mach-omap2/gpmc.c | 2 +-
arch/arm/mach-omap2/hdq1w.c | 2 +-
arch/arm/mach-omap2/hsmmc.c | 2 +-
arch/arm/mach-omap2/hwspinlock.c | 3 +-
arch/arm/mach-omap2/i2c.c | 3 +-
arch/arm/mach-omap2/mcbsp.c | 2 +-
arch/arm/mach-omap2/msdi.c | 2 +-
arch/arm/mach-omap2/omap-iommu.c | 3 +-
arch/arm/mach-omap2/omap_device.c | 537 ++++---------------------------------
arch/arm/mach-omap2/omap_device.h | 79 +-----
arch/arm/mach-omap2/pm.c | 4 +-
arch/arm/mach-omap2/pmu.c | 3 +-
arch/arm/mach-omap2/serial.c | 3 +-
arch/arm/mach-omap2/sr_device.c | 3 +-
arch/arm/mach-omap2/timer.c | 3 +-
arch/arm/mach-omap2/usb-host.c | 16 +-
arch/arm/mach-omap2/usb-musb.c | 2 +-
arch/arm/mach-omap2/wd_timer.c | 3 +-
24 files changed, 99 insertions(+), 610 deletions(-)
diff --git a/arch/arm/mach-omap2/am35xx-emac.c b/arch/arm/mach-omap2/am35xx-emac.c
index af11dcd..a00d391 100644
--- a/arch/arm/mach-omap2/am35xx-emac.c
+++ b/arch/arm/mach-omap2/am35xx-emac.c
@@ -63,7 +63,7 @@ static int __init omap_davinci_emac_dev_init(struct omap_hwmod *oh,
struct platform_device *pdev;
pdev = omap_device_build(oh->class->name, 0, oh, pdata, pdata_len,
- NULL, 0, false);
+ false);
if (IS_ERR(pdev)) {
WARN(1, "Can't build omap_device for %s:%s.\n",
oh->class->name, oh->name);
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 5e304d0..2b71352 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -61,8 +61,7 @@ static int __init omap3_l3_init(void)
if (!oh)
pr_err("could not look up %s\n", oh_name);
- pdev = omap_device_build("omap_l3_smx", 0, oh, NULL, 0,
- NULL, 0, 0);
+ pdev = omap_device_build("omap_l3_smx", 0, oh, NULL, 0);
WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name);
@@ -96,8 +95,7 @@ static int __init omap4_l3_init(void)
pr_err("could not look up %s\n", oh_name);
}
- pdev = omap_device_build_ss("omap_l3_noc", 0, oh, 3, NULL,
- 0, NULL, 0, 0);
+ pdev = omap_device_build_ss("omap_l3_noc", 0, oh, 3, NULL, 0);
WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name);
@@ -273,7 +271,7 @@ int __init omap4_keyboard_init(struct omap4_keypad_platform_data
keypad_data = sdp4430_keypad_data;
pdev = omap_device_build(name, id, oh, keypad_data,
- sizeof(struct omap4_keypad_platform_data), NULL, 0, 0);
+ sizeof(struct omap4_keypad_platform_data));
if (IS_ERR(pdev)) {
WARN(1, "Can't build omap_device for %s:%s.\n",
@@ -297,7 +295,7 @@ static inline void __init omap_init_mbox(void)
return;
}
- pdev = omap_device_build("omap-mailbox", -1, oh, NULL, 0, NULL, 0, 0);
+ pdev = omap_device_build("omap-mailbox", -1, oh, NULL, 0);
WARN(IS_ERR(pdev), "%s: could not build device, err %ld\n",
__func__, PTR_ERR(pdev));
}
@@ -337,7 +335,7 @@ static void __init omap_init_mcpdm(void)
return;
}
- pdev = omap_device_build("omap-mcpdm", -1, oh, NULL, 0, NULL, 0, 0);
+ pdev = omap_device_build("omap-mcpdm", -1, oh, NULL, 0);
WARN(IS_ERR(pdev), "Can't build omap_device for omap-mcpdm.\n");
}
#else
@@ -358,7 +356,7 @@ static void __init omap_init_dmic(void)
return;
}
- pdev = omap_device_build("omap-dmic", -1, oh, NULL, 0, NULL, 0, 0);
+ pdev = omap_device_build("omap-dmic", -1, oh, NULL, 0);
WARN(IS_ERR(pdev), "Can't build omap_device for omap-dmic.\n");
}
#else
@@ -384,8 +382,7 @@ static void __init omap_init_hdmi_audio(void)
return;
}
- pdev = omap_device_build("omap-hdmi-audio-dai",
- -1, oh, NULL, 0, NULL, 0, 0);
+ pdev = omap_device_build("omap-hdmi-audio-dai", -1, oh, NULL, 0, 0);
WARN(IS_ERR(pdev),
"Can't build omap_device for omap-hdmi-audio-dai.\n");
@@ -429,8 +426,7 @@ static int __init omap_mcspi_init(struct omap_hwmod *oh, void *unused)
}
spi_num++;
- pdev = omap_device_build(name, spi_num, oh, pdata,
- sizeof(*pdata), NULL, 0, 0);
+ pdev = omap_device_build(name, spi_num, oh, pdata, sizeof(*pdata));
WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s\n",
name, oh->name);
kfree(pdata);
@@ -460,7 +456,7 @@ static void omap_init_rng(void)
if (!oh)
return;
- pdev = omap_device_build("omap_rng", -1, oh, NULL, 0, NULL, 0, 0);
+ pdev = omap_device_build("omap_rng", -1, oh, NULL, 0);
WARN(IS_ERR(pdev), "Can't build omap_device for omap_rng\n");
}
@@ -689,8 +685,7 @@ static void omap_init_ocp2scp(void)
pdata->dev_cnt = dev_cnt;
- pdev = omap_device_build(name, bus_id, oh, pdata, sizeof(*pdata), NULL,
- 0, false);
+ pdev = omap_device_build(name, bus_id, oh, pdata, sizeof(*pdata));
if (IS_ERR(pdev)) {
pr_err("Could not build omap_device for %s %s\n",
name, oh_name);
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index cc75aaf..ff37be1 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -226,7 +226,7 @@ static struct platform_device *create_dss_pdev(const char *pdev_name,
dev_set_name(&pdev->dev, "%s", pdev->name);
ohs[0] = oh;
- od = omap_device_alloc(pdev, ohs, 1, NULL, 0);
+ od = omap_device_alloc(pdev, ohs, 1);
if (IS_ERR(od)) {
pr_err("Could not alloc omap_device for %s\n", pdev_name);
r = -ENOMEM;
diff --git a/arch/arm/mach-omap2/dma.c b/arch/arm/mach-omap2/dma.c
index 612b982..491c5c8 100644
--- a/arch/arm/mach-omap2/dma.c
+++ b/arch/arm/mach-omap2/dma.c
@@ -248,7 +248,7 @@ static int __init omap2_system_dma_init_dev(struct omap_hwmod *oh, void *unused)
p->errata = configure_dma_errata();
- pdev = omap_device_build(name, 0, oh, p, sizeof(*p), NULL, 0, 0);
+ pdev = omap_device_build(name, 0, oh, p, sizeof(*p));
kfree(p);
if (IS_ERR(pdev)) {
pr_err("%s: Can't build omap_device for %s:%s.\n",
diff --git a/arch/arm/mach-omap2/drm.c b/arch/arm/mach-omap2/drm.c
index 4c7566c..c880e87 100644
--- a/arch/arm/mach-omap2/drm.c
+++ b/arch/arm/mach-omap2/drm.c
@@ -50,8 +50,7 @@ static int __init omap_init_drm(void)
oh = omap_hwmod_lookup("dmm");
if (oh) {
- pdev = omap_device_build(oh->name, -1, oh, NULL, 0, NULL, 0,
- false);
+ pdev = omap_device_build(oh->name, -1, oh, NULL, 0);
WARN(IS_ERR(pdev), "Could not build omap_device for %s\n",
oh->name);
}
diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
index 399acab..482ade1 100644
--- a/arch/arm/mach-omap2/gpio.c
+++ b/arch/arm/mach-omap2/gpio.c
@@ -131,8 +131,7 @@ static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
pwrdm = omap_hwmod_get_pwrdm(oh);
pdata->loses_context = pwrdm_can_ever_lose_context(pwrdm);
- pdev = omap_device_build(name, id - 1, oh, pdata,
- sizeof(*pdata), NULL, 0, false);
+ pdev = omap_device_build(name, id - 1, oh, pdata, sizeof(*pdata));
kfree(pdata);
if (IS_ERR(pdev)) {
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 8033cb7..bc07833 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -1220,7 +1220,7 @@ static int __init omap_gpmc_init(void)
return -ENODEV;
}
- pdev = omap_device_build(DEVICE_NAME, -1, oh, NULL, 0, NULL, 0, 0);
+ pdev = omap_device_build(DEVICE_NAME, -1, oh, NULL, 0);
WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name);
return IS_ERR(pdev) ? PTR_ERR(pdev) : 0;
diff --git a/arch/arm/mach-omap2/hdq1w.c b/arch/arm/mach-omap2/hdq1w.c
index ab7bf18..b7aa8ba 100644
--- a/arch/arm/mach-omap2/hdq1w.c
+++ b/arch/arm/mach-omap2/hdq1w.c
@@ -87,7 +87,7 @@ static int __init omap_init_hdq(void)
if (!oh)
return 0;
- pdev = omap_device_build(devname, id, oh, NULL, 0, NULL, 0, 0);
+ pdev = omap_device_build(devname, id, oh, NULL, 0);
WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s.\n",
devname, oh->name);
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 4a96433..2ef1f87 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -522,7 +522,7 @@ static void __init omap_hsmmc_init_one(struct omap2_hsmmc_info *hsmmcinfo,
}
dev_set_name(&pdev->dev, "%s.%d", pdev->name, pdev->id);
- od = omap_device_alloc(pdev, ohs, 1, NULL, 0);
+ od = omap_device_alloc(pdev, ohs, 1);
if (IS_ERR(od)) {
pr_err("Could not allocate od for %s\n", name);
goto put_pdev;
diff --git a/arch/arm/mach-omap2/hwspinlock.c b/arch/arm/mach-omap2/hwspinlock.c
index 1df9b5f..c368890 100644
--- a/arch/arm/mach-omap2/hwspinlock.c
+++ b/arch/arm/mach-omap2/hwspinlock.c
@@ -46,8 +46,7 @@ static int __init hwspinlocks_init(void)
return -EINVAL;
pdev = omap_device_build(dev_name, 0, oh, &omap_hwspinlock_pdata,
- sizeof(struct hwspinlock_pdata),
- NULL, 0, false);
+ sizeof(struct hwspinlock_pdata));
if (IS_ERR(pdev)) {
pr_err("Can't build omap_device for %s:%s\n", dev_name,
oh_name);
diff --git a/arch/arm/mach-omap2/i2c.c b/arch/arm/mach-omap2/i2c.c
index b9074dd..c11a23f 100644
--- a/arch/arm/mach-omap2/i2c.c
+++ b/arch/arm/mach-omap2/i2c.c
@@ -178,8 +178,7 @@ int __init omap_i2c_add_bus(struct omap_i2c_bus_platform_data *i2c_pdata,
if (cpu_is_omap34xx())
pdata->set_mpu_wkup_lat = omap_pm_set_max_mpu_wakeup_lat_compat;
pdev = omap_device_build(name, bus_id, oh, pdata,
- sizeof(struct omap_i2c_bus_platform_data),
- NULL, 0, 0);
+ sizeof(struct omap_i2c_bus_platform_data));
WARN(IS_ERR(pdev), "Could not build omap_device for %s\n", name);
return PTR_RET(pdev);
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c
index df49f2a..4535804 100644
--- a/arch/arm/mach-omap2/mcbsp.c
+++ b/arch/arm/mach-omap2/mcbsp.c
@@ -101,7 +101,7 @@ static int __init omap_init_mcbsp(struct omap_hwmod *oh, void *unused)
count++;
}
pdev = omap_device_build_ss(name, id, oh_device, count, pdata,
- sizeof(*pdata), NULL, 0, false);
+ sizeof(*pdata));
kfree(pdata);
if (IS_ERR(pdev)) {
pr_err("%s: Can't build omap_device for %s:%s.\n", __func__,
diff --git a/arch/arm/mach-omap2/msdi.c b/arch/arm/mach-omap2/msdi.c
index aafdd4c..c52d8b4 100644
--- a/arch/arm/mach-omap2/msdi.c
+++ b/arch/arm/mach-omap2/msdi.c
@@ -150,7 +150,7 @@ void __init omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data)
return;
}
pdev = omap_device_build(dev_name, id, oh, mmc_data[0],
- sizeof(struct omap_mmc_platform_data), NULL, 0, 0);
+ sizeof(struct omap_mmc_platform_data));
if (IS_ERR(pdev))
WARN(1, "Can'd build omap_device for %s:%s.\n",
dev_name, oh->name);
diff --git a/arch/arm/mach-omap2/omap-iommu.c b/arch/arm/mach-omap2/omap-iommu.c
index 6da4f7a..f7f38c7 100644
--- a/arch/arm/mach-omap2/omap-iommu.c
+++ b/arch/arm/mach-omap2/omap-iommu.c
@@ -41,8 +41,7 @@ static int __init omap_iommu_dev_init(struct omap_hwmod *oh, void *unused)
pdata->deassert_reset = omap_device_deassert_hardreset;
}
- pdev = omap_device_build("omap-iommu", i, oh, pdata, sizeof(*pdata),
- NULL, 0, 0);
+ pdev = omap_device_build("omap-iommu", i, oh, pdata, sizeof(*pdata));
kfree(pdata);
diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c
index e065daa..6ee3ad3 100644
--- a/arch/arm/mach-omap2/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
@@ -17,68 +17,15 @@
* to control power management and interconnect properties of their
* devices.
*
- * In the medium- to long-term, this code should either be
- * a) implemented via arch-specific pointers in platform_data
- * or
- * b) implemented as a proper omap_bus/omap_device in Linux, no more
- * platform_data func pointers
+ * In the medium- to long-term, this code should be implemented as a
+ * proper omap_bus/omap_device in Linux, no more platform_data func
+ * pointers
*
*
- * Guidelines for usage by driver authors:
- *
- * 1. These functions are intended to be used by device drivers via
- * function pointers in struct platform_data. As an example,
- * omap_device_enable() should be passed to the driver as
- *
- * struct foo_driver_platform_data {
- * ...
- * int (*device_enable)(struct platform_device *pdev);
- * ...
- * }
- *
- * Note that the generic "device_enable" name is used, rather than
- * "omap_device_enable". This is so other architectures can pass in their
- * own enable/disable functions here.
- *
- * This should be populated during device setup:
- *
- * ...
- * pdata->device_enable = omap_device_enable;
- * ...
- *
- * 2. Drivers should first check to ensure the function pointer is not null
- * before calling it, as in:
- *
- * if (pdata->device_enable)
- * pdata->device_enable(pdev);
- *
- * This allows other architectures that don't use similar device_enable()/
- * device_shutdown() functions to execute normally.
- *
- * ...
- *
- * Suggested usage by device drivers:
- *
- * During device initialization:
- * device_enable()
- *
- * During device idle:
- * (save remaining device context if necessary)
- * device_idle();
- *
- * During device resume:
- * device_enable();
- * (restore context if necessary)
- *
- * During device shutdown:
- * device_shutdown()
- * (device must be reinitialized at this point to use it again)
- *
*/
#undef DEBUG
#include <linux/kernel.h>
-#include <linux/export.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/err.h>
@@ -92,155 +39,8 @@
#include "omap_device.h"
#include "omap_hwmod.h"
-/* These parameters are passed to _omap_device_{de,}activate() */
-#define USE_WAKEUP_LAT 0
-#define IGNORE_WAKEUP_LAT 1
-
-static int omap_early_device_register(struct platform_device *pdev);
-
-static struct omap_device_pm_latency omap_default_latency[] = {
- {
- .deactivate_func = omap_device_idle_hwmods,
- .activate_func = omap_device_enable_hwmods,
- .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
- }
-};
-
/* Private functions */
-/**
- * _omap_device_activate - increase device readiness
- * @od: struct omap_device *
- * @ignore_lat: increase to latency target (0) or full readiness (1)?
- *
- * Increase readiness of omap_device @od (thus decreasing device
- * wakeup latency, but consuming more power). If @ignore_lat is
- * IGNORE_WAKEUP_LAT, make the omap_device fully active. Otherwise,
- * if @ignore_lat is USE_WAKEUP_LAT, and the device's maximum wakeup
- * latency is greater than the requested maximum wakeup latency, step
- * backwards in the omap_device_pm_latency table to ensure the
- * device's maximum wakeup latency is less than or equal to the
- * requested maximum wakeup latency. Returns 0.
- */
-static int _omap_device_activate(struct omap_device *od, u8 ignore_lat)
-{
- struct timespec a, b, c;
-
- dev_dbg(&od->pdev->dev, "omap_device: activating\n");
-
- while (od->pm_lat_level > 0) {
- struct omap_device_pm_latency *odpl;
- unsigned long long act_lat = 0;
-
- od->pm_lat_level--;
-
- odpl = od->pm_lats + od->pm_lat_level;
-
- if (!ignore_lat &&
- (od->dev_wakeup_lat <= od->_dev_wakeup_lat_limit))
- break;
-
- read_persistent_clock(&a);
-
- /* XXX check return code */
- odpl->activate_func(od);
-
- read_persistent_clock(&b);
-
- c = timespec_sub(b, a);
- act_lat = timespec_to_ns(&c);
-
- dev_dbg(&od->pdev->dev,
- "omap_device: pm_lat %d: activate: elapsed time %llu nsec\n",
- od->pm_lat_level, act_lat);
-
- if (act_lat > odpl->activate_lat) {
- odpl->activate_lat_worst = act_lat;
- if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) {
- odpl->activate_lat = act_lat;
- dev_dbg(&od->pdev->dev,
- "new worst case activate latency %d: %llu\n",
- od->pm_lat_level, act_lat);
- } else
- dev_warn(&od->pdev->dev,
- "activate latency %d higher than expected. (%llu > %d)\n",
- od->pm_lat_level, act_lat,
- odpl->activate_lat);
- }
-
- od->dev_wakeup_lat -= odpl->activate_lat;
- }
-
- return 0;
-}
-
-/**
- * _omap_device_deactivate - decrease device readiness
- * @od: struct omap_device *
- * @ignore_lat: decrease to latency target (0) or full inactivity (1)?
- *
- * Decrease readiness of omap_device @od (thus increasing device
- * wakeup latency, but conserving power). If @ignore_lat is
- * IGNORE_WAKEUP_LAT, make the omap_device fully inactive. Otherwise,
- * if @ignore_lat is USE_WAKEUP_LAT, and the device's maximum wakeup
- * latency is less than the requested maximum wakeup latency, step
- * forwards in the omap_device_pm_latency table to ensure the device's
- * maximum wakeup latency is less than or equal to the requested
- * maximum wakeup latency. Returns 0.
- */
-static int _omap_device_deactivate(struct omap_device *od, u8 ignore_lat)
-{
- struct timespec a, b, c;
-
- dev_dbg(&od->pdev->dev, "omap_device: deactivating\n");
-
- while (od->pm_lat_level < od->pm_lats_cnt) {
- struct omap_device_pm_latency *odpl;
- unsigned long long deact_lat = 0;
-
- odpl = od->pm_lats + od->pm_lat_level;
-
- if (!ignore_lat &&
- ((od->dev_wakeup_lat + odpl->activate_lat) >
- od->_dev_wakeup_lat_limit))
- break;
-
- read_persistent_clock(&a);
-
- /* XXX check return code */
- odpl->deactivate_func(od);
-
- read_persistent_clock(&b);
-
- c = timespec_sub(b, a);
- deact_lat = timespec_to_ns(&c);
-
- dev_dbg(&od->pdev->dev,
- "omap_device: pm_lat %d: deactivate: elapsed time %llu nsec\n",
- od->pm_lat_level, deact_lat);
-
- if (deact_lat > odpl->deactivate_lat) {
- odpl->deactivate_lat_worst = deact_lat;
- if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) {
- odpl->deactivate_lat = deact_lat;
- dev_dbg(&od->pdev->dev,
- "new worst case deactivate latency %d: %llu\n",
- od->pm_lat_level, deact_lat);
- } else
- dev_warn(&od->pdev->dev,
- "deactivate latency %d higher than expected. (%llu > %d)\n",
- od->pm_lat_level, deact_lat,
- odpl->deactivate_lat);
- }
-
- od->dev_wakeup_lat += odpl->activate_lat;
-
- od->pm_lat_level++;
- }
-
- return 0;
-}
-
static void _add_clkdev(struct omap_device *od, const char *clk_alias,
const char *clk_name)
{
@@ -315,9 +115,6 @@ static void _add_hwmod_clocks_clkdev(struct omap_device *od,
* @oh: ptr to the single omap_hwmod that backs this omap_device
* @pdata: platform_data ptr to associate with the platform_device
* @pdata_len: amount of memory pointed to by @pdata
- * @pm_lats: pointer to a omap_device_pm_latency array for this device
- * @pm_lats_cnt: ARRAY_SIZE() of @pm_lats
- * @is_early_device: should the device be registered as an early device or not
*
* Function for building an omap_device already registered from device-tree
*
@@ -356,7 +153,7 @@ static int omap_device_build_from_dt(struct platform_device *pdev)
hwmods[i] = oh;
}
- od = omap_device_alloc(pdev, hwmods, oh_cnt, NULL, 0);
+ od = omap_device_alloc(pdev, hwmods, oh_cnt);
if (!od) {
dev_err(&pdev->dev, "Cannot allocate omap_device for :%s\n",
oh_name);
@@ -407,6 +204,39 @@ static int _omap_device_notifier_call(struct notifier_block *nb,
return NOTIFY_DONE;
}
+/**
+ * _omap_device_enable_hwmods - call omap_hwmod_enable() on all hwmods
+ * @od: struct omap_device *od
+ *
+ * Enable all underlying hwmods. Returns 0.
+ */
+static int _omap_device_enable_hwmods(struct omap_device *od)
+{
+ int i;
+
+ for (i = 0; i < od->hwmods_cnt; i++)
+ omap_hwmod_enable(od->hwmods[i]);
+
+ /* XXX pass along return value here? */
+ return 0;
+}
+
+/**
+ * _omap_device_idle_hwmods - call omap_hwmod_idle() on all hwmods
+ * @od: struct omap_device *od
+ *
+ * Idle all underlying hwmods. Returns 0.
+ */
+static int _omap_device_idle_hwmods(struct omap_device *od)
+{
+ int i;
+
+ for (i = 0; i < od->hwmods_cnt; i++)
+ omap_hwmod_idle(od->hwmods[i]);
+
+ /* XXX pass along return value here? */
+ return 0;
+}
/* Public functions for use by core code */
@@ -526,18 +356,14 @@ static int _od_fill_dma_resources(struct omap_device *od,
* @oh: ptr to the single omap_hwmod that backs this omap_device
* @pdata: platform_data ptr to associate with the platform_device
* @pdata_len: amount of memory pointed to by @pdata
- * @pm_lats: pointer to a omap_device_pm_latency array for this device
- * @pm_lats_cnt: ARRAY_SIZE() of @pm_lats
*
* Convenience function for allocating an omap_device structure and filling
- * hwmods, resources and pm_latency attributes.
+ * hwmods, and resources.
*
* Returns an struct omap_device pointer or ERR_PTR() on error;
*/
struct omap_device *omap_device_alloc(struct platform_device *pdev,
- struct omap_hwmod **ohs, int oh_cnt,
- struct omap_device_pm_latency *pm_lats,
- int pm_lats_cnt)
+ struct omap_hwmod **ohs, int oh_cnt)
{
int ret = -ENOMEM;
struct omap_device *od;
@@ -626,18 +452,6 @@ struct omap_device *omap_device_alloc(struct platform_device *pdev,
goto oda_exit3;
have_everything:
- if (!pm_lats) {
- pm_lats = omap_default_latency;
- pm_lats_cnt = ARRAY_SIZE(omap_default_latency);
- }
-
- od->pm_lats_cnt = pm_lats_cnt;
- od->pm_lats = kmemdup(pm_lats,
- sizeof(struct omap_device_pm_latency) * pm_lats_cnt,
- GFP_KERNEL);
- if (!od->pm_lats)
- goto oda_exit3;
-
pdev->archdata.od = od;
for (i = 0; i < oh_cnt; i++) {
@@ -663,7 +477,6 @@ void omap_device_delete(struct omap_device *od)
return;
od->pdev->archdata.od = NULL;
- kfree(od->pm_lats);
kfree(od->hwmods);
kfree(od);
}
@@ -675,9 +488,6 @@ void omap_device_delete(struct omap_device *od)
* @oh: ptr to the single omap_hwmod that backs this omap_device
* @pdata: platform_data ptr to associate with the platform_device
* @pdata_len: amount of memory pointed to by @pdata
- * @pm_lats: pointer to a omap_device_pm_latency array for this device
- * @pm_lats_cnt: ARRAY_SIZE() of @pm_lats
- * @is_early_device: should the device be registered as an early device or not
*
* Convenience function for building and registering a single
* omap_device record, which in turn builds and registers a
@@ -685,11 +495,10 @@ void omap_device_delete(struct omap_device *od)
* information. Returns ERR_PTR(-EINVAL) if @oh is NULL; otherwise,
* passes along the return value of omap_device_build_ss().
*/
-struct platform_device __init *omap_device_build(const char *pdev_name, int pdev_id,
- struct omap_hwmod *oh, void *pdata,
- int pdata_len,
- struct omap_device_pm_latency *pm_lats,
- int pm_lats_cnt, int is_early_device)
+struct platform_device __init *omap_device_build(const char *pdev_name,
+ int pdev_id,
+ struct omap_hwmod *oh,
+ void *pdata, int pdata_len)
{
struct omap_hwmod *ohs[] = { oh };
@@ -697,8 +506,7 @@ struct platform_device __init *omap_device_build(const char *pdev_name, int pdev
return ERR_PTR(-EINVAL);
return omap_device_build_ss(pdev_name, pdev_id, ohs, 1, pdata,
- pdata_len, pm_lats, pm_lats_cnt,
- is_early_device);
+ pdata_len);
}
/**
@@ -708,9 +516,6 @@ struct platform_device __init *omap_device_build(const char *pdev_name, int pdev
* @oh: ptr to the single omap_hwmod that backs this omap_device
* @pdata: platform_data ptr to associate with the platform_device
* @pdata_len: amount of memory pointed to by @pdata
- * @pm_lats: pointer to a omap_device_pm_latency array for this device
- * @pm_lats_cnt: ARRAY_SIZE() of @pm_lats
- * @is_early_device: should the device be registered as an early device or not
*
* Convenience function for building and registering an omap_device
* subsystem record. Subsystem records consist of multiple
@@ -718,11 +523,11 @@ struct platform_device __init *omap_device_build(const char *pdev_name, int pdev
* platform_device record. Returns an ERR_PTR() on error, or passes
* along the return value of omap_device_register().
*/
-struct platform_device __init *omap_device_build_ss(const char *pdev_name, int pdev_id,
- struct omap_hwmod **ohs, int oh_cnt,
- void *pdata, int pdata_len,
- struct omap_device_pm_latency *pm_lats,
- int pm_lats_cnt, int is_early_device)
+struct platform_device __init *omap_device_build_ss(const char *pdev_name,
+ int pdev_id,
+ struct omap_hwmod **ohs,
+ int oh_cnt, void *pdata,
+ int pdata_len)
{
int ret = -ENOMEM;
struct platform_device *pdev;
@@ -746,7 +551,7 @@ struct platform_device __init *omap_device_build_ss(const char *pdev_name, int p
else
dev_set_name(&pdev->dev, "%s", pdev->name);
- od = omap_device_alloc(pdev, ohs, oh_cnt, pm_lats, pm_lats_cnt);
+ od = omap_device_alloc(pdev, ohs, oh_cnt);
if (IS_ERR(od))
goto odbs_exit1;
@@ -754,10 +559,7 @@ struct platform_device __init *omap_device_build_ss(const char *pdev_name, int p
if (ret)
goto odbs_exit2;
- if (is_early_device)
- ret = omap_early_device_register(pdev);
- else
- ret = omap_device_register(pdev);
+ ret = omap_device_register(pdev);
if (ret)
goto odbs_exit2;
@@ -774,24 +576,6 @@ odbs_exit:
return ERR_PTR(ret);
}
-/**
- * omap_early_device_register - register an omap_device as an early platform
- * device.
- * @od: struct omap_device * to register
- *
- * Register the omap_device structure. This currently just calls
- * platform_early_add_device() on the underlying platform_device.
- * Returns 0 by default.
- */
-static int __init omap_early_device_register(struct platform_device *pdev)
-{
- struct platform_device *devices[1];
-
- devices[0] = pdev;
- early_platform_add_devices(devices, 1);
- return 0;
-}
-
#ifdef CONFIG_PM_RUNTIME
static int _od_runtime_suspend(struct device *dev)
{
@@ -902,10 +686,9 @@ int omap_device_register(struct platform_device *pdev)
* to be accessible and ready to operate. This generally involves
* enabling clocks, setting SYSCONFIG registers; and in the future may
* involve remuxing pins. Device drivers should call this function
- * (through platform_data function pointers) where they would normally
- * enable clocks, etc. Returns -EINVAL if called when the omap_device
- * is already enabled, or passes along the return value of
- * _omap_device_activate().
+ * indirectly via pm_runtime_get*(). Returns -EINVAL if called when
+ * the omap_device is already enabled, or passes along the return
+ * value of _omap_device_enable_hwmods().
*/
int omap_device_enable(struct platform_device *pdev)
{
@@ -921,14 +704,8 @@ int omap_device_enable(struct platform_device *pdev)
return -EINVAL;
}
- /* Enable everything if we're enabling this device from scratch */
- if (od->_state == OMAP_DEVICE_STATE_UNKNOWN)
- od->pm_lat_level = od->pm_lats_cnt;
-
- ret = _omap_device_activate(od, IGNORE_WAKEUP_LAT);
+ ret = _omap_device_enable_hwmods(od);
- od->dev_wakeup_lat = 0;
- od->_dev_wakeup_lat_limit = UINT_MAX;
od->_state = OMAP_DEVICE_STATE_ENABLED;
return ret;
@@ -938,14 +715,10 @@ int omap_device_enable(struct platform_device *pdev)
* omap_device_idle - idle an omap_device
* @od: struct omap_device * to idle
*
- * Idle omap_device @od by calling as many .deactivate_func() entries
- * in the omap_device's pm_lats table as is possible without exceeding
- * the device's maximum wakeup latency limit, pm_lat_limit. Device
- * drivers should call this function (through platform_data function
- * pointers) where they would normally disable clocks after operations
- * complete, etc.. Returns -EINVAL if the omap_device is not
+ * Idle omap_device @od. Device drivers call this function indirectly
+ * via pm_runtime_put*(). Returns -EINVAL if the omap_device is not
* currently enabled, or passes along the return value of
- * _omap_device_deactivate().
+ * _omap_device_idle_hwmods().
*/
int omap_device_idle(struct platform_device *pdev)
{
@@ -961,7 +734,7 @@ int omap_device_idle(struct platform_device *pdev)
return -EINVAL;
}
- ret = _omap_device_deactivate(od, USE_WAKEUP_LAT);
+ ret = _omap_device_idle_hwmods(od);
od->_state = OMAP_DEVICE_STATE_IDLE;
@@ -969,42 +742,6 @@ int omap_device_idle(struct platform_device *pdev)
}
/**
- * omap_device_shutdown - shut down an omap_device
- * @od: struct omap_device * to shut down
- *
- * Shut down omap_device @od by calling all .deactivate_func() entries
- * in the omap_device's pm_lats table and then shutting down all of
- * the underlying omap_hwmods. Used when a device is being "removed"
- * or a device driver is being unloaded. Returns -EINVAL if the
- * omap_device is not currently enabled or idle, or passes along the
- * return value of _omap_device_deactivate().
- */
-int omap_device_shutdown(struct platform_device *pdev)
-{
- int ret, i;
- struct omap_device *od;
-
- od = to_omap_device(pdev);
-
- if (od->_state != OMAP_DEVICE_STATE_ENABLED &&
- od->_state != OMAP_DEVICE_STATE_IDLE) {
- dev_warn(&pdev->dev,
- "omap_device: %s() called from invalid state %d\n",
- __func__, od->_state);
- return -EINVAL;
- }
-
- ret = _omap_device_deactivate(od, IGNORE_WAKEUP_LAT);
-
- for (i = 0; i < od->hwmods_cnt; i++)
- omap_hwmod_shutdown(od->hwmods[i]);
-
- od->_state = OMAP_DEVICE_STATE_SHUTDOWN;
-
- return ret;
-}
-
-/**
* omap_device_assert_hardreset - set a device's hardreset line
* @pdev: struct platform_device * to reset
* @name: const char * name of the reset line
@@ -1060,86 +797,6 @@ int omap_device_deassert_hardreset(struct platform_device *pdev,
}
/**
- * omap_device_align_pm_lat - activate/deactivate device to match wakeup lat lim
- * @od: struct omap_device *
- *
- * When a device's maximum wakeup latency limit changes, call some of
- * the .activate_func or .deactivate_func function pointers in the
- * omap_device's pm_lats array to ensure that the device's maximum
- * wakeup latency is less than or equal to the new latency limit.
- * Intended to be called by OMAP PM code whenever a device's maximum
- * wakeup latency limit changes (e.g., via
- * omap_pm_set_dev_wakeup_lat()). Returns 0 if nothing needs to be
- * done (e.g., if the omap_device is not currently idle, or if the
- * wakeup latency is already current with the new limit) or passes
- * along the return value of _omap_device_deactivate() or
- * _omap_device_activate().
- */
-int omap_device_align_pm_lat(struct platform_device *pdev,
- u32 new_wakeup_lat_limit)
-{
- int ret = -EINVAL;
- struct omap_device *od;
-
- od = to_omap_device(pdev);
-
- if (new_wakeup_lat_limit == od->dev_wakeup_lat)
- return 0;
-
- od->_dev_wakeup_lat_limit = new_wakeup_lat_limit;
-
- if (od->_state != OMAP_DEVICE_STATE_IDLE)
- return 0;
- else if (new_wakeup_lat_limit > od->dev_wakeup_lat)
- ret = _omap_device_deactivate(od, USE_WAKEUP_LAT);
- else if (new_wakeup_lat_limit < od->dev_wakeup_lat)
- ret = _omap_device_activate(od, USE_WAKEUP_LAT);
-
- return ret;
-}
-
-/**
- * omap_device_get_pwrdm - return the powerdomain * associated with @od
- * @od: struct omap_device *
- *
- * Return the powerdomain associated with the first underlying
- * omap_hwmod for this omap_device. Intended for use by core OMAP PM
- * code. Returns NULL on error or a struct powerdomain * upon
- * success.
- */
-struct powerdomain *omap_device_get_pwrdm(struct omap_device *od)
-{
- /*
- * XXX Assumes that all omap_hwmod powerdomains are identical.
- * This may not necessarily be true. There should be a sanity
- * check in here to WARN() if any difference appears.
- */
- if (!od->hwmods_cnt)
- return NULL;
-
- return omap_hwmod_get_pwrdm(od->hwmods[0]);
-}
-
-/**
- * omap_device_get_mpu_rt_va - return the MPU's virtual addr for the hwmod base
- * @od: struct omap_device *
- *
- * Return the MPU's virtual address for the base of the hwmod, from
- * the ioremap() that the hwmod code does. Only valid if there is one
- * hwmod associated with this device. Returns NULL if there are zero
- * or more than one hwmods associated with this omap_device;
- * otherwise, passes along the return value from
- * omap_hwmod_get_mpu_rt_va().
- */
-void __iomem *omap_device_get_rt_va(struct omap_device *od)
-{
- if (od->hwmods_cnt != 1)
- return NULL;
-
- return omap_hwmod_get_mpu_rt_va(od->hwmods[0]);
-}
-
-/**
* omap_device_get_by_hwmod_name() - convert a hwmod name to
* device pointer.
* @oh_name: name of the hwmod device
@@ -1173,82 +830,6 @@ struct device *omap_device_get_by_hwmod_name(const char *oh_name)
return &oh->od->pdev->dev;
}
-EXPORT_SYMBOL(omap_device_get_by_hwmod_name);
-
-/*
- * Public functions intended for use in omap_device_pm_latency
- * .activate_func and .deactivate_func function pointers
- */
-
-/**
- * omap_device_enable_hwmods - call omap_hwmod_enable() on all hwmods
- * @od: struct omap_device *od
- *
- * Enable all underlying hwmods. Returns 0.
- */
-int omap_device_enable_hwmods(struct omap_device *od)
-{
- int i;
-
- for (i = 0; i < od->hwmods_cnt; i++)
- omap_hwmod_enable(od->hwmods[i]);
-
- /* XXX pass along return value here? */
- return 0;
-}
-
-/**
- * omap_device_idle_hwmods - call omap_hwmod_idle() on all hwmods
- * @od: struct omap_device *od
- *
- * Idle all underlying hwmods. Returns 0.
- */
-int omap_device_idle_hwmods(struct omap_device *od)
-{
- int i;
-
- for (i = 0; i < od->hwmods_cnt; i++)
- omap_hwmod_idle(od->hwmods[i]);
-
- /* XXX pass along return value here? */
- return 0;
-}
-
-/**
- * omap_device_disable_clocks - disable all main and interface clocks
- * @od: struct omap_device *od
- *
- * Disable the main functional clock and interface clock for all of the
- * omap_hwmods associated with the omap_device. Returns 0.
- */
-int omap_device_disable_clocks(struct omap_device *od)
-{
- int i;
-
- for (i = 0; i < od->hwmods_cnt; i++)
- omap_hwmod_disable_clocks(od->hwmods[i]);
-
- /* XXX pass along return value here? */
- return 0;
-}
-
-/**
- * omap_device_enable_clocks - enable all main and interface clocks
- * @od: struct omap_device *od
- *
- * Enable the main functional clock and interface clock for all of the
- * omap_hwmods associated with the omap_device. Returns 0.
- */
-int omap_device_enable_clocks(struct omap_device *od)
-{
- int i;
-
- for (i = 0; i < od->hwmods_cnt; i++)
- omap_hwmod_enable_clocks(od->hwmods[i]);
-
- /* XXX pass along return value here? */
- return 0;
-}
static struct notifier_block platform_nb = {
.notifier_call = _omap_device_notifier_call,
diff --git a/arch/arm/mach-omap2/omap_device.h b/arch/arm/mach-omap2/omap_device.h
index 0933c59..044c31d 100644
--- a/arch/arm/mach-omap2/omap_device.h
+++ b/arch/arm/mach-omap2/omap_device.h
@@ -13,20 +13,12 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
- * Eventually this type of functionality should either be
- * a) implemented via arch-specific pointers in platform_device
- * or
- * b) implemented as a proper omap_bus/omap_device in Linux, no more
- * platform_device
+ * This type of functionality should be implemented as a proper
+ * omap_bus/omap_device in Linux.
*
* omap_device differs from omap_hwmod in that it includes external
* (e.g., board- and system-level) integration details. omap_hwmod
* stores hardware data that is invariant for a given OMAP chip.
- *
- * To do:
- * - GPIO integration
- * - regulator integration
- *
*/
#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_DEVICE_H
#define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_DEVICE_H
@@ -45,19 +37,14 @@ extern struct dev_pm_domain omap_device_pm_domain;
#define OMAP_DEVICE_STATE_SHUTDOWN 3
/* omap_device.flags values */
-#define OMAP_DEVICE_SUSPENDED BIT(0)
-#define OMAP_DEVICE_NO_IDLE_ON_SUSPEND BIT(1)
+#define OMAP_DEVICE_SUSPENDED BIT(0)
+#define OMAP_DEVICE_NO_IDLE_ON_SUSPEND BIT(1)
/**
* struct omap_device - omap_device wrapper for platform_devices
* @pdev: platform_device
* @hwmods: (one .. many per omap_device)
* @hwmods_cnt: ARRAY_SIZE() of @hwmods
- * @pm_lats: ptr to an omap_device_pm_latency table
- * @pm_lats_cnt: ARRAY_SIZE() of what is passed to @pm_lats
- * @pm_lat_level: array index of the last odpl entry executed - -1 if never
- * @dev_wakeup_lat: dev wakeup latency in nanoseconds
- * @_dev_wakeup_lat_limit: dev wakeup latency limit in nsec - set by OMAP PM
* @_state: one of OMAP_DEVICE_STATE_* (see above)
* @flags: device flags
* @_driver_status: one of BUS_NOTIFY_*_DRIVER from <linux/device.h>
@@ -71,12 +58,7 @@ extern struct dev_pm_domain omap_device_pm_domain;
struct omap_device {
struct platform_device *pdev;
struct omap_hwmod **hwmods;
- struct omap_device_pm_latency *pm_lats;
- u32 dev_wakeup_lat;
- u32 _dev_wakeup_lat_limit;
unsigned long _driver_status;
- u8 pm_lats_cnt;
- s8 pm_lat_level;
u8 hwmods_cnt;
u8 _state;
u8 flags;
@@ -86,36 +68,25 @@ struct omap_device {
int omap_device_enable(struct platform_device *pdev);
int omap_device_idle(struct platform_device *pdev);
-int omap_device_shutdown(struct platform_device *pdev);
/* Core code interface */
struct platform_device *omap_device_build(const char *pdev_name, int pdev_id,
- struct omap_hwmod *oh, void *pdata,
- int pdata_len,
- struct omap_device_pm_latency *pm_lats,
- int pm_lats_cnt, int is_early_device);
+ struct omap_hwmod *oh, void *pdata,
+ int pdata_len);
struct platform_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
struct omap_hwmod **oh, int oh_cnt,
- void *pdata, int pdata_len,
- struct omap_device_pm_latency *pm_lats,
- int pm_lats_cnt, int is_early_device);
+ void *pdata, int pdata_len);
struct omap_device *omap_device_alloc(struct platform_device *pdev,
- struct omap_hwmod **ohs, int oh_cnt,
- struct omap_device_pm_latency *pm_lats,
- int pm_lats_cnt);
+ struct omap_hwmod **ohs, int oh_cnt);
void omap_device_delete(struct omap_device *od);
int omap_device_register(struct platform_device *pdev);
-void __iomem *omap_device_get_rt_va(struct omap_device *od);
struct device *omap_device_get_by_hwmod_name(const char *oh_name);
/* OMAP PM interface */
-int omap_device_align_pm_lat(struct platform_device *pdev,
- u32 new_wakeup_lat_limit);
-struct powerdomain *omap_device_get_pwrdm(struct omap_device *od);
int omap_device_get_context_loss_count(struct platform_device *pdev);
/* Other */
@@ -124,40 +95,6 @@ int omap_device_assert_hardreset(struct platform_device *pdev,
const char *name);
int omap_device_deassert_hardreset(struct platform_device *pdev,
const char *name);
-int omap_device_idle_hwmods(struct omap_device *od);
-int omap_device_enable_hwmods(struct omap_device *od);
-
-int omap_device_disable_clocks(struct omap_device *od);
-int omap_device_enable_clocks(struct omap_device *od);
-
-/*
- * Entries should be kept in latency order ascending
- *
- * deact_lat is the maximum number of microseconds required to complete
- * deactivate_func() at the device's slowest OPP.
- *
- * act_lat is the maximum number of microseconds required to complete
- * activate_func() at the device's slowest OPP.
- *
- * This will result in some suboptimal power management decisions at fast
- * OPPs, but avoids having to recompute all device power management decisions
- * if the system shifts from a fast OPP to a slow OPP (in order to meet
- * latency requirements).
- *
- * XXX should deactivate_func/activate_func() take platform_device pointers
- * rather than omap_device pointers?
- */
-struct omap_device_pm_latency {
- u32 deactivate_lat;
- u32 deactivate_lat_worst;
- int (*deactivate_func)(struct omap_device *od);
- u32 activate_lat;
- u32 activate_lat_worst;
- int (*activate_func)(struct omap_device *od);
- u32 flags;
-};
-
-#define OMAP_DEVICE_LATENCY_AUTO_ADJUST BIT(1)
/* Get omap_device pointer from platform_device pointer */
static inline struct omap_device *to_omap_device(struct platform_device *pdev)
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index f4b3143..9627547 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -32,8 +32,6 @@
#include "pm.h"
#include "twl-common.h"
-static struct omap_device_pm_latency *pm_lats;
-
/*
* omap_pm_suspend: points to a function that does the SoC-specific
* suspend work
@@ -82,7 +80,7 @@ static int __init _init_omap_device(char *name)
__func__, name))
return -ENODEV;
- pdev = omap_device_build(oh->name, 0, oh, NULL, 0, pm_lats, 0, false);
+ pdev = omap_device_build(oh->name, 0, oh, NULL, 0);
if (WARN(IS_ERR(pdev), "%s: could not build omap_device for %s\n",
__func__, name))
return -ENODEV;
diff --git a/arch/arm/mach-omap2/pmu.c b/arch/arm/mach-omap2/pmu.c
index eb78ae7..0ef4d6a 100644
--- a/arch/arm/mach-omap2/pmu.c
+++ b/arch/arm/mach-omap2/pmu.c
@@ -48,8 +48,7 @@ static int __init omap2_init_pmu(unsigned oh_num, char *oh_names[])
}
}
- omap_pmu_dev = omap_device_build_ss(dev_name, -1, oh, oh_num, NULL, 0,
- NULL, 0, 0);
+ omap_pmu_dev = omap_device_build_ss(dev_name, -1, oh, oh_num, NULL, 0);
WARN(IS_ERR(omap_pmu_dev), "Can't build omap_device for %s.\n",
dev_name);
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 04fdbc4..d01c373 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -316,8 +316,7 @@ void __init omap_serial_init_port(struct omap_board_data *bdata,
if (WARN_ON(!oh))
return;
- pdev = omap_device_build(name, uart->num, oh, pdata, pdata_size,
- NULL, 0, false);
+ pdev = omap_device_build(name, uart->num, oh, pdata, pdata_size);
if (IS_ERR(pdev)) {
WARN(1, "Could not build omap_device for %s: %s.\n", name,
oh->name);
diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c
index b9753fe..bb829e0 100644
--- a/arch/arm/mach-omap2/sr_device.c
+++ b/arch/arm/mach-omap2/sr_device.c
@@ -152,8 +152,7 @@ static int __init sr_dev_init(struct omap_hwmod *oh, void *user)
sr_data->enable_on_init = sr_enable_on_init;
- pdev = omap_device_build(name, i, oh, sr_data, sizeof(*sr_data),
- NULL, 0, 0);
+ pdev = omap_device_build(name, i, oh, sr_data, sizeof(*sr_data), 0);
if (IS_ERR(pdev))
pr_warning("%s: Could not build omap_device for %s: %s.\n\n",
__func__, name, oh->name);
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 691aa67..adc9553 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -706,8 +706,7 @@ static int __init omap_timer_init(struct omap_hwmod *oh, void *unused)
pdata->timer_errata = omap_dm_timer_get_errata();
pdata->get_context_loss_count = omap_pm_get_dev_context_loss_count;
- pdev = omap_device_build(name, id, oh, pdata, sizeof(*pdata),
- NULL, 0, 0);
+ pdev = omap_device_build(name, id, oh, pdata, sizeof(*pdata));
if (IS_ERR(pdev)) {
pr_err("%s: Can't build omap_device for %s: %s.\n",
diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c
index 2e44e8a..99f04de 100644
--- a/arch/arm/mach-omap2/usb-host.c
+++ b/arch/arm/mach-omap2/usb-host.c
@@ -42,14 +42,6 @@ static struct usbtll_omap_platform_data usbtll_data;
static struct ehci_hcd_omap_platform_data ehci_data;
static struct ohci_hcd_omap_platform_data ohci_data;
-static struct omap_device_pm_latency omap_uhhtll_latency[] = {
- {
- .deactivate_func = omap_device_idle_hwmods,
- .activate_func = omap_device_enable_hwmods,
- .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
- },
-};
-
/* MUX settings for EHCI pins */
/*
* setup_ehci_io_mux - initialize IO pad mux for USBHOST
@@ -530,9 +522,7 @@ void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
}
pdev = omap_device_build(OMAP_USBTLL_DEVICE, bus_id, tll_hwm,
- &usbtll_data, sizeof(usbtll_data),
- omap_uhhtll_latency,
- ARRAY_SIZE(omap_uhhtll_latency), false);
+ &usbtll_data, sizeof(usbtll_data));
if (IS_ERR(pdev)) {
pr_err("Could not build hwmod device %s\n",
USBHS_TLL_HWMODNAME);
@@ -540,9 +530,7 @@ void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
}
pdev = omap_device_build(OMAP_USBHS_DEVICE, bus_id, uhh_hwm,
- &usbhs_data, sizeof(usbhs_data),
- omap_uhhtll_latency,
- ARRAY_SIZE(omap_uhhtll_latency), false);
+ &usbhs_data, sizeof(usbhs_data));
if (IS_ERR(pdev)) {
pr_err("Could not build hwmod devices %s\n",
USBHS_UHH_HWMODNAME);
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index 7b33b37..8c4de27 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -102,7 +102,7 @@ void __init usb_musb_init(struct omap_musb_board_data *musb_board_data)
return;
pdev = omap_device_build(name, bus_id, oh, &musb_plat,
- sizeof(musb_plat), NULL, 0, false);
+ sizeof(musb_plat));
if (IS_ERR(pdev)) {
pr_err("Could not build omap_device for %s %s\n",
name, oh_name);
diff --git a/arch/arm/mach-omap2/wd_timer.c b/arch/arm/mach-omap2/wd_timer.c
index 7c2b4ed..910243f 100644
--- a/arch/arm/mach-omap2/wd_timer.c
+++ b/arch/arm/mach-omap2/wd_timer.c
@@ -124,8 +124,7 @@ static int __init omap_init_wdt(void)
pdata.read_reset_sources = prm_read_reset_sources;
pdev = omap_device_build(dev_name, id, oh, &pdata,
- sizeof(struct omap_wd_timer_platform_data),
- NULL, 0, 0);
+ sizeof(struct omap_wd_timer_platform_data));
WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s.\n",
dev_name, oh->name);
return 0;
--
1.7.10.4
^ permalink raw reply related
* [PATCH] sdma-imx: Add SDMA firmware for Freescale i.MX SOCs
From: Ben Hutchings @ 2013-01-21 1:38 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1358424987-22312-1-git-send-email-fabio.estevam@freescale.com>
On Thu, 2013-01-17 at 10:16 -0200, Fabio Estevam wrote:
[...]
> --- /dev/null
> +++ b/LICENCE.fsl_firmware
[...]
> +COPYRIGHT. The Software is licensed to you, not sold. Freescale owns
> +the Software, and United States copyright laws and international treaty
> +provisions protect the Software. Therefore, you must treat the Software
> +like any other copyrighted material (e.g. a book or musical
> +recording). You may not use or copy the Software for any other purpose
> +than what is described in this Agreement.
[...]
No purpose is described in this so-called agreement, so I made sure to
delete all copies as requested.
Ben.
--
Ben Hutchings
Q. Which is the greater problem in the world today, ignorance or apathy?
A. I don't know and I couldn't care less.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130121/67084326/attachment.sig>
^ permalink raw reply
* [PATCH] ARM: architected timers: allow dt based discovery using clocksource_of_init
From: Thomas Abraham @ 2013-01-21 1:22 UTC (permalink / raw)
To: linux-arm-kernel
Add an entry in __clksrc_of_table so that ARMv7 architected timer is
discoverable using call to clocksource_of_init.
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
---
arch/arm/kernel/arch_timer.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/arch/arm/kernel/arch_timer.c b/arch/arm/kernel/arch_timer.c
index c8ef207..d21aada 100644
--- a/arch/arm/kernel/arch_timer.c
+++ b/arch/arm/kernel/arch_timer.c
@@ -504,6 +504,9 @@ int __init arch_timer_of_register(void)
return arch_timer_register();
}
+#ifdef CONFIG_CLKSRC_OF
+CLOCKSOURCE_OF_DECLARE(armv7_timer, "arm,armv7-timer", arch_timer_of_register)
+#endif
int __init arch_timer_sched_clock_init(void)
{
--
1.7.5.4
^ permalink raw reply related
* [PATCH] ARM: mach-shmobile: kzm9g: Add command line to reference dts
From: Simon Horman @ 2013-01-21 1:03 UTC (permalink / raw)
To: linux-arm-kernel
This seems to be recommended by arm-soc and is required
for earlyprintk with changes to the kzm9g defconfig that
have been sent upstream.
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
arch/arm/boot/dts/sh73a0-kzm9g-reference.dts | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts b/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
index 588016e..06f52f9 100644
--- a/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
+++ b/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
@@ -18,6 +18,10 @@
model = "KZM-A9-GT";
compatible = "renesas,kzm9g-reference", "renesas,sh73a0";
+ chosen {
+ bootargs = "console=tty0 console=ttySC4,115200 root=/dev/nfs ip=dhcp ignore_loglevel earlyprintk=sh-sci.4,115200";
+ };
+
memory {
device_type = "memory";
reg = <0x41000000 0x1e800000>;
--
1.7.10.4
^ permalink raw reply related
* [PATCH v2 1/2] ARM: shmobile: sh73a0: Use generic irqchip_init()
From: Simon Horman @ 2013-01-21 0:54 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1358493373-28722-1-git-send-email-thierry.reding@avionic-design.de>
On Fri, Jan 18, 2013 at 08:16:12AM +0100, Thierry Reding wrote:
> The asm/hardware/gic.h header does no longer exist and the corresponding
> functionality was moved to linux/irqchip.h and linux/irqchip/arm-gic.h
> respectively. gic_handle_irq() and of_irq_init() are no longer available
> either and have been replaced by irqchip_init().
asm/hardware/gic.h Seems to still exist in Linus's tree.
Could you let me know which tree of which branch I should depend on
in order to apply this change?
>
> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
> ---
> Changes in v2:
> - split off kzm9g board changes into a separate patch
>
> arch/arm/mach-shmobile/intc-sh73a0.c | 9 ++-------
> arch/arm/mach-shmobile/setup-sh73a0.c | 2 --
> 2 files changed, 2 insertions(+), 9 deletions(-)
>
> diff --git a/arch/arm/mach-shmobile/intc-sh73a0.c b/arch/arm/mach-shmobile/intc-sh73a0.c
> index fc7c8da..91faba6 100644
> --- a/arch/arm/mach-shmobile/intc-sh73a0.c
> +++ b/arch/arm/mach-shmobile/intc-sh73a0.c
> @@ -21,9 +21,9 @@
> #include <linux/interrupt.h>
> #include <linux/module.h>
> #include <linux/irq.h>
> -#include <linux/of_irq.h>
> #include <linux/io.h>
> #include <linux/sh_intc.h>
> +#include <linux/irqchip.h>
> #include <linux/irqchip/arm-gic.h>
> #include <mach/intc.h>
> #include <mach/irqs.h>
> @@ -462,14 +462,9 @@ void __init sh73a0_init_irq(void)
> }
>
> #ifdef CONFIG_OF
> -static const struct of_device_id irq_of_match[] __initconst = {
> - { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
> - { },
> -};
> -
> void __init sh73a0_init_irq_dt(void)
> {
> - of_irq_init(irq_of_match);
> + irqchip_init();
> gic_arch_extn.irq_set_wake = sh73a0_set_wake;
> }
> #endif
> diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c
> index abf1eb0..2ecd668 100644
> --- a/arch/arm/mach-shmobile/setup-sh73a0.c
> +++ b/arch/arm/mach-shmobile/setup-sh73a0.c
> @@ -36,7 +36,6 @@
> #include <mach/irqs.h>
> #include <mach/sh73a0.h>
> #include <mach/common.h>
> -#include <asm/hardware/gic.h>
> #include <asm/mach-types.h>
> #include <asm/mach/map.h>
> #include <asm/mach/arch.h>
> @@ -892,7 +891,6 @@ DT_MACHINE_START(SH73A0_DT, "Generic SH73A0 (Flattened Device Tree)")
> .init_early = sh73a0_add_early_devices_dt,
> .nr_irqs = NR_IRQS_LEGACY,
> .init_irq = sh73a0_init_irq_dt,
> - .handle_irq = gic_handle_irq,
> .init_machine = sh73a0_add_standard_devices_dt,
> .init_time = shmobile_timer_init,
> .dt_compat = sh73a0_boards_compat_dt,
> --
> 1.8.1.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply
* shmobile and struct sys_timer removal conflicts
From: Simon Horman @ 2013-01-21 0:39 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20130115004230.GZ7185@verge.net.au>
On Tue, Jan 15, 2013 at 09:42:30AM +0900, Simon Horman wrote:
> On Mon, Jan 14, 2013 at 10:52:37AM -0700, Stephen Warren wrote:
> > Simon,
> >
> > I notice that the following shmobile-related commits in next-20130114
> > add new ARM machine descriptors, but set the .timer field rather than
> > the new .init_time field. I believe the code in these commits won't
> > build in linux-next or Linux 3.9 once it's released:
> >
> > a625586 ARM: mach-shmobile: kzm9g: Reference DT implementation
> > ac0876f ARM: shmobile: armadillo800eva: Reference DT implementation
> > be1fc65 ARM: shmobile: add a reference DT implementation for mackerel
> > 66f1162 ARM: mach-shmobile: sh73a0: Minimal setup using DT
> >
> > In order to solve this problem, you'll need to adjust those changes
> > according to:
> >
> > git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git timer/cleanup
> >
> > (where "adjust" is probably "rebase on top of")
>
> Hi Stephen,
>
> thanks. I'll get this sorted out.
This should be resolved in the next branch of the renesas tree now.
^ permalink raw reply
* [GIT PULL] Renesas ARM-based SoC v3.9
From: Simon Horman @ 2013-01-21 0:32 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20130116063750.GA11765@verge.net.au>
On Wed, Jan 16, 2013 at 03:37:53PM +0900, Simon Horman wrote:
> Hi Olof, Hi Arnd,
>
> I have some complex dependencies for mach-shmobile for v3.9
> and as such I am sending this email outline the dependencies
> of branches on each other. I have also included the multiple
> pull requests below though I am happy to post them
> individually including the patches they comprise if you
> have no objections to the way the branch dependencies are arranged.
>
> I would also be happy to supply a single branch with all changes
> with or without merge commits.
>
> All branches are present in the renesas tree
> git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git
Ping.
> 1. Branch: sh-soc
> Description: Pre-requisites for pfc changes for SH SoCs
> Based on: v3.8-rc1
>
> 2. Branch: clocksource
> Description: Pre-requisite clocksource change for soc branch
> Based on: v3.8-rc1
>
> 3. Branch: pfc
> Description: PFC Updates
> Based on: sh-soc
>
> 4. Branch: sh-soc2
> Description: Further PFC changes for SH SoCs
> Based on: pfc
>
> 5. Branch: soc
> Description: shmobile (ARM) SoCs updates, including PFC changes.
> Based on: a merge of clocksource and pfc
>
> 6. Branch: boards
> Description: Board changes, including PFC changes.
> Based on: A merge of timer/cleanup (present in the arm-soc tree) and soc
>
> 7. Branch: pfc2
> Description: Further PFC changes which depend on SoC changes
> Based on: A merge of sh-soc2 and soc
>
> 8. Branch: sh-soc3
> Description: Further PFC changes for SH SoCs
> Based on: pfc2
>
> 9. Branch: soc2
> Description: Further PFC changes for shmobile (ARM) SoCs
> Based on: A merge of timer/cleanup (present in the arm-soc tree) and pfc2
>
> 10. Branch: pfc3
> Description: Description: Further PFC changes which depend on SoC changes
> Based on: A merge of sh-soc3 and soc2
>
> And now to the pull-requests:
>
> ================================================================
> 1.
>
> The following changes since commit a49f0d1ea3ec94fc7cf33a7c36a16343b74bd565:
>
> Linux 3.8-rc1 (2012-12-21 17:19:00 -0800)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git sh-soc
>
> for you to fetch changes up to 2cbf52318a995c09de88dc7c3067d387d7d9ffe8:
>
> sh: shx3: Fix last GPIO index (2013-01-07 14:44:46 +0900)
>
> ----------------------------------------------------------------
> Laurent Pinchart (7):
> sh: sh7264: Rename CRX0CRX1 mark to match GPIO names
> sh: sh7269: Rename CRX0CRX1(CRX2) marks to match GPIO names
> sh: sh7723: Rename GPIO_FN_SIUOSPD to GPIO_FN_SIUAOSPD
> sh: sh7757: Fix GPIO_FN_ET0_MDIO and GPIO_FN_ET1_MDIO GPIO entries
> sh: sh7786: Fix port E, G and J GPIOs
> sh: sh7786: Fix last GPIO index
> sh: shx3: Fix last GPIO index
>
> arch/sh/include/cpu-sh4/cpu/sh7723.h | 2 +-
> arch/sh/include/cpu-sh4/cpu/sh7786.h | 8 +++-----
> arch/sh/kernel/cpu/sh2a/pinmux-sh7264.c | 6 +++---
> arch/sh/kernel/cpu/sh2a/pinmux-sh7269.c | 12 ++++++------
> arch/sh/kernel/cpu/sh4a/pinmux-sh7723.c | 2 +-
> arch/sh/kernel/cpu/sh4a/pinmux-sh7757.c | 4 ++--
> arch/sh/kernel/cpu/sh4a/pinmux-sh7786.c | 6 +++---
> arch/sh/kernel/cpu/sh4a/pinmux-shx3.c | 2 +-
> 8 files changed, 20 insertions(+), 22 deletions(-)
>
> ================================================================
> 2.
>
> The following changes since commit a49f0d1ea3ec94fc7cf33a7c36a16343b74bd565:
>
> Linux 3.8-rc1 (2012-12-21 17:19:00 -0800)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git clocksource
>
> for you to fetch changes up to 892a45dbe32eb565c07d08085e694985e6fbaf26:
>
> ARM: clocksource: Initialise early (2013-01-16 14:55:11 +0900)
>
> ----------------------------------------------------------------
> Simon Horman (1):
> ARM: clocksource: Initialise early
>
> drivers/Makefile | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> ================================================================
> 3.
>
> The following changes since commit 2cbf52318a995c09de88dc7c3067d387d7d9ffe8:
>
> sh: shx3: Fix last GPIO index (2013-01-07 14:44:46 +0900)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git pfc
>
> for you to fetch changes up to 3951da29e5981e3441fdd79a9363fd1af739374b:
>
> sh-pfc: Support passing resources through platform device (2013-01-07 14:47:55 +0900)
>
> ----------------------------------------------------------------
> Laurent Pinchart (14):
> sh-pfc: Remove all use of __devinit/__devexit
> sh-pfc: Split platform data from the sh_pfc structure
> sh-pfc: Move private definitions and declarations to private header
> sh-pfc: Merge PFC core and pinctrl
> sh-pfc: Merge PFC core and gpio
> sh-pfc: Move platform device and driver to the core
> sh-pfc: Use devm_kzalloc()
> sh-pfc: Use devm_ioremap_nocache()
> sh-pfc: Let the compiler decide whether to inline functions
> sh-pfc: Remove check for impossible error condition
> sh-pfc: Sort headers alphabetically
> sh-pfc: Use sh_pfc_ namespace prefix through the whole driver
> sh-pfc: Split platform device and platform driver registration
> sh-pfc: Support passing resources through platform device
>
> drivers/sh/pfc/Kconfig | 12 +-
> drivers/sh/pfc/Makefile | 8 +-
> drivers/sh/pfc/core.c | 327 +++++++++++++++++++++++++---------------------
> drivers/sh/pfc/core.h | 54 ++++++++
> drivers/sh/pfc/gpio.c | 113 ++++------------
> drivers/sh/pfc/pinctrl.c | 171 ++++++++----------------
> include/linux/sh_pfc.h | 35 +----
> 7 files changed, 326 insertions(+), 394 deletions(-)
> create mode 100644 drivers/sh/pfc/core.h
>
> ================================================================
> 4.
>
> The following changes since commit 3951da29e5981e3441fdd79a9363fd1af739374b:
>
> sh-pfc: Support passing resources through platform device (2013-01-07 14:47:55 +0900)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git sh-soc2
>
> for you to fetch changes up to 85a76791fa8c2f1e5467557c52fcbfaff90db586:
>
> sh: shx3: Register PFC platform device (2013-01-07 14:50:54 +0900)
>
> ----------------------------------------------------------------
> Laurent Pinchart (13):
> sh: Add PFC platform device registration helper function
> sh: sh7203: Register PFC platform device
> sh: sh7264: Register PFC platform device
> sh: sh7269: Register PFC platform device
> sh: sh7720: Register PFC platform device
> sh: sh7722: Register PFC platform device
> sh: sh7723: Register PFC platform device
> sh: sh7724: Register PFC platform device
> sh: sh7734: Register PFC platform device
> sh: sh7757: Register PFC platform device
> sh: sh7785: Register PFC platform device
> sh: sh7786: Register PFC platform device
> sh: shx3: Register PFC platform device
>
> arch/sh/Kconfig | 12 +++++++++
> arch/sh/include/cpu-common/cpu/pfc.h | 30 +++++++++++++++++++++
> arch/sh/kernel/cpu/Makefile | 2 +-
> arch/sh/kernel/cpu/pfc.c | 44 +++++++++++++++++++++++++++++++
> arch/sh/kernel/cpu/sh2a/pinmux-sh7203.c | 3 ++-
> arch/sh/kernel/cpu/sh2a/pinmux-sh7264.c | 3 ++-
> arch/sh/kernel/cpu/sh2a/pinmux-sh7269.c | 3 ++-
> arch/sh/kernel/cpu/sh3/pinmux-sh7720.c | 3 ++-
> arch/sh/kernel/cpu/sh4a/pinmux-sh7722.c | 3 ++-
> arch/sh/kernel/cpu/sh4a/pinmux-sh7723.c | 3 ++-
> arch/sh/kernel/cpu/sh4a/pinmux-sh7724.c | 3 ++-
> arch/sh/kernel/cpu/sh4a/pinmux-sh7734.c | 8 +++---
> arch/sh/kernel/cpu/sh4a/pinmux-sh7757.c | 3 ++-
> arch/sh/kernel/cpu/sh4a/pinmux-sh7785.c | 3 ++-
> arch/sh/kernel/cpu/sh4a/pinmux-sh7786.c | 3 ++-
> arch/sh/kernel/cpu/sh4a/pinmux-shx3.c | 3 ++-
> 16 files changed, 113 insertions(+), 16 deletions(-)
> create mode 100644 arch/sh/include/cpu-common/cpu/pfc.h
> create mode 100644 arch/sh/kernel/cpu/pfc.c
>
> ================================================================
> 5.
>
> The following changes since commit 3951da29e5981e3441fdd79a9363fd1af739374b:
>
> sh-pfc: Support passing resources through platform device (2013-01-07 14:47:55 +0900)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git soc
>
> for you to fetch changes up to 54689817eb3476be410b42a9ce2bff82037b4334:
>
> ARM: SH-Mobile: sh73a0: Add CPU Hotplug (2013-01-16 14:16:25 +0900)
>
> ----------------------------------------------------------------
> Bastian Hecht (4):
> ARM: shmobile: sh73a0: Add CPU sleep suspend
> ARM: shmobile: r8a7740: Add CPU sleep suspend
> ARM: SH-Mobile: sh73a0: Secondary CPUs handle own SCU flags
> ARM: SH-Mobile: sh73a0: Add CPU Hotplug
>
> Guennadi Liakhovetski (3):
> ARM: sh7372: add clock lookup entries for DT-based devices
> ARM: sh7372: fix cache clean / invalidate order
> ARM: shmobile: add function declarations for sh7372 DT helper functions
>
> Kuninori Morimoto (2):
> ARM: shmobile: r8a7740: add TMU timer support
> ARM: shmobile: sh73a0: fixup div4_clks bitmap
>
> Laurent Pinchart (8):
> ARM: shmobile: Select PINCTRL
> ARM: shmobile: r8a7740: Register PFC platform device
> ARM: shmobile: r8a7779: Register PFC platform device
> ARM: shmobile: sh7372: Register PFC platform device
> ARM: shmobile: sh73a0: Register PFC platform device
> ARM: shmobile: r8a7740: Add pin control resources
> ARM: shmobile: sh7372: Add pin control resources
> ARM: shmobile: sh73a0: Add pin control resources
>
> Magnus Damm (1):
> ARM: mach-shmobile: sh73a0 external IRQ wake update
>
> Simon Horman (4):
> ARM: shmobile: Remove duplicate inclusion of dma-mapping.h in setup-r8a7740.c
> ARM: mach-shmobile: sh73a0: Allow initialisation of GIC by DT
> ARM: mach-shmobile: sh73a0: Minimal setup using DT
> ARM: mach-shmobile: sh73a0: Initialise MMCIF using DT
>
> arch/arm/Kconfig | 1 +
> arch/arm/boot/dts/sh73a0-reference.dtsi | 24 ++++++
> arch/arm/boot/dts/sh73a0.dtsi | 93 +++++++++++++++++++++++
> arch/arm/mach-shmobile/Makefile | 3 +-
> arch/arm/mach-shmobile/board-armadillo800eva.c | 2 +
> arch/arm/mach-shmobile/board-kzm9g.c | 2 +
> arch/arm/mach-shmobile/clock-r8a7740.c | 6 +-
> arch/arm/mach-shmobile/clock-sh7372.c | 9 +++
> arch/arm/mach-shmobile/clock-sh73a0.c | 35 ++++++---
> arch/arm/mach-shmobile/headsmp-sh73a0.S | 50 +++++++++++++
> arch/arm/mach-shmobile/include/mach/common.h | 8 ++
> arch/arm/mach-shmobile/intc-sh73a0.c | 21 ++++--
> arch/arm/mach-shmobile/pfc-r8a7740.c | 28 ++++++-
> arch/arm/mach-shmobile/pfc-r8a7779.c | 16 +++-
> arch/arm/mach-shmobile/pfc-sh7372.c | 28 ++++++-
> arch/arm/mach-shmobile/pfc-sh73a0.c | 28 ++++++-
> arch/arm/mach-shmobile/pm-r8a7740.c | 22 ++++++
> arch/arm/mach-shmobile/pm-sh73a0.c | 32 ++++++++
> arch/arm/mach-shmobile/setup-r8a7740.c | 95 +++++++++++++++++++++++-
> arch/arm/mach-shmobile/setup-sh73a0.c | 64 +++++++++++++++-
> arch/arm/mach-shmobile/sleep-sh7372.S | 12 +--
> arch/arm/mach-shmobile/smp-sh73a0.c | 66 ++++++++--------
> 22 files changed, 580 insertions(+), 65 deletions(-)
> create mode 100644 arch/arm/boot/dts/sh73a0-reference.dtsi
> create mode 100644 arch/arm/boot/dts/sh73a0.dtsi
> create mode 100644 arch/arm/mach-shmobile/headsmp-sh73a0.S
> create mode 100644 arch/arm/mach-shmobile/pm-sh73a0.c
>
> ================================================================
> 6.
>
> The following changes since commit b7e481b082bf48707020bef270aa726b96d7b4be:
>
> Merge branches 'soc' and 'clocksource', remote-tracking branch 'arm-soc/timer/cleanup' into boards (2013-01-16 15:27:26 +0900)
>
> are available in the git repository at:
>
>
> git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git boards
>
> for you to fetch changes up to 2b88c35a7ddd49301eb73a4660e012bba61a3504:
>
> ARM: mach-shmobile: kzm9g: Reference DT implementation (2013-01-16 15:27:41 +0900)
>
> ----------------------------------------------------------------
> Guennadi Liakhovetski (1):
> ARM: mackerel: include the correct .dtsi file
>
> Kuninori Morimoto (3):
> ARM: shmobile: fix sample amixer settings for mackerel
> ARM: shmobile: add sample amixer settings for ap4evb
> ARM: shmobile: add sample amixer settings for armadillo800eva
>
> Laurent Pinchart (2):
> ARM: shmobile: kzm9g: Use of_machine_is_compatible()
> ARM: shmobile: Include sh73a0 DTSI in kzm9g
>
> Nobuhiro Iwamatsu (1):
> ARM: shmobile: Include DTSI of r8a7740 to armadillo800eva
>
> Simon Horman (1):
> ARM: mach-shmobile: kzm9g: Reference DT implementation
>
> arch/arm/boot/dts/Makefile | 1 +
> arch/arm/boot/dts/r8a7740-armadillo800eva.dts | 2 +-
> arch/arm/boot/dts/sh7372-mackerel.dts | 2 +-
> arch/arm/boot/dts/sh73a0-kzm9g-reference.dts | 37 +++++++++
> arch/arm/boot/dts/sh73a0-kzm9g.dts | 2 +-
> arch/arm/mach-shmobile/Kconfig | 10 +++
> arch/arm/mach-shmobile/Makefile | 1 +
> arch/arm/mach-shmobile/board-ap4evb.c | 4 +
> arch/arm/mach-shmobile/board-armadillo800eva.c | 8 ++
> arch/arm/mach-shmobile/board-kzm9g-reference.c | 99 ++++++++++++++++++++++++
> arch/arm/mach-shmobile/board-kzm9g.c | 2 +-
> arch/arm/mach-shmobile/board-mackerel.c | 4 +-
> 12 files changed, 165 insertions(+), 7 deletions(-)
> create mode 100644 arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
> create mode 100644 arch/arm/mach-shmobile/board-kzm9g-reference.c
>
> ================================================================
> 7.
>
> The following changes since commit e35442480c27092fd7c5ecd987a225bab448d031:
>
> Merge branches 'soc' and 'sh-soc2' into pfc2 (2013-01-16 14:33:26 +0900)
>
> are available in the git repository at:
>
>
> git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git pfc2
>
> for you to fetch changes up to 5800cb822fbda9378fd8eb8cfd19369b5833bd34:
>
> sh-pfc: Add shx3 pinmux support (2013-01-16 14:34:00 +0900)
>
> ----------------------------------------------------------------
> Laurent Pinchart (20):
> sh-pfc: Remove platform device registration
> sh-pfc: Remove unused resource and num_resources platform data fields
> sh-pfc: Move driver from drivers/sh/ to drivers/pinctrl/
> sh-pfc: Support pinmux info in driver data instead of platform data
> sh-pfc: Add r8a7740 pinmux support
> sh-pfc: Add r8a7779 pinmux support
> sh-pfc: Add sh7372 pinmux support
> sh-pfc: Add sh73a0 pinmux support
> sh-pfc: Add sh7203 pinmux support
> sh-pfc: Add sh7264 pinmux support
> sh-pfc: Add sh7269 pinmux support
> sh-pfc: Add sh7720 pinmux support
> sh-pfc: Add sh7722 pinmux support
> sh-pfc: Add sh7723 pinmux support
> sh-pfc: Add sh7724 pinmux support
> sh-pfc: Add sh7734 pinmux support
> sh-pfc: Add sh7757 pinmux support
> sh-pfc: Add sh7785 pinmux support
> sh-pfc: Add sh7786 pinmux support
> sh-pfc: Add shx3 pinmux support
>
> drivers/pinctrl/Kconfig | 2 +-
> drivers/pinctrl/Makefile | 2 +
> drivers/pinctrl/sh-pfc/Kconfig | 116 ++
> drivers/pinctrl/sh-pfc/Makefile | 21 +
> drivers/{sh/pfc => pinctrl/sh-pfc}/core.c | 129 +-
> drivers/{sh/pfc => pinctrl/sh-pfc}/core.h | 19 +-
> drivers/{sh/pfc => pinctrl/sh-pfc}/gpio.c | 18 +-
> drivers/pinctrl/sh-pfc/pfc-r8a7740.c | 2611 ++++++++++++++++++++++++
> drivers/pinctrl/sh-pfc/pfc-r8a7779.c | 2623 ++++++++++++++++++++++++
> drivers/pinctrl/sh-pfc/pfc-sh7203.c | 1591 +++++++++++++++
> drivers/pinctrl/sh-pfc/pfc-sh7264.c | 2130 +++++++++++++++++++
> drivers/pinctrl/sh-pfc/pfc-sh7269.c | 2833 ++++++++++++++++++++++++++
> drivers/pinctrl/sh-pfc/pfc-sh7372.c | 1657 +++++++++++++++
> drivers/pinctrl/sh-pfc/pfc-sh73a0.c | 2797 +++++++++++++++++++++++++
> drivers/pinctrl/sh-pfc/pfc-sh7720.c | 1235 +++++++++++
> drivers/pinctrl/sh-pfc/pfc-sh7722.c | 1778 ++++++++++++++++
> drivers/pinctrl/sh-pfc/pfc-sh7723.c | 1902 +++++++++++++++++
> drivers/pinctrl/sh-pfc/pfc-sh7724.c | 2224 ++++++++++++++++++++
> drivers/pinctrl/sh-pfc/pfc-sh7734.c | 2474 ++++++++++++++++++++++
> drivers/pinctrl/sh-pfc/pfc-sh7757.c | 2281 +++++++++++++++++++++
> drivers/pinctrl/sh-pfc/pfc-sh7785.c | 1303 ++++++++++++
> drivers/pinctrl/sh-pfc/pfc-sh7786.c | 836 ++++++++
> drivers/pinctrl/sh-pfc/pfc-shx3.c | 581 ++++++
> drivers/{sh/pfc => pinctrl/sh-pfc}/pinctrl.c | 28 +-
> drivers/sh/Kconfig | 1 -
> drivers/sh/Makefile | 1 -
> drivers/sh/pfc/Kconfig | 18 -
> drivers/sh/pfc/Makefile | 5 -
> include/linux/sh_pfc.h | 17 +-
> 29 files changed, 31118 insertions(+), 115 deletions(-)
> create mode 100644 drivers/pinctrl/sh-pfc/Kconfig
> create mode 100644 drivers/pinctrl/sh-pfc/Makefile
> rename drivers/{sh/pfc => pinctrl/sh-pfc}/core.c (79%)
> rename drivers/{sh/pfc => pinctrl/sh-pfc}/core.h (63%)
> rename drivers/{sh/pfc => pinctrl/sh-pfc}/gpio.c (89%)
> create mode 100644 drivers/pinctrl/sh-pfc/pfc-r8a7740.c
> create mode 100644 drivers/pinctrl/sh-pfc/pfc-r8a7779.c
> create mode 100644 drivers/pinctrl/sh-pfc/pfc-sh7203.c
> create mode 100644 drivers/pinctrl/sh-pfc/pfc-sh7264.c
> create mode 100644 drivers/pinctrl/sh-pfc/pfc-sh7269.c
> create mode 100644 drivers/pinctrl/sh-pfc/pfc-sh7372.c
> create mode 100644 drivers/pinctrl/sh-pfc/pfc-sh73a0.c
> create mode 100644 drivers/pinctrl/sh-pfc/pfc-sh7720.c
> create mode 100644 drivers/pinctrl/sh-pfc/pfc-sh7722.c
> create mode 100644 drivers/pinctrl/sh-pfc/pfc-sh7723.c
> create mode 100644 drivers/pinctrl/sh-pfc/pfc-sh7724.c
> create mode 100644 drivers/pinctrl/sh-pfc/pfc-sh7734.c
> create mode 100644 drivers/pinctrl/sh-pfc/pfc-sh7757.c
> create mode 100644 drivers/pinctrl/sh-pfc/pfc-sh7785.c
> create mode 100644 drivers/pinctrl/sh-pfc/pfc-sh7786.c
> create mode 100644 drivers/pinctrl/sh-pfc/pfc-shx3.c
> rename drivers/{sh/pfc => pinctrl/sh-pfc}/pinctrl.c (93%)
> delete mode 100644 drivers/sh/pfc/Kconfig
> delete mode 100644 drivers/sh/pfc/Makefile
>
> ================================================================
> 8.
>
> The following changes since commit 5800cb822fbda9378fd8eb8cfd19369b5833bd34:
>
> sh-pfc: Add shx3 pinmux support (2013-01-16 14:34:00 +0900)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git sh-soc3
>
> for you to fetch changes up to 09b276b8c3a590839d3dd199c7116ff5f8fe36e6:
>
> sh: shx3: pinmux: Use driver-provided pinmux info (2013-01-16 14:42:19 +0900)
>
> ----------------------------------------------------------------
> Laurent Pinchart (12):
> sh: sh7203: pinmux: Use driver-provided pinmux info
> sh: sh7264: pinmux: Use driver-provided pinmux info
> sh: sh7269: pinmux: Use driver-provided pinmux info
> sh: sh7720: pinmux: Use driver-provided pinmux info
> sh: sh7722: pinmux: Use driver-provided pinmux info
> sh: sh7723: pinmux: Use driver-provided pinmux info
> sh: sh7724: pinmux: Use driver-provided pinmux info
> sh: sh7734: pinmux: Use driver-provided pinmux info
> sh: sh7757: pinmux: Use driver-provided pinmux info
> sh: sh7785: pinmux: Use driver-provided pinmux info
> sh: sh7786: pinmux: Use driver-provided pinmux info
> sh: shx3: pinmux: Use driver-provided pinmux info
>
> arch/sh/kernel/cpu/sh2a/pinmux-sh7203.c | 1581 +----------------
> arch/sh/kernel/cpu/sh2a/pinmux-sh7264.c | 2120 +----------------------
> arch/sh/kernel/cpu/sh2a/pinmux-sh7269.c | 2822 +------------------------------
> arch/sh/kernel/cpu/sh3/pinmux-sh7720.c | 1225 +-------------
> arch/sh/kernel/cpu/sh4a/pinmux-sh7722.c | 1777 +------------------
> arch/sh/kernel/cpu/sh4a/pinmux-sh7723.c | 1892 +--------------------
> arch/sh/kernel/cpu/sh4a/pinmux-sh7724.c | 2209 +-----------------------
> arch/sh/kernel/cpu/sh4a/pinmux-sh7734.c | 2468 +--------------------------
> arch/sh/kernel/cpu/sh4a/pinmux-sh7757.c | 2266 +------------------------
> arch/sh/kernel/cpu/sh4a/pinmux-sh7785.c | 1293 +-------------
> arch/sh/kernel/cpu/sh4a/pinmux-sh7786.c | 821 +--------
> arch/sh/kernel/cpu/sh4a/pinmux-shx3.c | 572 +------
> 12 files changed, 14 insertions(+), 21032 deletions(-)
>
> ================================================================
> 9.
>
> The following changes since commit c1857e7b2da094b23db24e0829565264d3ba888d:
>
> Merge branch 'pfc2', remote-tracking branch 'arm-soc/timer/cleanup' into soc2 (2013-01-16 14:35:00 +0900)
>
> are available in the git repository at:
>
>
> git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git soc2
>
> for you to fetch changes up to ed68adfe853db33aad6a294702396736ba220af6:
>
> ARM: shmobile: sh73a0: Use driver-provided pinmux info (2013-01-16 14:38:47 +0900)
>
> ----------------------------------------------------------------
> Laurent Pinchart (4):
> ARM: shmobile: r8a7740: Use driver-provided pinmux info
> ARM: shmobile: r8a7779: Use driver-provided pinmux info
> ARM: shmobile: sh7372: Use driver-provided pinmux info
> ARM: shmobile: sh73a0: Use driver-provided pinmux info
>
> arch/arm/mach-shmobile/Makefile | 8 -
> arch/arm/mach-shmobile/pfc-r8a7740.c | 2643 -----------------------------
> arch/arm/mach-shmobile/pfc-r8a7779.c | 2653 ------------------------------
> arch/arm/mach-shmobile/pfc-sh7372.c | 1689 -------------------
> arch/arm/mach-shmobile/pfc-sh73a0.c | 2829 --------------------------------
> arch/arm/mach-shmobile/setup-r8a7740.c | 26 +
> arch/arm/mach-shmobile/setup-r8a7779.c | 25 +
> arch/arm/mach-shmobile/setup-sh7372.c | 26 +
> arch/arm/mach-shmobile/setup-sh73a0.c | 25 +
> 9 files changed, 102 insertions(+), 9822 deletions(-)
> delete mode 100644 arch/arm/mach-shmobile/pfc-r8a7740.c
> delete mode 100644 arch/arm/mach-shmobile/pfc-r8a7779.c
> delete mode 100644 arch/arm/mach-shmobile/pfc-sh7372.c
> delete mode 100644 arch/arm/mach-shmobile/pfc-sh73a0.c
>
> ================================================================
> 10.
>
> The following changes since commit 29ef16511e7645caa979b4db432bf30359fd3795:
>
> Merge branches 'soc2' and 'sh-soc3' into pfc3 (2013-01-16 14:42:55 +0900)
>
> are available in the git repository at:
>
>
> git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git pfc3
>
> for you to fetch changes up to 52c59e03952165b9d462f7001095eb5b8808aed6:
>
> sh-pfc: Move sh_pfc.h from include/linux/ to driver directory (2013-01-16 14:43:06 +0900)
>
> ----------------------------------------------------------------
> Laurent Pinchart (3):
> sh: Remove unused sh_pfc_register_info() function
> sh-pfc: Remove pinmux_info definition
> sh-pfc: Move sh_pfc.h from include/linux/ to driver directory
>
> arch/sh/include/asm/gpio.h | 2 +-
> arch/sh/include/cpu-common/cpu/pfc.h | 4 ----
> arch/sh/kernel/cpu/pfc.c | 13 +------------
> drivers/pinctrl/sh-pfc/core.c | 1 -
> drivers/pinctrl/sh-pfc/core.h | 3 ++-
> drivers/pinctrl/sh-pfc/gpio.c | 1 -
> drivers/pinctrl/sh-pfc/pfc-r8a7740.c | 3 ++-
> drivers/pinctrl/sh-pfc/pfc-r8a7779.c | 3 ++-
> drivers/pinctrl/sh-pfc/pfc-sh7203.c | 3 ++-
> drivers/pinctrl/sh-pfc/pfc-sh7264.c | 3 ++-
> drivers/pinctrl/sh-pfc/pfc-sh7269.c | 3 ++-
> drivers/pinctrl/sh-pfc/pfc-sh7372.c | 3 ++-
> drivers/pinctrl/sh-pfc/pfc-sh73a0.c | 3 ++-
> drivers/pinctrl/sh-pfc/pfc-sh7720.c | 3 ++-
> drivers/pinctrl/sh-pfc/pfc-sh7722.c | 3 ++-
> drivers/pinctrl/sh-pfc/pfc-sh7723.c | 3 ++-
> drivers/pinctrl/sh-pfc/pfc-sh7724.c | 3 ++-
> drivers/pinctrl/sh-pfc/pfc-sh7734.c | 3 ++-
> drivers/pinctrl/sh-pfc/pfc-sh7757.c | 3 ++-
> drivers/pinctrl/sh-pfc/pfc-sh7785.c | 3 ++-
> drivers/pinctrl/sh-pfc/pfc-sh7786.c | 3 ++-
> drivers/pinctrl/sh-pfc/pfc-shx3.c | 3 ++-
> drivers/pinctrl/sh-pfc/pinctrl.c | 1 -
> {include/linux => drivers/pinctrl/sh-pfc}/sh_pfc.h | 3 ---
> 24 files changed, 36 insertions(+), 40 deletions(-)
> rename {include/linux => drivers/pinctrl/sh-pfc}/sh_pfc.h (98%)
>
> ================================================================
>
^ permalink raw reply
* [kvmarm] [PATCH v6 02/13] KVM: ARM: Introduce KVM_SET_DEVICE_ADDRESS ioctl
From: Christoffer Dall @ 2013-01-21 0:06 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CANM98qLsWzUS=457y-j_TvwVi4RQxx2rbg7GqWCOKqTo05dR2Q@mail.gmail.com>
On Sun, Jan 20, 2013 at 6:22 PM, Christoffer Dall
<c.dall@virtualopensystems.com> wrote:
> On Thu, Jan 17, 2013 at 12:37 PM, Peter Maydell
> <peter.maydell@linaro.org> wrote:
>> On 16 January 2013 18:00, Christoffer Dall
>> <c.dall@virtualopensystems.com> wrote:
>>> KVM: ARM: Introduce KVM_SET_DEVICE_ADDRESS ioctl
>>
>> Patch subject needs updating with new name of this ioctl
>> (KVM_ARM_SET_DEVICE_ADDR)...
>>
>>> On ARM (and possibly other architectures) some bits are specific to the
>>> model being emulated for the guest and user space needs a way to tell
>>> the kernel about those bits. An example is mmio device base addresses,
>>> where KVM must know the base address for a given device to properly
>>> emulate mmio accesses within a certain address range or directly map a
>>> device with virtualiation extensions into the guest address space.
>>
>> "virtualization", while I'm here.
>>
>>> --- a/arch/arm/include/uapi/asm/kvm.h
>>> +++ b/arch/arm/include/uapi/asm/kvm.h
>>> @@ -65,6 +65,19 @@ struct kvm_regs {
>>> #define KVM_ARM_TARGET_CORTEX_A15 0
>>> #define KVM_ARM_NUM_TARGETS 1
>>>
>>> +/* KVM_SET_DEVICE_ADDRESS ioctl id encoding */
>>> +#define KVM_DEVICE_TYPE_SHIFT 0
>>> +#define KVM_DEVICE_TYPE_MASK (0xffff << KVM_DEVICE_TYPE_SHIFT)
>>> +#define KVM_DEVICE_ID_SHIFT 16
>>> +#define KVM_DEVICE_ID_MASK (0xffff << KVM_DEVICE_ID_SHIFT)
>>
>> ...and this comment and I guess these constant names presumably
>> should have "ARM" in them?
>>
>>> +/* Available with KVM_CAP_SET_DEVICE_ADDR */
>>
>> KVM_CAP_ARM_SET_DEVICE_ADDR.
>>
> right, thanks:
>
> commit 92c7530ddee0d1e1a0b5c3fbd01aa05457812030
> Author: Christoffer Dall <c.dall@virtualopensystems.com>
> Date: Sun Jan 20 18:20:52 2013 -0500
>
> KVM: ARM: Update comments and defines for KVM_ARM_SET_DEVICE_ADDR
>
> Update comments and defines to reflect the name change of
> KVM_SET_DEVICE_ADDRESS to KVM_ARM_SET_DEVICE_ADDR.
>
> Signed-off-by: Christoffer Dall <c.dall@virtualopensystems.com>
>
> diff --git a/arch/arm/include/uapi/asm/kvm.h b/arch/arm/include/uapi/asm/kvm.h
> index 236f528..023bfeb 100644
> --- a/arch/arm/include/uapi/asm/kvm.h
> +++ b/arch/arm/include/uapi/asm/kvm.h
> @@ -65,11 +65,11 @@ struct kvm_regs {
> #define KVM_ARM_TARGET_CORTEX_A15 0
> #define KVM_ARM_NUM_TARGETS 1
>
> -/* KVM_SET_DEVICE_ADDRESS ioctl id encoding */
> -#define KVM_DEVICE_TYPE_SHIFT 0
> -#define KVM_DEVICE_TYPE_MASK (0xffff << KVM_DEVICE_TYPE_SHIFT)
> -#define KVM_DEVICE_ID_SHIFT 16
> -#define KVM_DEVICE_ID_MASK (0xffff << KVM_DEVICE_ID_SHIFT)
> +/* KVM_ARM_SET_DEVICE_ADDR ioctl id encoding */
> +#define KVM_ARM_DEVICE_TYPE_SHIFT 0
> +#define KVM_ARM_DEVICE_TYPE_MASK (0xffff << KVM_ARM_DEVICE_TYPE_SHIFT)
> +#define KVM_ARM_DEVICE_ID_SHIFT 16
> +#define KVM_ARM_DEVICE_ID_MASK (0xffff << KVM_ARM_DEVICE_ID_SHIFT)
>
> /* Supported device IDs */
> #define KVM_ARM_DEVICE_VGIC_V2 0
> diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
> index 9ff7f70..33887e7 100644
> --- a/include/uapi/linux/kvm.h
> +++ b/include/uapi/linux/kvm.h
> @@ -875,7 +875,7 @@ struct kvm_s390_ucas_mapping {
> #define KVM_ALLOCATE_RMA _IOR(KVMIO, 0xa9, struct kvm_allocate_rma)
> /* Available with KVM_CAP_PPC_HTAB_FD */
> #define KVM_PPC_GET_HTAB_FD _IOW(KVMIO, 0xaa, struct kvm_get_htab_fd)
> -/* Available with KVM_CAP_SET_DEVICE_ADDR */
> +/* Available with KVM_CAP_ARM_SET_DEVICE_ADDR */
> #define KVM_ARM_SET_DEVICE_ADDR _IOW(KVMIO, 0xab, struct
> kvm_arm_device_addr)
>
> /*
> --
and this:
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index a67392a..134df21 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -924,8 +924,10 @@ static int kvm_vm_ioctl_set_device_addr(struct kvm *kvm,
{
unsigned long dev_id, type;
- dev_id = (dev_addr->id & KVM_DEVICE_ID_MASK) >> KVM_DEVICE_ID_SHIFT;
- type = (dev_addr->id & KVM_DEVICE_TYPE_MASK) >> KVM_DEVICE_TYPE_SHIFT;
+ dev_id = (dev_addr->id & KVM_ARM_DEVICE_ID_MASK) >>
+ KVM_ARM_DEVICE_ID_SHIFT;
+ type = (dev_addr->id & KVM_ARM_DEVICE_TYPE_MASK) >>
+ KVM_ARM_DEVICE_TYPE_SHIFT;
switch (dev_id) {
case KVM_ARM_DEVICE_VGIC_V2:
--
-Christoffer
^ permalink raw reply related
* [PATCH v6 14/15] KVM: ARM: Power State Coordination Interface implementation
From: Christoffer Dall @ 2013-01-20 23:35 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <50F81EF4.4020507@arm.com>
On Thu, Jan 17, 2013 at 10:55 AM, Marc Zyngier <marc.zyngier@arm.com> wrote:
> On 16/01/13 17:59, Christoffer Dall wrote:
>> From: Marc Zyngier <marc.zyngier@arm.com>
>>
>> Implement the PSCI specification (ARM DEN 0022A) to control
>> virtual CPUs being "powered" on or off.
>>
>> PSCI/KVM is detected using the KVM_CAP_ARM_PSCI capability.
>>
>> A virtual CPU can now be initialized in a "powered off" state,
>> using the KVM_ARM_VCPU_POWER_OFF feature flag.
>>
>> The guest can use either SMC or HVC to execute a PSCI function.
>>
>> Reviewed-by: Will Deacon <will.deacon@arm.com>
>> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>> Signed-off-by: Christoffer Dall <c.dall@virtualopensystems.com>
>
> A few bits went wrong when you reworked this patch. See below.
>
>> ---
>> Documentation/virtual/kvm/api.txt | 4 +
>> arch/arm/include/asm/kvm_emulate.h | 5 ++
>> arch/arm/include/asm/kvm_host.h | 5 +-
>> arch/arm/include/asm/kvm_psci.h | 23 ++++++++
>> arch/arm/include/uapi/asm/kvm.h | 16 +++++
>> arch/arm/kvm/Makefile | 2 -
>> arch/arm/kvm/arm.c | 28 +++++++++-
>> arch/arm/kvm/psci.c | 105 ++++++++++++++++++++++++++++++++++++
>> include/uapi/linux/kvm.h | 1
>> 9 files changed, 184 insertions(+), 5 deletions(-)
>> create mode 100644 arch/arm/include/asm/kvm_psci.h
>> create mode 100644 arch/arm/kvm/psci.c
>>
>> diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
>> index 38066a7a..c25439a 100644
>> --- a/Documentation/virtual/kvm/api.txt
>> +++ b/Documentation/virtual/kvm/api.txt
>> @@ -2185,6 +2185,10 @@ return ENOEXEC for that vcpu.
>> Note that because some registers reflect machine topology, all vcpus
>> should be created before this ioctl is invoked.
>>
>> +Possible features:
>> + - KVM_ARM_VCPU_POWER_OFF: Starts the CPU in a power-off state.
>> + Depends on KVM_CAP_ARM_PSCI.
>> +
>>
>> 4.78 KVM_GET_REG_LIST
>>
>> diff --git a/arch/arm/include/asm/kvm_emulate.h b/arch/arm/include/asm/kvm_emulate.h
>> index 4c1a073..ba07de9 100644
>> --- a/arch/arm/include/asm/kvm_emulate.h
>> +++ b/arch/arm/include/asm/kvm_emulate.h
>> @@ -32,6 +32,11 @@ void kvm_inject_undefined(struct kvm_vcpu *vcpu);
>> void kvm_inject_dabt(struct kvm_vcpu *vcpu, unsigned long addr);
>> void kvm_inject_pabt(struct kvm_vcpu *vcpu, unsigned long addr);
>>
>> +static inline bool vcpu_mode_is_32bit(struct kvm_vcpu *vcpu)
>> +{
>> + return 1;
>> +}
>> +
>> static inline u32 *vcpu_pc(struct kvm_vcpu *vcpu)
>> {
>> return (u32 *)&vcpu->arch.regs.usr_regs.ARM_pc;
>> diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h
>> index e65fc96..c9ba918 100644
>> --- a/arch/arm/include/asm/kvm_host.h
>> +++ b/arch/arm/include/asm/kvm_host.h
>> @@ -30,7 +30,7 @@
>> #define KVM_COALESCED_MMIO_PAGE_OFFSET 1
>> #define KVM_HAVE_ONE_REG
>>
>> -#define KVM_VCPU_MAX_FEATURES 0
>> +#define KVM_VCPU_MAX_FEATURES 1
>>
>> /* We don't currently support large pages. */
>> #define KVM_HPAGE_GFN_SHIFT(x) 0
>> @@ -100,6 +100,9 @@ struct kvm_vcpu_arch {
>> int last_pcpu;
>> cpumask_t require_dcache_flush;
>>
>> + /* Don't run the guest: see copy_current_insn() */
>
> Now that you made this field PSCI-specific, how about rewording the comment?
>
yeah, that would work. And actually it's kind of broken, because if we
sent a paused VCPU a signal and that VCPU is never woken up using the
PSCI call we'll busy spin in the kernel, which is sad :(
This should eventually be moved to the vcpu requests infrastructure,
but I'll send some preparatory patches to the kvm first, so let's fix
it in the right way later on (requires reworking the run loop quite a
bit), and for now simply fix the pause clause, see patch below.
>> + bool pause;
>> +
>> /* IO related fields */
>> struct kvm_decode mmio_decode;
>>
>> diff --git a/arch/arm/include/asm/kvm_psci.h b/arch/arm/include/asm/kvm_psci.h
>> new file mode 100644
>> index 0000000..9a83d98
>> --- /dev/null
>> +++ b/arch/arm/include/asm/kvm_psci.h
>> @@ -0,0 +1,23 @@
>> +/*
>> + * Copyright (C) 2012 - ARM Ltd
>> + * Author: Marc Zyngier <marc.zyngier@arm.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
>> + * published by the Free Software Foundation.
>> + *
>> + * This program is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
>> + * GNU General Public License for more details.
>> + *
>> + * You should have received a copy of the GNU General Public License
>> + * along with this program. If not, see <http://www.gnu.org/licenses/>.
>> + */
>> +
>> +#ifndef __ARM_KVM_PSCI_H__
>> +#define __ARM_KVM_PSCI_H__
>> +
>> +bool kvm_psci_call(struct kvm_vcpu *vcpu);
>> +
>> +#endif /* __ARM_KVM_PSCI_H__ */
>> diff --git a/arch/arm/include/uapi/asm/kvm.h b/arch/arm/include/uapi/asm/kvm.h
>> index bbb6b23..3303ff5 100644
>> --- a/arch/arm/include/uapi/asm/kvm.h
>> +++ b/arch/arm/include/uapi/asm/kvm.h
>> @@ -65,6 +65,8 @@ struct kvm_regs {
>> #define KVM_ARM_TARGET_CORTEX_A15 0
>> #define KVM_ARM_NUM_TARGETS 1
>>
>> +#define KVM_ARM_VCPU_POWER_OFF 0 /* CPU is started in OFF state */
>> +
>> struct kvm_vcpu_init {
>> __u32 target;
>> __u32 features[7];
>> @@ -145,4 +147,18 @@ struct kvm_arch_memory_slot {
>> /* Highest supported SPI, from VGIC_NR_IRQS */
>> #define KVM_ARM_IRQ_GIC_MAX 127
>>
>> +/* PSCI interface */
>> +#define KVM_PSCI_FN_BASE 0x95c1ba5e
>> +#define KVM_PSCI_FN(n) (KVM_PSCI_FN_BASE + (n))
>> +
>> +#define KVM_PSCI_FN_CPU_SUSPEND KVM_PSCI_FN(0)
>> +#define KVM_PSCI_FN_CPU_OFF KVM_PSCI_FN(1)
>> +#define KVM_PSCI_FN_CPU_ON KVM_PSCI_FN(2)
>> +#define KVM_PSCI_FN_MIGRATE KVM_PSCI_FN(3)
>> +
>> +#define KVM_PSCI_RET_SUCCESS 0
>> +#define KVM_PSCI_RET_NI ((unsigned long)-1)
>> +#define KVM_PSCI_RET_INVAL ((unsigned long)-2)
>> +#define KVM_PSCI_RET_DENIED ((unsigned long)-3)
>> +
>> #endif /* __ARM_KVM_H__ */
>> diff --git a/arch/arm/kvm/Makefile b/arch/arm/kvm/Makefile
>> index 1e45cd9..ea27987 100644
>> --- a/arch/arm/kvm/Makefile
>> +++ b/arch/arm/kvm/Makefile
>> @@ -18,4 +18,4 @@ kvm-arm-y = $(addprefix ../../../virt/kvm/, kvm_main.o coalesced_mmio.o)
>>
>> obj-y += kvm-arm.o init.o interrupts.o
>> obj-y += arm.o guest.o mmu.o emulate.o reset.o
>> -obj-y += coproc.o coproc_a15.o mmio.o
>> +obj-y += coproc.o coproc_a15.o mmio.o psci.o
>> diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
>> index 3168b9d..6ff5337 100644
>> --- a/arch/arm/kvm/arm.c
>> +++ b/arch/arm/kvm/arm.c
>> @@ -43,6 +43,7 @@
>> #include <asm/kvm_mmu.h>
>> #include <asm/kvm_emulate.h>
>> #include <asm/kvm_coproc.h>
>> +#include <asm/kvm_psci.h>
>> #include <asm/opcodes.h>
>>
>> #ifdef REQUIRES_VIRT
>> @@ -160,6 +161,7 @@ int kvm_dev_ioctl_check_extension(long ext)
>> case KVM_CAP_SYNC_MMU:
>> case KVM_CAP_DESTROY_MEMORY_REGION_WORKS:
>> case KVM_CAP_ONE_REG:
>> + case KVM_CAP_ARM_PSCI:
>> r = 1;
>> break;
>> case KVM_CAP_COALESCED_MMIO:
>> @@ -443,13 +445,17 @@ static int handle_hvc(struct kvm_vcpu *vcpu, struct kvm_run *run)
>> trace_kvm_hvc(*vcpu_pc(vcpu), *vcpu_reg(vcpu, 0),
>> vcpu->arch.hsr & HSR_HVC_IMM_MASK);
>>
>> + if (kvm_psci_call(vcpu))
>> + return 1;
>> +
>> return 1;
>
> No undef injection if there is no PSCI match?
>
>> }
>>
>> static int handle_smc(struct kvm_vcpu *vcpu, struct kvm_run *run)
>> {
>> - /* We don't support SMC; don't do that. */
>> - kvm_debug("smc: at %08x", *vcpu_pc(vcpu));
>> + if (!kvm_psci_call(vcpu))
>
> Looks like you got the return value backward here.
>
yeah, I missed that call completely.
>> + return 1;
>> +
>> kvm_inject_undefined(vcpu);
>> return 1;
>> }
>
Thanks, see this patch:
diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h
index 751aa86..d1736a5 100644
--- a/arch/arm/include/asm/kvm_host.h
+++ b/arch/arm/include/asm/kvm_host.h
@@ -113,7 +113,7 @@ struct kvm_vcpu_arch {
int last_pcpu;
cpumask_t require_dcache_flush;
- /* Don't run the guest: see copy_current_insn() */
+ /* Don't run the guest on this vcpu */
bool pause;
/* IO related fields */
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index a67392a..2819575 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -502,7 +502,7 @@ static int handle_hvc(struct kvm_vcpu *vcpu,
struct kvm_run *run)
static int handle_smc(struct kvm_vcpu *vcpu, struct kvm_run *run)
{
- if (!kvm_psci_call(vcpu))
+ if (kvm_psci_call(vcpu))
return 1;
kvm_inject_undefined(vcpu);
@@ -667,6 +667,13 @@ static int kvm_vcpu_first_run_init(struct kvm_vcpu *vcpu)
return 0;
}
+static void vcpu_pause(struct kvm_vcpu *vcpu)
+{
+ wait_queue_head_t *wq = kvm_arch_vcpu_wq(vcpu);
+
+ wait_event_interruptible(*wq, !vcpu->arch.pause);
+}
+
/**
* kvm_arch_vcpu_ioctl_run - the main VCPU run function to execute guest code
* @vcpu: The VCPU pointer
@@ -710,6 +717,9 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu,
struct kvm_run *run)
update_vttbr(vcpu->kvm);
+ if (vcpu->arch.pause)
+ vcpu_pause(vcpu);
+
kvm_vgic_flush_hwstate(vcpu);
kvm_timer_flush_hwstate(vcpu);
@@ -737,13 +747,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu
*vcpu, struct kvm_run *run)
kvm_guest_enter();
vcpu->mode = IN_GUEST_MODE;
- smp_mb(); /* set mode before reading vcpu->arch.pause */
- if (unlikely(vcpu->arch.pause)) {
- /* This means ignore, try again. */
- ret = ARM_EXCEPTION_IRQ;
- } else {
- ret = kvm_call_hyp(__kvm_vcpu_run, vcpu);
- }
+ ret = kvm_call_hyp(__kvm_vcpu_run, vcpu);
vcpu->mode = OUTSIDE_GUEST_MODE;
vcpu->arch.last_pcpu = smp_processor_id();
diff --git a/arch/arm/kvm/psci.c b/arch/arm/kvm/psci.c
index 6be3687..d833604 100644
--- a/arch/arm/kvm/psci.c
+++ b/arch/arm/kvm/psci.c
@@ -28,11 +28,7 @@
static void kvm_psci_vcpu_off(struct kvm_vcpu *vcpu)
{
- wait_queue_head_t *wq = kvm_arch_vcpu_wq(vcpu);
-
vcpu->arch.pause = true;
-
- wait_event_interruptible(*wq, !vcpu->arch.pause);
}
static unsigned long kvm_psci_vcpu_on(struct kvm_vcpu *source_vcpu)
--
1.7.9.5
^ permalink raw reply related
* [kvmarm] [PATCH v6 02/13] KVM: ARM: Introduce KVM_SET_DEVICE_ADDRESS ioctl
From: Christoffer Dall @ 2013-01-20 23:22 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAFEAcA9rQABRT7ybfn_BSsykMO+OhoPt6y7RhNkdXyUSr4fhtA@mail.gmail.com>
On Thu, Jan 17, 2013 at 12:37 PM, Peter Maydell
<peter.maydell@linaro.org> wrote:
> On 16 January 2013 18:00, Christoffer Dall
> <c.dall@virtualopensystems.com> wrote:
>> KVM: ARM: Introduce KVM_SET_DEVICE_ADDRESS ioctl
>
> Patch subject needs updating with new name of this ioctl
> (KVM_ARM_SET_DEVICE_ADDR)...
>
>> On ARM (and possibly other architectures) some bits are specific to the
>> model being emulated for the guest and user space needs a way to tell
>> the kernel about those bits. An example is mmio device base addresses,
>> where KVM must know the base address for a given device to properly
>> emulate mmio accesses within a certain address range or directly map a
>> device with virtualiation extensions into the guest address space.
>
> "virtualization", while I'm here.
>
>> --- a/arch/arm/include/uapi/asm/kvm.h
>> +++ b/arch/arm/include/uapi/asm/kvm.h
>> @@ -65,6 +65,19 @@ struct kvm_regs {
>> #define KVM_ARM_TARGET_CORTEX_A15 0
>> #define KVM_ARM_NUM_TARGETS 1
>>
>> +/* KVM_SET_DEVICE_ADDRESS ioctl id encoding */
>> +#define KVM_DEVICE_TYPE_SHIFT 0
>> +#define KVM_DEVICE_TYPE_MASK (0xffff << KVM_DEVICE_TYPE_SHIFT)
>> +#define KVM_DEVICE_ID_SHIFT 16
>> +#define KVM_DEVICE_ID_MASK (0xffff << KVM_DEVICE_ID_SHIFT)
>
> ...and this comment and I guess these constant names presumably
> should have "ARM" in them?
>
>> +/* Available with KVM_CAP_SET_DEVICE_ADDR */
>
> KVM_CAP_ARM_SET_DEVICE_ADDR.
>
right, thanks:
commit 92c7530ddee0d1e1a0b5c3fbd01aa05457812030
Author: Christoffer Dall <c.dall@virtualopensystems.com>
Date: Sun Jan 20 18:20:52 2013 -0500
KVM: ARM: Update comments and defines for KVM_ARM_SET_DEVICE_ADDR
Update comments and defines to reflect the name change of
KVM_SET_DEVICE_ADDRESS to KVM_ARM_SET_DEVICE_ADDR.
Signed-off-by: Christoffer Dall <c.dall@virtualopensystems.com>
diff --git a/arch/arm/include/uapi/asm/kvm.h b/arch/arm/include/uapi/asm/kvm.h
index 236f528..023bfeb 100644
--- a/arch/arm/include/uapi/asm/kvm.h
+++ b/arch/arm/include/uapi/asm/kvm.h
@@ -65,11 +65,11 @@ struct kvm_regs {
#define KVM_ARM_TARGET_CORTEX_A15 0
#define KVM_ARM_NUM_TARGETS 1
-/* KVM_SET_DEVICE_ADDRESS ioctl id encoding */
-#define KVM_DEVICE_TYPE_SHIFT 0
-#define KVM_DEVICE_TYPE_MASK (0xffff << KVM_DEVICE_TYPE_SHIFT)
-#define KVM_DEVICE_ID_SHIFT 16
-#define KVM_DEVICE_ID_MASK (0xffff << KVM_DEVICE_ID_SHIFT)
+/* KVM_ARM_SET_DEVICE_ADDR ioctl id encoding */
+#define KVM_ARM_DEVICE_TYPE_SHIFT 0
+#define KVM_ARM_DEVICE_TYPE_MASK (0xffff << KVM_ARM_DEVICE_TYPE_SHIFT)
+#define KVM_ARM_DEVICE_ID_SHIFT 16
+#define KVM_ARM_DEVICE_ID_MASK (0xffff << KVM_ARM_DEVICE_ID_SHIFT)
/* Supported device IDs */
#define KVM_ARM_DEVICE_VGIC_V2 0
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index 9ff7f70..33887e7 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -875,7 +875,7 @@ struct kvm_s390_ucas_mapping {
#define KVM_ALLOCATE_RMA _IOR(KVMIO, 0xa9, struct kvm_allocate_rma)
/* Available with KVM_CAP_PPC_HTAB_FD */
#define KVM_PPC_GET_HTAB_FD _IOW(KVMIO, 0xaa, struct kvm_get_htab_fd)
-/* Available with KVM_CAP_SET_DEVICE_ADDR */
+/* Available with KVM_CAP_ARM_SET_DEVICE_ADDR */
#define KVM_ARM_SET_DEVICE_ADDR _IOW(KVMIO, 0xab, struct
kvm_arm_device_addr)
/*
--
-Christoffer
^ permalink raw reply related
* [PATCH v6 15/15] KVM: ARM: Add maintainer entry for KVM/ARM
From: Christoffer Dall @ 2013-01-20 22:57 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20130117162632.GK3699@mudshark.cambridge.arm.com>
On Thu, Jan 17, 2013 at 11:26 AM, Will Deacon <will.deacon@arm.com> wrote:
> On Wed, Jan 16, 2013 at 05:59:25PM +0000, Christoffer Dall wrote:
>> Add an entry in the MAINTAINERS file for KVM/ARM.
>>
>> Cc: Russell King <linux@arm.linux.org.uk>
>> Reviewed-by: Will Deacon <will.deacon@arm.com>
>> Signed-off-by: Christoffer Dall <c.dall@virtualopensystems.com>
>> ---
>> MAINTAINERS | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index 915564e..70e5a10 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -4474,6 +4474,14 @@ F: arch/s390/include/asm/kvm*
>> F: arch/s390/kvm/
>> F: drivers/s390/kvm/
>>
>> +KERNEL VIRTUAL MACHINE (KVM) FOR ARM
>> +M: Christoffer Dall <christofferdall@gmail.com>
>> +L: kvmarm at lists.cs.columbia.edu
>> +W: http://http://systems.cs.columbia.edu/projects/kvm-arm
>
> Oops, I missed that this URL has two http:// prefixes.
>
>> +S: Supported
>
> This means that you're paid to look after KVM. If so, using a gmail address
> seems a little odd...
>
>> +F: arch/arm/include/asm/kvm*
>
> uapi?
>
>> +F: arch/arm/kvm/
>
This was obviously flawed.
This is the fix, thanks:
diff --git a/MAINTAINERS b/MAINTAINERS
index 70e5a10..7a6b9fe 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4475,10 +4475,11 @@ F: arch/s390/kvm/
F: drivers/s390/kvm/
KERNEL VIRTUAL MACHINE (KVM) FOR ARM
-M: Christoffer Dall <christofferdall@gmail.com>
+M: Christoffer Dall <cdall@cs.columbia.edu>
L: kvmarm at lists.cs.columbia.edu
-W: http://http://systems.cs.columbia.edu/projects/kvm-arm
-S: Supported
+W: http://systems.cs.columbia.edu/projects/kvm-arm
+S: Maintained
+F: arch/arm/include/uapi/asm/kvm*
F: arch/arm/include/asm/kvm*
F: arch/arm/kvm/
--
^ permalink raw reply related
* [PATCH V4] Add apf51 basic support
From: Laurent Cans @ 2013-01-20 22:55 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Laurent Cans <laurent.cans@gmail.com>
Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@armadeus.com>
---
Differences between v3 and v4
- introduce new file in Documentation directory
- remove useless property in clock node
Differences between v2 and v3
- remove nand device
Differences between v1 and v2
- change board name according project convention
- remove useless compatible properties
- add project copyright
- use device name instead of soc structure for description
- add an entry for the board on documentation
Documentation/devicetree/bindings/arm/armadeus.txt | 6 +++
arch/arm/boot/dts/Makefile | 3 +-
arch/arm/boot/dts/imx51-apf51.dts | 52 ++++++++++++++++++++
arch/arm/boot/dts/imx51.dtsi | 30 +++++++++++
4 files changed, 90 insertions(+), 1 deletion(-)
create mode 100644 Documentation/devicetree/bindings/arm/armadeus.txt
create mode 100644 arch/arm/boot/dts/imx51-apf51.dts
diff --git a/Documentation/devicetree/bindings/arm/armadeus.txt b/Documentation/devicetree/bindings/arm/armadeus.txt
new file mode 100644
index 0000000..9821283
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/armadeus.txt
@@ -0,0 +1,6 @@
+Armadeus i.MX Platforms Device Tree Bindings
+-----------------------------------------------
+
+APF51: i.MX51 based module.
+Required root node properties:
+ - compatible = "armadeus,imx51-apf51", "fsl,imx51";
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 5ebb44f..d89b97f 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -79,7 +79,8 @@ dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \
armada-370-mirabox.dtb \
armada-xp-db.dtb \
armada-xp-openblocks-ax3-4.dtb
-dtb-$(CONFIG_ARCH_MXC) += imx51-babbage.dtb \
+dtb-$(CONFIG_ARCH_MXC) += imx51-apf51.dtb \
+ imx51-babbage.dtb \
imx53-ard.dtb \
imx53-evk.dtb \
imx53-qsb.dtb \
diff --git a/arch/arm/boot/dts/imx51-apf51.dts b/arch/arm/boot/dts/imx51-apf51.dts
new file mode 100644
index 0000000..92d3a66
--- /dev/null
+++ b/arch/arm/boot/dts/imx51-apf51.dts
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2012 Armadeus Systems - <support@armadeus.com>
+ * Copyright 2012 Laurent Cans <laurent.cans@gmail.com>
+ *
+ * Based on mx51-babbage.dts
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ * Copyright 2011 Linaro Ltd.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/dts-v1/;
+/include/ "imx51.dtsi"
+
+/ {
+ model = "Armadeus Systems APF51 module";
+ compatible = "armadeus,imx51-apf51", "fsl,imx51";
+
+ memory {
+ reg = <0x90000000 0x20000000>;
+ };
+
+ clocks {
+ ckih1 {
+ clock-frequency = <0>;
+ };
+
+ osc {
+ clock-frequency = <33554432>;
+ };
+ };
+};
+
+&fec {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_fec_2>;
+ phy-mode = "mii";
+ phy-reset-gpios = <&gpio3 0 0>;
+ phy-reset-duration = <1>;
+ status = "okay";
+};
+
+&uart3 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_uart3_2>;
+ status = "okay";
+};
diff --git a/arch/arm/boot/dts/imx51.dtsi b/arch/arm/boot/dts/imx51.dtsi
index 1f5d45e..8427279 100644
--- a/arch/arm/boot/dts/imx51.dtsi
+++ b/arch/arm/boot/dts/imx51.dtsi
@@ -273,6 +273,29 @@
260 0x80000000 /* MX51_PAD_NANDF_RDY_INT__FEC_TX_CLK */
>;
};
+
+ pinctrl_fec_2: fecgrp-2 {
+ fsl,pins = <
+ 589 0x80000000 /* MX51_PAD_DI_GP3__FEC_TX_ER */
+ 592 0x80000000 /* MX51_PAD_DI2_PIN4__FEC_CRS */
+ 594 0x80000000 /* MX51_PAD_DI2_PIN2__FEC_MDC */
+ 596 0x80000000 /* MX51_PAD_DI2_PIN3__FEC_MDIO */
+ 598 0x80000000 /* MX51_PAD_DI2_DISP_CLK__FEC_RDATA1 */
+ 602 0x80000000 /* MX51_PAD_DI_GP4__FEC_RDATA2 */
+ 604 0x80000000 /* MX51_PAD_DISP2_DAT0__FEC_RDATA3 */
+ 609 0x80000000 /* MX51_PAD_DISP2_DAT1__FEC_RX_ER */
+ 618 0x80000000 /* MX51_PAD_DISP2_DAT6__FEC_TDATA1 */
+ 623 0x80000000 /* MX51_PAD_DISP2_DAT7__FEC_TDATA2 */
+ 628 0x80000000 /* MX51_PAD_DISP2_DAT8__FEC_TDATA3 */
+ 634 0x80000000 /* MX51_PAD_DISP2_DAT9__FEC_TX_EN */
+ 639 0x80000000 /* MX51_PAD_DISP2_DAT10__FEC_COL */
+ 644 0x80000000 /* MX51_PAD_DISP2_DAT11__FEC_RX_CLK */
+ 649 0x80000000 /* MX51_PAD_DISP2_DAT12__FEC_RX_DV */
+ 653 0x80000000 /* MX51_PAD_DISP2_DAT13__FEC_TX_CLK */
+ 657 0x80000000 /* MX51_PAD_DISP2_DAT14__FEC_RDATA0 */
+ 662 0x80000000 /* MX51_PAD_DISP2_DAT15__FEC_TDATA0 */
+ >;
+ };
};
ecspi1 {
@@ -409,6 +432,13 @@
49 0x1c5 /* MX51_PAD_EIM_D24__UART3_CTS */
>;
};
+
+ pinctrl_uart3_2: uart3grp-2 {
+ fsl,pins = <
+ 434 0x1c5 /* MX51_PAD_UART3_RXD__UART3_RXD */
+ 430 0x1c5 /* MX51_PAD_UART3_TXD__UART3_TXD */
+ >;
+ };
};
};
--
1.7.10.4
^ permalink raw reply related
* [PATCH] of: fix incorrect return value of of_find_matching_node_and_match()
From: Thomas Abraham @ 2013-01-20 21:56 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <50FC66BA.9030503@gmail.com>
On 20 January 2013 13:50, Rob Herring <robherring2@gmail.com> wrote:
> On 01/19/2013 12:20 PM, Thomas Abraham wrote:
>> The of_find_matching_node_and_match() function incorrectly sets the matched
>> entry to 'matches' when the compatible value of a node matches one of the
>> possible values. This results in incorrectly selecting the the first entry in
>> the 'matches' list as the matched entry. Fix this by noting down the result of
>> the call to of_match_node() and setting that as the matched entry.
>
> Looks fine, but is this breaking something in 3.8 or can it wait for 3.9?
Yes, it can wait for 3.9. I am using this function while adding device
tree support for timers on exynos platform which will probably merged
in 3.9.
Thanks,
Thomas.
>
> Rob
>
>>
>> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
>> ---
>> drivers/of/base.c | 6 ++++--
>> 1 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/of/base.c b/drivers/of/base.c
>> index 2390ddb..960ae5b 100644
>> --- a/drivers/of/base.c
>> +++ b/drivers/of/base.c
>> @@ -612,6 +612,7 @@ struct device_node *of_find_matching_node_and_match(struct device_node *from,
>> const struct of_device_id **match)
>> {
>> struct device_node *np;
>> + const struct of_device_id *m;
>>
>> if (match)
>> *match = NULL;
>> @@ -619,9 +620,10 @@ struct device_node *of_find_matching_node_and_match(struct device_node *from,
>> read_lock(&devtree_lock);
>> np = from ? from->allnext : of_allnodes;
>> for (; np; np = np->allnext) {
>> - if (of_match_node(matches, np) && of_node_get(np)) {
>> + m = of_match_node(matches, np);
>> + if (m && of_node_get(np)) {
>> if (match)
>> - *match = matches;
>> + *match = m;
>> break;
>> }
>> }
>>
^ permalink raw reply
* [PATCH] of: fix incorrect return value of of_find_matching_node_and_match()
From: Rob Herring @ 2013-01-20 21:50 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1358619642-23607-1-git-send-email-thomas.abraham@linaro.org>
On 01/19/2013 12:20 PM, Thomas Abraham wrote:
> The of_find_matching_node_and_match() function incorrectly sets the matched
> entry to 'matches' when the compatible value of a node matches one of the
> possible values. This results in incorrectly selecting the the first entry in
> the 'matches' list as the matched entry. Fix this by noting down the result of
> the call to of_match_node() and setting that as the matched entry.
Looks fine, but is this breaking something in 3.8 or can it wait for 3.9?
Rob
>
> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
> ---
> drivers/of/base.c | 6 ++++--
> 1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index 2390ddb..960ae5b 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -612,6 +612,7 @@ struct device_node *of_find_matching_node_and_match(struct device_node *from,
> const struct of_device_id **match)
> {
> struct device_node *np;
> + const struct of_device_id *m;
>
> if (match)
> *match = NULL;
> @@ -619,9 +620,10 @@ struct device_node *of_find_matching_node_and_match(struct device_node *from,
> read_lock(&devtree_lock);
> np = from ? from->allnext : of_allnodes;
> for (; np; np = np->allnext) {
> - if (of_match_node(matches, np) && of_node_get(np)) {
> + m = of_match_node(matches, np);
> + if (m && of_node_get(np)) {
> if (match)
> - *match = matches;
> + *match = m;
> break;
> }
> }
>
^ permalink raw reply
* OMAP baseline test results for v3.8-rc4
From: Paul Walmsley @ 2013-01-20 21:38 UTC (permalink / raw)
To: linux-arm-kernel
Here are some basic OMAP test results for Linux v3.8-rc4.
Logs and other details at:
http://www.pwsan.com/omap/testlogs/test_v3.8-rc4/20130120122039/
Test summary
------------
Boot to userspace:
Pass ( 9/11): 2420n800, 2430sdp, 3517evm, 3530es3beagle,
3730beaglexm, 37xxevm, 4430es2panda, 5912osk,
4460pandaes
FAIL ( 2/11): am335xbone, cmt3517
PM ret/off, suspend + dynamic idle:
Pass (3/3): 3530es3beagle, 3730beaglexm, 37xxevm
PM ret, suspend + dynamic idle:
Pass (1/2): 4460pandaes
FAIL (1/2): 4430es2panda
PM ret, dynamic idle:
FAIL (1/1): 2430sdp
Failing tests: fixed by posted patches
--------------------------------------
Other:
* 2420N800: powers down 30 seconds after boot
- Presumably due to missing CBUS patches for watchdog control
- http://lkml.org/lkml/2012/9/3/265
- http://marc.info/?l=linux-omap&m=135274739624125&w=2
- http://marc.info/?l=linux-omap&m=135664195831104&w=2
Failing tests: needing investigation
------------------------------------
Boot tests:
* am335xbone: hangs after "Starting kernel"
- Cause unknown
- http://www.mail-archive.com/linux-omap at vger.kernel.org/msg82297.html
* 3517EVM & CM-T3517: boot hangs with NFS root
- Likely some Kconfig, board file, and PM issues with EMAC
- Longstanding bug
* CM-T3517: boot hangs with MMC root
- Due to missing MMC setup in board file
- http://www.spinics.net/lists/arm-kernel/msg211471.html
Boot warnings:
* 3530es3beagle, 3730beaglexm, 37xxevm: nand_scan_ident() warning
- "at drivers/mtd/nand/nand_base.c:2861 nand_scan_ident+0xdb4/0xf90()"
- http://marc.info/?l=linux-omap&m=135630897110185&w=2
* CM-T3517: L3 in-band error with IPSS during boot
- Cause unknown but see http://marc.info/?l=linux-omap&m=134833869730129&w=2
- Longstanding issue; does not occur on the 3517EVM
PM tests:
* 2430sdp: pwrdm state mismatch(dsp_pwrdm) 0 != 3
- need to doublecheck wakeup dependencies
* 2430sdp: power domains not entering retention
- Cause unknown
* 4430es2panda, 4460pandaes: pwrdm state mismatch on CAM, DSS, ABE
* 4460pandaes: pwrdm state mismatch on IVAHD, TESLA
* 4430es2panda: CORE, TESLA, IVAHD, L3INIT didn't enter target state
- Probably due to lack of reset code for M3, DSP, SL2IF, FSUSB
per discussion with Tero Kristo
- Likely dependent on the bootloader version
- fails with 2012.07-00136-g755de79
* 3730 Beagle XM: does not serial wake from off-idle suspend when console
UART doesn't clock gate ("debug ignore_loglevel")
- Cause unknown
- Not yet part of the automated test suite
- Re-tested at v3.7; still failing:
http://www.pwsan.com/omap/transcripts/20121211-3730beaglexm-3.7-pm-offmode-fail-debug.txt
Other:
* 4430es2panda: omap_hwmod: l3_instr: _wait_target_disable failed
- Unknown cause; could be due to the lack of hierarchical enable/disable
in hwmod code
- Jon Hunter reports this does not appear with the same X-loader/bootloader
on his 4430ES2.3 Panda, so could be ES-level dependent
Failing tests: needing local investigation (may be due to testbed issues)
-------------------------------------------------------------------------
Boot tests:
* AM335x Beaglebone: omap2plus_defconfig kernels don't boot
- May be fixed now, pending retest:
- http://marc.info/?l=linux-omap&m=135082257727502&w=2
- Not yet part of the automated test suite
- Nishanth Menon & Vaibhav Hiremath report that it works for them
* May be due to an old U-boot with FDT support problems used here?
Pending local investigation and re-test
Problems reported by others
---------------------------
* I2C intermittent failures on N900; can break boot
- "omap_i2c omap_i2c.1: timeout waiting for bus ready"
- Reported by Aaro Koskinen
- http://www.spinics.net/lists/arm-kernel/msg216859.html
* 2420H4: reports "Could not set MPU rate to 4294MHz" on reboot
- Reported and fixed by Jon Hunter
- http://www.spinics.net/lists/arm-kernel/msg216121.html
--------------------------------------------------------------
Branch: test_v3.8-rc4
Test-Serial: 20130120122039
Commit-ID: 7d1f9aeff1ee4a20b1aeb377dd0f579fe9647619
Test-Target-Board-Count: 11
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox