From bfdc8c2c65a4f505d30be433c5bb0d79be1ed95d Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Wed, 14 Nov 2007 14:05:35 +0000 Subject: linux-rp: Tosa usb ports management - close #3295 --- packages/linux/linux-rp-2.6.23/tmio-ohci-r8.patch | 135 ++++++++++++++++++++-- packages/linux/linux-rp_2.6.23.bb | 4 +- 2 files changed, 126 insertions(+), 13 deletions(-) diff --git a/packages/linux/linux-rp-2.6.23/tmio-ohci-r8.patch b/packages/linux/linux-rp-2.6.23/tmio-ohci-r8.patch index 034acc7b8e..9b8434a0bc 100644 --- a/packages/linux/linux-rp-2.6.23/tmio-ohci-r8.patch +++ b/packages/linux/linux-rp-2.6.23/tmio-ohci-r8.patch @@ -3,8 +3,8 @@ Signed-off-by: Dmitry Baryshkov Index: linux-2.6.23/drivers/usb/host/ohci-tmio.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.23/drivers/usb/host/ohci-tmio.c 2007-11-13 01:35:13.049455112 +0300 -@@ -0,0 +1,417 @@ ++++ linux-2.6.23/drivers/usb/host/ohci-tmio.c 2007-11-14 16:58:47.637707413 +0300 +@@ -0,0 +1,530 @@ +/* + * OHCI HCD(Host Controller Driver) for USB. + * @@ -53,6 +53,14 @@ Index: linux-2.6.23/drivers/usb/host/ohci-tmio.c + +/*-------------------------------------------------------------------------*/ + ++#define MAX_TMIO_USB_PORTS 2 ++static bool default_tmio_ports[MAX_TMIO_USB_PORTS]; ++module_param_array(default_tmio_ports, bool, NULL, 0644); ++MODULE_PARM_DESC(default_tmio_ports, ++ "disable specified TC6393 usb ports (default: all enabled)"); ++ ++/*-------------------------------------------------------------------------*/ ++ +/* + * USB Host Controller Configuration Register + */ @@ -87,8 +95,8 @@ Index: linux-2.6.23/drivers/usb/host/ohci-tmio.c +struct { + unsigned gcken:1; /* D0 */ + unsigned ckrnen:1; /* D1 */ -+ unsigned uspw1:1; /* D2 USB Port 1 Power Disable */ -+ unsigned uspw2:1; /* D3 USB Port 2 Power Disable */ ++ unsigned uspw0:1; /* D2 USB Port 1 Power Disable */ ++ unsigned uspw1:1; /* D3 USB Port 2 Power Disable */ + unsigned x00:4; + unsigned pmee:1; /* D8 */ + unsigned x01:6; @@ -100,6 +108,7 @@ Index: linux-2.6.23/drivers/usb/host/ohci-tmio.c + +struct tmio_hcd { + struct tmio_uhccr __iomem *ccr; ++ bool disabled_ports[MAX_TMIO_USB_PORTS]; +}; + +#define hcd_to_tmio(hcd) ((struct tmio_hcd *)(hcd_to_ohci(hcd) + 1)) @@ -107,6 +116,39 @@ Index: linux-2.6.23/drivers/usb/host/ohci-tmio.c + +/*-------------------------------------------------------------------------*/ + ++struct indexed_device_attribute{ ++ struct device_attribute dev_attr; ++ int index; ++}; ++#define to_indexed_dev_attr(_dev_attr) \ ++ container_of(_dev_attr, struct indexed_device_attribute, dev_attr) ++ ++#define INDEXED_ATTR(_name, _mode, _show, _store, _index) \ ++ { .dev_attr = __ATTR(_name ## _index, _mode, _show, _store), \ ++ .index = _index } ++ ++#define INDEXED_DEVICE_ATTR(_name, _mode, _show, _store, _index) \ ++struct indexed_device_attribute dev_attr_##_name ## _index \ ++ = INDEXED_ATTR(_name, _mode, _show, _store, _index) ++ ++/*-------------------------------------------------------------------------*/ ++ ++ ++static void tmio_fill_pm(struct tmio_hcd *tmio, union tmio_uhccr_pm *pm) ++{ ++ pm->raw = 0; ++ ++ pm->pmee = 1; ++ pm->pmes = 1; ++ pm->gcken = 1; ++ pm->ckrnen = 1; ++ ++ if (tmio->disabled_ports[0]) ++ pm->uspw0 = 1; ++ if (tmio->disabled_ports[1]) ++ pm->uspw1 = 1; ++} ++ +static void tmio_stop_hc(struct device *dev) +{ + struct tmio_device *tdev = dev_to_tdev(dev); @@ -117,8 +159,8 @@ Index: linux-2.6.23/drivers/usb/host/ohci-tmio.c + + pm.gcken = 1; + pm.ckrnen = 1; ++ pm.uspw0 = 1; + pm.uspw1 = 1; -+ pm.uspw2 = 1; + + iowrite8(0, &ccr->intc); + iowrite8(0, &ccr->ilme); @@ -139,10 +181,7 @@ Index: linux-2.6.23/drivers/usb/host/ohci-tmio.c + union tmio_uhccr_pm pm = {0}; + unsigned long base = hcd->rsrc_start; + -+ pm.pmes = 1; -+ pm.pmee = 1; -+ pm.ckrnen = 1; -+ pm.gcken = 1; ++ tmio_fill_pm(tmio, &pm); + + tdev->ops->clock(dev, 1); + tdev->ops->function(dev, 1); @@ -157,6 +196,54 @@ Index: linux-2.6.23/drivers/usb/host/ohci-tmio.c + ioread8(&ccr->revid), hcd->rsrc_start, hcd->irq); +} + ++static ssize_t tmio_disabled_port_show(struct device *dev, ++ struct device_attribute *attr, ++ char *buf) ++{ ++ struct usb_hcd *hcd = dev_get_drvdata(dev); ++ struct tmio_hcd *tmio = hcd_to_tmio(hcd); ++ int index = to_indexed_dev_attr(attr)->index; ++ return snprintf(buf, PAGE_SIZE, "%c", ++ tmio->disabled_ports[index]? 'Y': 'N'); ++} ++ ++static ssize_t tmio_disabled_port_store(struct device *dev, ++ struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ struct usb_hcd *hcd = dev_get_drvdata(dev); ++ struct tmio_hcd *tmio = hcd_to_tmio(hcd); ++ struct tmio_uhccr __iomem *ccr = tmio->ccr; ++ union tmio_uhccr_pm pm = {0}; ++ int index = to_indexed_dev_attr(attr)->index; ++ ++ if (!count) ++ return -EINVAL; ++ ++ switch (buf[0]) { ++ case 'y': case 'Y': case '1': ++ tmio->disabled_ports[index] = true; ++ break; ++ case 'n': case 'N': case '0': ++ tmio->disabled_ports[index] = false; ++ break; ++ default: ++ return -EINVAL; ++ } ++ ++ tmio_fill_pm(tmio, &pm); ++ ++ iowrite16(pm.raw, &ccr->pm); ++ ++ return 1; ++} ++ ++ ++static INDEXED_DEVICE_ATTR(disabled_usb_port, S_IRUGO | S_IWUSR, ++ tmio_disabled_port_show, tmio_disabled_port_store, 0); ++static INDEXED_DEVICE_ATTR(disabled_usb_port, S_IRUGO | S_IWUSR, ++ tmio_disabled_port_show, tmio_disabled_port_store, 1); ++ +static int usb_hcd_tmio_probe(const struct hc_driver *driver, + struct device *dev) +{ @@ -195,6 +282,9 @@ Index: linux-2.6.23/drivers/usb/host/ohci-tmio.c + hcd->rsrc_len = regs->end - regs->start + 1; + + tmio = hcd_to_tmio(hcd); ++ memcpy(tmio->disabled_ports, ++ default_tmio_ports, ++ sizeof(default_tmio_ports)); + + tmio->ccr = ioremap(config->start, config->end - config->start + 1); + if (!tmio->ccr) { @@ -224,11 +314,23 @@ Index: linux-2.6.23/drivers/usb/host/ohci-tmio.c + ohci = hcd_to_ohci(hcd); + ohci_hcd_init(ohci); + ++ retval = device_create_file(dev, ++ &dev_attr_disabled_usb_port0.dev_attr); ++ retval |= device_create_file(dev, ++ &dev_attr_disabled_usb_port1.dev_attr); ++ ++ if (retval) ++ goto err_create_file; ++ + retval = usb_add_hcd(hcd, irq->start, IRQF_DISABLED); + + if (retval == 0) + return retval; + ++err_create_file: ++ device_remove_file(dev, &dev_attr_disabled_usb_port1.dev_attr); ++ device_remove_file(dev, &dev_attr_disabled_usb_port0.dev_attr); ++ + tmio_stop_hc(dev); + + dmabounce_unregister_dev(dev); @@ -256,6 +358,8 @@ Index: linux-2.6.23/drivers/usb/host/ohci-tmio.c + struct tmio_hcd *tmio = hcd_to_tmio(hcd); + + usb_remove_hcd(hcd); ++ device_remove_file(dev, &dev_attr_disabled_usb_port1.dev_attr); ++ device_remove_file(dev, &dev_attr_disabled_usb_port0.dev_attr); + tmio_stop_hc(dev); + dmabounce_unregister_dev(dev); + dma_release_declared_memory(dev); @@ -343,13 +447,22 @@ Index: linux-2.6.23/drivers/usb/host/ohci-tmio.c +static int ohci_hcd_tmio_drv_probe(struct device *dev) +{ + struct resource *sram = tmio_resource_mem(dev); ++ int retval; + + dev->dma_mask = &dma_mask; + dev->coherent_dma_mask = DMA_32BIT_MASK; + ++ /* FIXME: move dmabounce checkers to tc6393 core? */ + dmabounce_register_checker(tmio_dmabounce_check, sram); + -+ return usb_hcd_tmio_probe(&ohci_tmio_hc_driver, dev); ++ retval = usb_hcd_tmio_probe(&ohci_tmio_hc_driver, dev); ++ ++ if (retval == 0) ++ return retval; ++ ++ dmabounce_remove_checker(tmio_dmabounce_check, sram); ++ ++ return retval; +} + +static int ohci_hcd_tmio_drv_remove(struct device *dev) @@ -437,7 +550,7 @@ Index: linux-2.6.23/drivers/usb/host/Kconfig Index: linux-2.6.23/drivers/usb/host/ohci-hcd.c =================================================================== --- linux-2.6.23.orig/drivers/usb/host/ohci-hcd.c 2007-11-12 13:46:52.894560883 +0300 -+++ linux-2.6.23/drivers/usb/host/ohci-hcd.c 2007-11-13 01:03:53.950798640 +0300 ++++ linux-2.6.23/drivers/usb/host/ohci-hcd.c 2007-11-14 16:44:32.788069355 +0300 @@ -915,6 +915,10 @@ #define PLATFORM_DRIVER usb_hcd_pnx4008_driver #endif diff --git a/packages/linux/linux-rp_2.6.23.bb b/packages/linux/linux-rp_2.6.23.bb index 29a96deb88..141e689c41 100644 --- a/packages/linux/linux-rp_2.6.23.bb +++ b/packages/linux/linux-rp_2.6.23.bb @@ -1,6 +1,6 @@ require linux-rp.inc -PR = "r6" +PR = "r7" DEFAULT_PREFERENCE_qemuarm = "-1" DEFAULT_PREFERENCE_qemux86 = "-1" @@ -120,7 +120,7 @@ SRC_URI_append_tosa = "\ file://tosa-lcdnoise-r1-fix-r0.patch;patch=1 \ file://arm-dma-coherent.patch;patch=1 \ file://usb-ohci-hooks-r3.patch;patch=1 \ - file://tmio-ohci-r8.patch;patch=1 \ + file://tmio-ohci-r9.patch;patch=1 \ " # ${DOSRC}/tosa-asoc-r1.patch;patch=1 " -- cgit v1.2.3 From e22fa8880a2498961912c92e2058dbab6c01f46c Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Wed, 14 Nov 2007 15:12:14 +0000 Subject: openmoko-messages2: add recipe --- packages/openmoko2/openmoko-messages2_svn.bb | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 packages/openmoko2/openmoko-messages2_svn.bb diff --git a/packages/openmoko2/openmoko-messages2_svn.bb b/packages/openmoko2/openmoko-messages2_svn.bb new file mode 100644 index 0000000000..bc1bcaff5e --- /dev/null +++ b/packages/openmoko2/openmoko-messages2_svn.bb @@ -0,0 +1,11 @@ +DESCRIPTION = "The OpenMoko Message application" +SECTION = "openmoko/pim" +DEPENDS = "libmokogsmd2 libmokoui2 libmokojournal2" +PV = "0.1.0+svnr${SRCREV}" +PR = "r0" + +inherit openmoko2 + +EXTRA_OECONF = "--with-dbusbindir=${STAGING_BINDIR_NATIVE}" + +FILES_${PN} += "${datadir}/openmoko-messages/ ${datadir}/dbus-1/services/" -- cgit v1.2.3 From d408f3838dc972908146322f0d9fb85b647b9aa9 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Wed, 14 Nov 2007 15:14:09 +0000 Subject: sane-srcrevs: add openmoko-messages2, bump some other things --- conf/distro/include/sane-srcrevs.inc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/conf/distro/include/sane-srcrevs.inc b/conf/distro/include/sane-srcrevs.inc index 864f6fe178..b5682eb3e9 100644 --- a/conf/distro/include/sane-srcrevs.inc +++ b/conf/distro/include/sane-srcrevs.inc @@ -48,9 +48,9 @@ SRCREV_pn-matchbox-desktop-2 ?= "1778" SRCREV_pn-matchbox-keyboard ?= "1739" SRCREV_pn-matchbox-keyboard-inputmethod ?= "1739" SRCREV_pn-matchbox-panel-2 ?= "1626" -SRCREV_pn-moko-gtk-engine ?= "3207" +SRCREV_pn-moko-gtk-engine ?= "3405" SRCREV_pn-mpd-alsa ?= "6952" -SRCREV_pn-neod ?= "3358" +SRCREV_pn-neod ?= "3421" SRCREV_pn-oh-puzzles ?= "22" SRCREV_pn-osb-browser ?= "125" SRCREV_pn-osb-jscore ?= "117" @@ -81,6 +81,7 @@ SRCREV_pn-openmoko-keyboard ?= "1631" SRCREV_pn-openmoko-libs ?= "2367" SRCREV_pn-openmoko-mediaplayer2 ?= "3300" SRCREV_pn-openmoko-messages ?= "2276" +SRCREV_pn-openmoko-messages2 ?= "3424" SRCREV_pn-openmoko-panel-battery ?= "3360" SRCREV_pn-openmoko-panel-bt ?= "2896" SRCREV_pn-openmoko-panel-clock ?= "2567" @@ -105,7 +106,7 @@ SRCREV_pn-openmoko-theme-standard2 ?= "3289" SRCREV_pn-openmoko-theme-standard2-qvga ?= "3289" SRCREV_pn-openmoko-today ?= "3056" SRCREV_pn-openmoko-today2 ?= "3342" -SRCREV_pn-openmoko-today2-folders ?= "2680" +SRCREV_pn-openmoko-today2-folders ?= "3414" SRCREV_pn-openmoko-worldclock2 ?= "3365" SRCREV_pn-openocd ?= "206" SRCREV_pn-openocd-native ?= "206" -- cgit v1.2.3