LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 7/7] Makefile
From: Jon Smirl @ 2007-12-18  2:39 UTC (permalink / raw)
  To: i2c, linuxppc-dev, linux-kernel
In-Reply-To: <20071218023913.8530.46661.stgit@terra.home>

Signed-off-by: Jon Smirl <jonsmirl@gmail.com>

Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
---

 Makefile |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)


diff --git a/Makefile b/Makefile
index c1825aa..15ada3f 100644
--- a/Makefile
+++ b/Makefile
@@ -35,6 +35,9 @@ MAKEFLAGS += -rR --no-print-directory
 # To put more focus on warnings, be less verbose as default
 # Use 'make V=1' to see the full commands
 
+ARCH=powerpc
+CROSS_COMPILE=powerpc-603e-linux-gnu-
+
 ifdef V
   ifeq ("$(origin V)", "command line")
     KBUILD_VERBOSE = $(V)

^ permalink raw reply related

* Re: [PATCH 7/7] Makefile
From: Jon Smirl @ 2007-12-18  2:43 UTC (permalink / raw)
  To: i2c, linuxppc-dev, linux-kernel
In-Reply-To: <20071218023928.8530.25171.stgit@terra.home>

Ignore this patch, I forgot to remove it before mailing the series.

On 12/17/07, Jon Smirl <jonsmirl@gmail.com> wrote:
> Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
>
> Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
> ---
>
>  Makefile |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
>
> diff --git a/Makefile b/Makefile
> index c1825aa..15ada3f 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -35,6 +35,9 @@ MAKEFLAGS += -rR --no-print-directory
>  # To put more focus on warnings, be less verbose as default
>  # Use 'make V=1' to see the full commands
>
> +ARCH=powerpc
> +CROSS_COMPILE=powerpc-603e-linux-gnu-
> +
>  ifdef V
>    ifeq ("$(origin V)", "command line")
>      KBUILD_VERBOSE = $(V)
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>


-- 
Jon Smirl
jonsmirl@gmail.com

^ permalink raw reply

* Raising list size limit
From: Stephen Rothwell @ 2007-12-18  3:36 UTC (permalink / raw)
  To: ppc-dev

[-- Attachment #1: Type: text/plain, Size: 470 bytes --]

Hi,

I am considering raising the limit on the size of postings to 400k.  Does
anyone have a real problem with this?  Limiting message size was done to
limit the damage of larges spams (and we don;t get very many of those on
the list) and to ease the pain for people downloading emails over a slow
(like dialup) link (and are there many of those left?).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* [PATCH 3/7] Modify several rtc drivers to use the alias names list property of i2c
From: Jon Smirl @ 2007-12-18  2:39 UTC (permalink / raw)
  To: i2c, linuxppc-dev, linux-kernel
In-Reply-To: <20071218023913.8530.46661.stgit@terra.home>

This patch modifies the ds1307, ds1374, and rs5c372 i2c drivers to support
device tree names using the new i2c mod alias support

Signed-off-by: Jon Smirl <jonsmirl@gmail.com>

Signed-off-by: Jon Smirl <jonsmirl@gmail.com>

Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
---

 arch/powerpc/sysdev/fsl_soc.c |   44 ++++----------------------------
 drivers/rtc/rtc-ds1307.c      |   20 +++++++++++++-
 drivers/rtc/rtc-ds1374.c      |    9 ++++++
 drivers/rtc/rtc-m41t80.c      |   57 ++++++++++++++++++++++++++++-------------
 drivers/rtc/rtc-rs5c372.c     |   16 ++++++++++--
 5 files changed, 85 insertions(+), 61 deletions(-)


diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index 3ace747..268638a 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -320,48 +320,12 @@ arch_initcall(gfar_of_init);
 
 #ifdef CONFIG_I2C_BOARDINFO
 #include <linux/i2c.h>
-struct i2c_driver_device {
-	char	*of_device;
-	char	*i2c_driver;
-	char	*i2c_type;
-};
-
-static struct i2c_driver_device i2c_devices[] __initdata = {
-	{"ricoh,rs5c372a", "rtc-rs5c372", "rs5c372a",},
-	{"ricoh,rs5c372b", "rtc-rs5c372", "rs5c372b",},
-	{"ricoh,rv5c386",  "rtc-rs5c372", "rv5c386",},
-	{"ricoh,rv5c387a", "rtc-rs5c372", "rv5c387a",},
-	{"dallas,ds1307",  "rtc-ds1307",  "ds1307",},
-	{"dallas,ds1337",  "rtc-ds1307",  "ds1337",},
-	{"dallas,ds1338",  "rtc-ds1307",  "ds1338",},
-	{"dallas,ds1339",  "rtc-ds1307",  "ds1339",},
-	{"dallas,ds1340",  "rtc-ds1307",  "ds1340",},
-	{"stm,m41t00",     "rtc-ds1307",  "m41t00"},
-	{"dallas,ds1374",  "rtc-ds1374",  "rtc-ds1374",},
-};
-
-static int __init of_find_i2c_driver(struct device_node *node,
-				     struct i2c_board_info *info)
-{
-	int i;
-
-	for (i = 0; i < ARRAY_SIZE(i2c_devices); i++) {
-		if (!of_device_is_compatible(node, i2c_devices[i].of_device))
-			continue;
-		if (strlcpy(info->driver_name, i2c_devices[i].i2c_driver,
-			    KOBJ_NAME_LEN) >= KOBJ_NAME_LEN ||
-		    strlcpy(info->type, i2c_devices[i].i2c_type,
-			    I2C_NAME_SIZE) >= I2C_NAME_SIZE)
-			return -ENOMEM;
-		return 0;
-	}
-	return -ENODEV;
-}
 
 static void __init of_register_i2c_devices(struct device_node *adap_node,
 					   int bus_num)
 {
 	struct device_node *node = NULL;
+	const char *compatible;
 
 	while ((node = of_get_next_child(adap_node, node))) {
 		struct i2c_board_info info = {};
@@ -378,8 +342,12 @@ static void __init of_register_i2c_devices(struct device_node *adap_node,
 		if (info.irq == NO_IRQ)
 			info.irq = -1;
 
-		if (of_find_i2c_driver(node, &info) < 0)
+		compatible = of_get_property(node, "compatible", &len);
+		if (!compatible) {
+			printk(KERN_WARNING "i2c-mpc.c: invalid entry, missing compatible attribute\n");
 			continue;
+		}
+		strncpy(info.driver_name, compatible, sizeof(info.driver_name));
 
 		info.addr = *addr;
 
diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c
index bc1c7fe..d4874ff 100644
--- a/drivers/rtc/rtc-ds1307.c
+++ b/drivers/rtc/rtc-ds1307.c
@@ -139,6 +139,17 @@ static inline const struct chip_desc *find_chip(const char *s)
 	return NULL;
 }
 
+static struct i2c_device_id ds1307_id[] = {
+	OF_I2C_ID("dallas,ds1307", ds_1307)
+	OF_I2C_ID("dallas,ds1337", ds_1337)
+	OF_I2C_ID("dallas,ds1338", ds_1338)
+	OF_I2C_ID("dallas,ds1339", ds_1339)
+	OF_I2C_ID("dallas,ds1340", ds_1340)
+	OF_I2C_ID("stm,m41t00", m41t00)
+	{},
+};
+MODULE_DEVICE_TABLE(i2c, ds1307_id);
+
 static int ds1307_get_time(struct device *dev, struct rtc_time *t)
 {
 	struct ds1307	*ds1307 = dev_get_drvdata(dev);
@@ -326,7 +337,7 @@ static struct bin_attribute nvram = {
 
 static struct i2c_driver ds1307_driver;
 
-static int __devinit ds1307_probe(struct i2c_client *client)
+static int __devinit ds1307_probe(struct i2c_client *client, const struct i2c_device_id *id)
 {
 	struct ds1307		*ds1307;
 	int			err = -ENODEV;
@@ -334,7 +345,11 @@ static int __devinit ds1307_probe(struct i2c_client *client)
 	const struct chip_desc	*chip;
 	struct i2c_adapter	*adapter = to_i2c_adapter(client->dev.parent);
 
-	chip = find_chip(client->name);
+	if (id)
+		chip = &chips[id->driver_data];
+	else
+		chip = find_chip(client->name);
+
 	if (!chip) {
 		dev_err(&client->dev, "unknown chip type '%s'\n",
 				client->name);
@@ -537,6 +552,7 @@ static struct i2c_driver ds1307_driver = {
 	},
 	.probe		= ds1307_probe,
 	.remove		= __devexit_p(ds1307_remove),
+	.id_table	= ds1307_id,
 };
 
 static int __init ds1307_init(void)
diff --git a/drivers/rtc/rtc-ds1374.c b/drivers/rtc/rtc-ds1374.c
index 45bda18..6dc05c4 100644
--- a/drivers/rtc/rtc-ds1374.c
+++ b/drivers/rtc/rtc-ds1374.c
@@ -41,6 +41,12 @@
 #define DS1374_REG_SR_AF	0x01 /* Alarm Flag */
 #define DS1374_REG_TCR		0x09 /* Trickle Charge */
 
+static struct i2c_device_id ds1374_id[] = {
+	OF_I2C_ID("dallas,ds1374", 0)
+	{},
+};
+MODULE_DEVICE_TABLE(i2c, ds1374_id);
+
 struct ds1374 {
 	struct i2c_client *client;
 	struct rtc_device *rtc;
@@ -355,7 +361,7 @@ static const struct rtc_class_ops ds1374_rtc_ops = {
 	.ioctl = ds1374_ioctl,
 };
 
-static int ds1374_probe(struct i2c_client *client)
+static int ds1374_probe(struct i2c_client *client, const struct i2c_device_id *id)
 {
 	struct ds1374 *ds1374;
 	int ret;
@@ -429,6 +435,7 @@ static struct i2c_driver ds1374_driver = {
 	},
 	.probe = ds1374_probe,
 	.remove = __devexit_p(ds1374_remove),
+	.id_table = ds1374_id,
 };
 
 static int __init ds1374_init(void)
diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c
index 1cb33ca..fc33f77 100644
--- a/drivers/rtc/rtc-m41t80.c
+++ b/drivers/rtc/rtc-m41t80.c
@@ -100,8 +100,21 @@ static const struct m41t80_chip_info m41t80_chip_info_tbl[] = {
 	},
 };
 
+static struct i2c_device_id m41t80_id[] = {
+	OF_I2C_ID("stm,m41t80", 0)
+	OF_I2C_ID("stm,m41t81", M41T80_FEATURE_HT)
+	OF_I2C_ID("stm,m41t81s", M41T80_FEATURE_HT | M41T80_FEATURE_BL)
+	OF_I2C_ID("stm,m41t82", M41T80_FEATURE_HT | M41T80_FEATURE_BL)
+	OF_I2C_ID("stm,m41t83", M41T80_FEATURE_HT | M41T80_FEATURE_BL)
+	OF_I2C_ID("stm,m41t84", M41T80_FEATURE_HT | M41T80_FEATURE_BL)
+	OF_I2C_ID("stm,m41t85", M41T80_FEATURE_HT | M41T80_FEATURE_BL)
+	OF_I2C_ID("stm,m41t87", M41T80_FEATURE_HT | M41T80_FEATURE_BL)
+	{},
+};
+MODULE_DEVICE_TABLE(i2c, m41t80_id);
+
 struct m41t80_data {
-	const struct m41t80_chip_info *chip;
+	u8 features;
 	struct rtc_device *rtc;
 };
 
@@ -208,7 +221,7 @@ static int m41t80_rtc_proc(struct device *dev, struct seq_file *seq)
 	struct m41t80_data *clientdata = i2c_get_clientdata(client);
 	u8 reg;
 
-	if (clientdata->chip->features & M41T80_FEATURE_BL) {
+	if (clientdata->features & M41T80_FEATURE_BL) {
 		reg = i2c_smbus_read_byte_data(client, M41T80_REG_FLAGS);
 		seq_printf(seq, "battery\t\t: %s\n",
 			   (reg & M41T80_FLAGS_BATT_LOW) ? "exhausted" : "ok");
@@ -756,12 +769,12 @@ static struct notifier_block wdt_notifier = {
  *
  *****************************************************************************
  */
-static int m41t80_probe(struct i2c_client *client)
+static int m41t80_probe(struct i2c_client *client, const struct i2c_device_id *id)
 {
 	int i, rc = 0;
 	struct rtc_device *rtc = NULL;
 	struct rtc_time tm;
-	const struct m41t80_chip_info *chip;
+	u8 features;
 	struct m41t80_data *clientdata = NULL;
 
 	if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C
@@ -773,17 +786,24 @@ static int m41t80_probe(struct i2c_client *client)
 	dev_info(&client->dev,
 		 "chip found, driver version " DRV_VERSION "\n");
 
-	chip = NULL;
-	for (i = 0; i < ARRAY_SIZE(m41t80_chip_info_tbl); i++) {
-		if (!strcmp(m41t80_chip_info_tbl[i].name, client->name)) {
-			chip = &m41t80_chip_info_tbl[i];
-			break;
+	if (id)
+		features = id->driver_data;
+	else {
+		const struct m41t80_chip_info *chip;
+
+		chip = NULL;
+		for (i = 0; i < ARRAY_SIZE(m41t80_chip_info_tbl); i++) {
+			if (!strcmp(m41t80_chip_info_tbl[i].name, client->name)) {
+				chip = &m41t80_chip_info_tbl[i];
+				break;
+			}
 		}
-	}
-	if (!chip) {
-		dev_err(&client->dev, "%s is not supported\n", client->name);
-		rc = -ENODEV;
-		goto exit;
+		if (!chip) {
+			dev_err(&client->dev, "%s is not supported\n", client->name);
+			rc = -ENODEV;
+			goto exit;
+		}
+		features = chip->features;
 	}
 
 	clientdata = kzalloc(sizeof(*clientdata), GFP_KERNEL);
@@ -801,7 +821,7 @@ static int m41t80_probe(struct i2c_client *client)
 	}
 
 	clientdata->rtc = rtc;
-	clientdata->chip = chip;
+	clientdata->features = features;
 	i2c_set_clientdata(client, clientdata);
 
 	/* Make sure HT (Halt Update) bit is cleared */
@@ -810,7 +830,7 @@ static int m41t80_probe(struct i2c_client *client)
 		goto ht_err;
 
 	if (rc & M41T80_ALHOUR_HT) {
-		if (chip->features & M41T80_FEATURE_HT) {
+		if (features & M41T80_FEATURE_HT) {
 			m41t80_get_datetime(client, &tm);
 			dev_info(&client->dev, "HT bit was set!\n");
 			dev_info(&client->dev,
@@ -842,7 +862,7 @@ static int m41t80_probe(struct i2c_client *client)
 		goto exit;
 
 #ifdef CONFIG_RTC_DRV_M41T80_WDT
-	if (chip->features & M41T80_FEATURE_HT) {
+	if (features & M41T80_FEATURE_HT) {
 		rc = misc_register(&wdt_dev);
 		if (rc)
 			goto exit;
@@ -878,7 +898,7 @@ static int m41t80_remove(struct i2c_client *client)
 	struct rtc_device *rtc = clientdata->rtc;
 
 #ifdef CONFIG_RTC_DRV_M41T80_WDT
-	if (clientdata->chip->features & M41T80_FEATURE_HT) {
+	if (clientdata->features & M41T80_FEATURE_HT) {
 		misc_deregister(&wdt_dev);
 		unregister_reboot_notifier(&wdt_notifier);
 	}
@@ -896,6 +916,7 @@ static struct i2c_driver m41t80_driver = {
 	},
 	.probe = m41t80_probe,
 	.remove = m41t80_remove,
+	.id_table = m41t80_id,
 };
 
 static int __init m41t80_rtc_init(void)
diff --git a/drivers/rtc/rtc-rs5c372.c b/drivers/rtc/rtc-rs5c372.c
index 6b67b50..e2022c0 100644
--- a/drivers/rtc/rtc-rs5c372.c
+++ b/drivers/rtc/rtc-rs5c372.c
@@ -69,6 +69,15 @@ enum rtc_type {
 	rtc_rv5c387a,
 };
 
+static struct i2c_device_id rs5c372_id[] = {
+	OF_I2C_ID("ricoh,rs5c372a", rtc_rs5c372a)
+	OF_I2C_ID("ricoh,rs5c372b", rtc_rs5c372b)
+	OF_I2C_ID("ricoh,rv5c386", rtc_rv5c386)
+	OF_I2C_ID("ricoh,rv5c387a", rtc_rv5c387a)
+	{},
+};
+MODULE_DEVICE_TABLE(i2c, rs5c372_id);
+
 /* REVISIT:  this assumes that:
  *  - we're in the 21st century, so it's safe to ignore the century
  *    bit for rv5c38[67] (REG_MONTH bit 7);
@@ -494,7 +503,7 @@ static void rs5c_sysfs_unregister(struct device *dev)
 
 static struct i2c_driver rs5c372_driver;
 
-static int rs5c372_probe(struct i2c_client *client)
+static int rs5c372_probe(struct i2c_client *client, const struct i2c_device_id *id)
 {
 	int err = 0;
 	struct rs5c372 *rs5c372;
@@ -522,7 +531,9 @@ static int rs5c372_probe(struct i2c_client *client)
 	if (err < 0)
 		goto exit_kfree;
 
-	if (strcmp(client->name, "rs5c372a") == 0)
+	if (id)
+		rs5c372->type = id->driver_data;
+	else if (strcmp(client->name, "rs5c372a") == 0)
 		rs5c372->type = rtc_rs5c372a;
 	else if (strcmp(client->name, "rs5c372b") == 0)
 		rs5c372->type = rtc_rs5c372b;
@@ -651,6 +662,7 @@ static struct i2c_driver rs5c372_driver = {
 	},
 	.probe		= rs5c372_probe,
 	.remove		= rs5c372_remove,
+	.id_table	= rs5c372_id,
 };
 
 static __init int rs5c372_init(void)

^ permalink raw reply related

* [PATCH 6/7] Convert pfc8563 i2c driver from old style to new style
From: Jon Smirl @ 2007-12-18  2:39 UTC (permalink / raw)
  To: i2c, linuxppc-dev, linux-kernel
In-Reply-To: <20071218023913.8530.46661.stgit@terra.home>

Convert pfc8563 i2c driver from old style to new style. The
driver is also modified to support device tree names via the
i2c mod alias mechanism.

Signed-off-by: Jon Smirl <jonsmirl@gmail.com>

Signed-off-by: Jon Smirl <jonsmirl@gmail.com>

Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
---

 drivers/rtc/rtc-pcf8563.c |  107 +++++++++++----------------------------------
 1 files changed, 27 insertions(+), 80 deletions(-)


diff --git a/drivers/rtc/rtc-pcf8563.c b/drivers/rtc/rtc-pcf8563.c
index 0242d80..e1ea2a0 100644
--- a/drivers/rtc/rtc-pcf8563.c
+++ b/drivers/rtc/rtc-pcf8563.c
@@ -25,10 +25,6 @@
  * located at 0x51 will pass the validation routine due to
  * the way the registers are implemented.
  */
-static unsigned short normal_i2c[] = { I2C_CLIENT_END };
-
-/* Module parameters */
-I2C_CLIENT_INSMOD;
 
 #define PCF8563_REG_ST1		0x00 /* status */
 #define PCF8563_REG_ST2		0x01
@@ -72,9 +68,6 @@ struct pcf8563 {
 	int c_polarity;	/* 0: MO_C=1 means 19xx, otherwise MO_C=1 means 20xx */
 };
 
-static int pcf8563_probe(struct i2c_adapter *adapter, int address, int kind);
-static int pcf8563_detach(struct i2c_client *client);
-
 /*
  * In the routines that deal directly with the pcf8563 hardware, we use
  * rtc_time -- month 0-11, hour 0-23, yr = calendar year-epoch.
@@ -257,98 +250,52 @@ static const struct rtc_class_ops pcf8563_rtc_ops = {
 	.set_time	= pcf8563_rtc_set_time,
 };
 
-static int pcf8563_attach(struct i2c_adapter *adapter)
+static int pcf8563_remove(struct i2c_client *client)
 {
-	return i2c_probe(adapter, &addr_data, pcf8563_probe);
+	struct rtc_device *rtc = i2c_get_clientdata(client);
+
+	if (rtc)
+		rtc_device_unregister(rtc);
+
+	return 0;
 }
 
+static struct i2c_device_id pcf8563_id[] = {
+	OF_I2C_ID("philips,pcf8563", 0)
+	OF_I2C_ID("epson,rtc8564", 0)
+	{},
+};
+MODULE_DEVICE_TABLE(i2c, pcf8563_id);
+
+static int pcf8563_probe(struct i2c_client *client, const struct i2c_device_id *id);
+
 static struct i2c_driver pcf8563_driver = {
 	.driver		= {
-		.name	= "pcf8563",
+		.name	= "rtc-pcf8563",
 	},
 	.id		= I2C_DRIVERID_PCF8563,
-	.attach_adapter = &pcf8563_attach,
-	.detach_client	= &pcf8563_detach,
+	.probe = &pcf8563_probe,
+	.remove = &pcf8563_remove,
+	.id_table	= pcf8563_id,
 };
 
-static int pcf8563_probe(struct i2c_adapter *adapter, int address, int kind)
+static int pcf8563_probe(struct i2c_client *client, const struct i2c_device_id *id)
 {
-	struct pcf8563 *pcf8563;
-	struct i2c_client *client;
+	int result;
 	struct rtc_device *rtc;
 
-	int err = 0;
-
-	dev_dbg(&adapter->dev, "%s\n", __FUNCTION__);
-
-	if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) {
-		err = -ENODEV;
-		goto exit;
-	}
-
-	if (!(pcf8563 = kzalloc(sizeof(struct pcf8563), GFP_KERNEL))) {
-		err = -ENOMEM;
-		goto exit;
-	}
-
-	client = &pcf8563->client;
-	client->addr = address;
-	client->driver = &pcf8563_driver;
-	client->adapter	= adapter;
-
-	strlcpy(client->name, pcf8563_driver.driver.name, I2C_NAME_SIZE);
-
-	/* Verify the chip is really an PCF8563 */
-	if (kind < 0) {
-		if (pcf8563_validate_client(client) < 0) {
-			err = -ENODEV;
-			goto exit_kfree;
-		}
-	}
-
-	/* Inform the i2c layer */
-	if ((err = i2c_attach_client(client)))
-		goto exit_kfree;
-
-	dev_info(&client->dev, "chip found, driver version " DRV_VERSION "\n");
+	result = pcf8563_validate_client(client);
+	if (result)
+		return result;
 
 	rtc = rtc_device_register(pcf8563_driver.driver.name, &client->dev,
 				&pcf8563_rtc_ops, THIS_MODULE);
-
-	if (IS_ERR(rtc)) {
-		err = PTR_ERR(rtc);
-		goto exit_detach;
-	}
+	if (IS_ERR(rtc))
+		return PTR_ERR(rtc);
 
 	i2c_set_clientdata(client, rtc);
 
 	return 0;
-
-exit_detach:
-	i2c_detach_client(client);
-
-exit_kfree:
-	kfree(pcf8563);
-
-exit:
-	return err;
-}
-
-static int pcf8563_detach(struct i2c_client *client)
-{
-	struct pcf8563 *pcf8563 = container_of(client, struct pcf8563, client);
-	int err;
-	struct rtc_device *rtc = i2c_get_clientdata(client);
-
-	if (rtc)
-		rtc_device_unregister(rtc);
-
-	if ((err = i2c_detach_client(client)))
-		return err;
-
-	kfree(pcf8563);
-
-	return 0;
 }
 
 static int __init pcf8563_init(void)

^ permalink raw reply related

* Re: [PATCH] [POWERPC][RFC] MPC8360E-RDK: Device tree and board file
From: David Gibson @ 2007-12-18  3:51 UTC (permalink / raw)
  To: Scott Wood; +Cc: Stephen Rothwell, linuxppc-dev
In-Reply-To: <20071217170303.GA4303@loki.buserror.net>

On Mon, Dec 17, 2007 at 11:03:04AM -0600, Scott Wood wrote:
> On Mon, Dec 17, 2007 at 04:14:03PM +1100, David Gibson wrote:
[snip]
> > These phy nodes have basically no information in them.  PHY nodes are
> > optional -
> 
> If they are truly optional, then several Linux drivers (including ucc_geth,
> which this board uses) are broken, as they'll error out if there's no
> phy-handle (gianfar is even worse -- it looks like the fsl_soc code will
> crash in that case).  But what do you propose they do in the absence of a
> phy-handle?  Hope that probing only finds one phy?

Sorry, I was misleading.  PHY nodes may be optional depending on the
hardware configuration; what circumstances they're necessary in is up
to the MAC binding.  Allowing the nodes to be omitted when there's
only one PHY on the bus to be probed would be a common choice, for
example.

In this case the driver and binding have been developed together and
for the time being it does require PHY nodes, obviously.  I'm saying
that maybe that requirement ought to be changed.

> > only include them if they actually have something useful to say (which
> > would mean at least a compatible property).
> 
> They *do* have useful information -- reg and phandle.  The type of phy can
> be probed, but which phy corresponds to which ethernet can't.

Well, phandle is only used to find the phy node itself, so it doesn't
count.  The only piece of information there is the reg - the PHY id.
Following a phandle to another node is a fairly complex way of finding
a single integer.  

Eh, I guess it's ok, but just directly giving the PHY id or a probe
mask in the MAC node would also be fine (we do this for 4xx EMAC).

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply

* dtc: Remove remaining old-style checks
From: David Gibson @ 2007-12-18  3:54 UTC (permalink / raw)
  To: Jon Loeliger; +Cc: linuxppc-dev

The remaining old-style tree checking code: check_root(), check_cpus()
and check_memory() really aren't that useful.  They mostly check for
the presence of particular nodes and properties.  That's inherently
prone to false-positives, because we could be dealing with an
artificial tree (like many of the testcases) or it could be expected
that the missing properties are filled in by a bootloader or other
agent.

If any of these checks really turns out to be useful, we can
reimplement them later in a better conceived way on top of the new
checking infrastructure.  For now, just get rid of them, removing the
last vestiges of the old-style checking code (hoorah).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

Index: dtc/checks.c
===================================================================
--- dtc.orig/checks.c	2007-12-11 13:51:06.000000000 +1100
+++ dtc/checks.c	2007-12-11 14:11:40.000000000 +1100
@@ -511,10 +511,7 @@ static struct check *check_table[] = {
 	&obsolete_chosen_interrupt_controller,
 };
 
-int check_semantics(struct node *dt, int outversion, int boot_cpuid_phys);
-
-void process_checks(int force, struct boot_info *bi,
-		    int checkflag, int outversion, int boot_cpuid_phys)
+void process_checks(int force, struct boot_info *bi)
 {
 	struct node *dt = bi->dt;
 	int i;
@@ -537,214 +534,4 @@ void process_checks(int force, struct bo
 				"output forced\n");
 		}
 	}
-
-	if (checkflag) {
-		if (error) {
-			fprintf(stderr, "Warning: Skipping semantic checks due to structural errors\n");
-		} else {
-			if (!check_semantics(bi->dt, outversion,
-					     boot_cpuid_phys))
-				fprintf(stderr, "Warning: Input tree has semantic errors\n");
-		}
-	}
-}
-
-/*
- * Semantic check functions
- */
-
-#define ERRMSG(...) if (quiet < 2) fprintf(stderr, "ERROR: " __VA_ARGS__)
-#define WARNMSG(...) if (quiet < 1) fprintf(stderr, "Warning: " __VA_ARGS__)
-
-#define DO_ERR(...) do {ERRMSG(__VA_ARGS__); ok = 0; } while (0)
-
-#define CHECK_HAVE(node, propname) \
-	do { \
-		if (! (prop = get_property((node), (propname)))) \
-			DO_ERR("Missing \"%s\" property in %s\n", (propname), \
-				(node)->fullpath); \
-	} while (0);
-
-#define CHECK_HAVE_WARN(node, propname) \
-	do { \
-		if (! (prop  = get_property((node), (propname)))) \
-			WARNMSG("%s has no \"%s\" property\n", \
-				(node)->fullpath, (propname)); \
-	} while (0)
-
-#define CHECK_HAVE_STRING(node, propname) \
-	do { \
-		CHECK_HAVE((node), (propname)); \
-		if (prop && !data_is_one_string(prop->val)) \
-			DO_ERR("\"%s\" property in %s is not a string\n", \
-				(propname), (node)->fullpath); \
-	} while (0)
-
-#define CHECK_HAVE_STREQ(node, propname, value) \
-	do { \
-		CHECK_HAVE_STRING((node), (propname)); \
-		if (prop && !streq(prop->val.val, (value))) \
-			DO_ERR("%s has wrong %s, %s (should be %s\n", \
-				(node)->fullpath, (propname), \
-				prop->val.val, (value)); \
-	} while (0)
-
-#define CHECK_HAVE_ONECELL(node, propname) \
-	do { \
-		CHECK_HAVE((node), (propname)); \
-		if (prop && (prop->val.len != sizeof(cell_t))) \
-			DO_ERR("\"%s\" property in %s has wrong size %d (should be 1 cell)\n", (propname), (node)->fullpath, prop->val.len); \
-	} while (0)
-
-#define CHECK_HAVE_WARN_ONECELL(node, propname) \
-	do { \
-		CHECK_HAVE_WARN((node), (propname)); \
-		if (prop && (prop->val.len != sizeof(cell_t))) \
-			DO_ERR("\"%s\" property in %s has wrong size %d (should be 1 cell)\n", (propname), (node)->fullpath, prop->val.len); \
-	} while (0)
-
-#define CHECK_HAVE_WARN_PHANDLE(xnode, propname, root) \
-	do { \
-		struct node *ref; \
-		CHECK_HAVE_WARN_ONECELL((xnode), (propname)); \
-		if (prop) {\
-			cell_t phandle = propval_cell(prop); \
-			if ((phandle == 0) || (phandle == -1)) { \
-				DO_ERR("\"%s\" property in %s contains an invalid phandle %x\n", (propname), (xnode)->fullpath, phandle); \
-			} else { \
-				ref = get_node_by_phandle((root), propval_cell(prop)); \
-				if (! ref) \
-					DO_ERR("\"%s\" property in %s refers to non-existant phandle %x\n", (propname), (xnode)->fullpath, propval_cell(prop)); \
-			} \
-		} \
-	} while (0)
-
-#define CHECK_HAVE_WARN_STRING(node, propname) \
-	do { \
-		CHECK_HAVE_WARN((node), (propname)); \
-		if (prop && !data_is_one_string(prop->val)) \
-			DO_ERR("\"%s\" property in %s is not a string\n", \
-				(propname), (node)->fullpath); \
-	} while (0)
-
-static int check_root(struct node *root)
-{
-	struct property *prop;
-	int ok = 1;
-
-	CHECK_HAVE_STRING(root, "model");
-	CHECK_HAVE_WARN(root, "compatible");
-
-	return ok;
-}
-
-static int check_cpus(struct node *root, int outversion, int boot_cpuid_phys)
-{
-	struct node *cpus, *cpu;
-	struct property *prop;
-	struct node *bootcpu = NULL;
-	int ok = 1;
-
-	cpus = get_subnode(root, "cpus");
-	if (! cpus) {
-		ERRMSG("Missing /cpus node\n");
-		return 0;
-	}
-
-	if (cpus->addr_cells != 1)
-		DO_ERR("%s has bad #address-cells value %d (should be 1)\n",
-		       cpus->fullpath, cpus->addr_cells);
-	if (cpus->size_cells != 0)
-		DO_ERR("%s has bad #size-cells value %d (should be 0)\n",
-		       cpus->fullpath, cpus->size_cells);
-
-	for_each_child(cpus, cpu) {
-		CHECK_HAVE_STREQ(cpu, "device_type", "cpu");
-
-		CHECK_HAVE_ONECELL(cpu, "reg");
-		if (prop) {
-			cell_t unitnum;
-			char *eptr;
-
-			unitnum = strtol(get_unitname(cpu), &eptr, 16);
-			if (*eptr) {
-				WARNMSG("%s has bad format unit name %s (should be CPU number\n",
-					cpu->fullpath, get_unitname(cpu));
-			} else if (unitnum != propval_cell(prop)) {
-				WARNMSG("%s unit name \"%s\" does not match \"reg\" property <%x>\n",
-				       cpu->fullpath, get_unitname(cpu),
-				       propval_cell(prop));
-			}
-		}
-
-/* 		CHECK_HAVE_ONECELL(cpu, "d-cache-line-size"); */
-/* 		CHECK_HAVE_ONECELL(cpu, "i-cache-line-size"); */
-		CHECK_HAVE_ONECELL(cpu, "d-cache-size");
-		CHECK_HAVE_ONECELL(cpu, "i-cache-size");
-
-		CHECK_HAVE_WARN_ONECELL(cpu, "clock-frequency");
-		CHECK_HAVE_WARN_ONECELL(cpu, "timebase-frequency");
-
-		prop = get_property(cpu, "linux,boot-cpu");
-		if (prop) {
-			if (prop->val.len)
-				WARNMSG("\"linux,boot-cpu\" property in %s is non-empty\n",
-					cpu->fullpath);
-			if (bootcpu)
-				DO_ERR("Multiple boot cpus (%s and %s)\n",
-				       bootcpu->fullpath, cpu->fullpath);
-			else
-				bootcpu = cpu;
-		}
-	}
-
-	if (outversion < 2) {
-		if (! bootcpu)
-			WARNMSG("No cpu has \"linux,boot-cpu\" property\n");
-	} else {
-		if (bootcpu)
-			WARNMSG("\"linux,boot-cpu\" property is deprecated in blob version 2 or higher\n");
-		if (boot_cpuid_phys == 0xfeedbeef)
-			WARNMSG("physical boot CPU not set.  Use -b option to set\n");
-	}
-
-	return ok;
-}
-
-static int check_memory(struct node *root)
-{
-	struct node *mem;
-	struct property *prop;
-	int nnodes = 0;
-	int ok = 1;
-
-	for_each_child(root, mem) {
-		if (! strneq(mem->name, "memory", mem->basenamelen))
-			continue;
-
-		nnodes++;
-
-		CHECK_HAVE_STREQ(mem, "device_type", "memory");
-		CHECK_HAVE(mem, "reg");
-	}
-
-	if (nnodes == 0) {
-		ERRMSG("No memory nodes\n");
-		return 0;
-	}
-
-	return ok;
-}
-
-int check_semantics(struct node *dt, int outversion, int boot_cpuid_phys)
-{
-	int ok = 1;
-
-	ok = ok && check_root(dt);
-	ok = ok && check_cpus(dt, outversion, boot_cpuid_phys);
-	ok = ok && check_memory(dt);
-	if (! ok)
-		return 0;
-
-	return 1;
 }
Index: dtc/dtc.h
===================================================================
--- dtc.orig/dtc.h	2007-12-11 14:11:49.000000000 +1100
+++ dtc/dtc.h	2007-12-11 14:11:54.000000000 +1100
@@ -240,8 +240,7 @@ struct boot_info *build_boot_info(struct
 
 /* Checks */
 
-void process_checks(int force, struct boot_info *bi,
-		    int checkflag, int outversion, int boot_cpuid_phys);
+void process_checks(int force, struct boot_info *bi);
 
 /* Flattened trees */
 
Index: dtc/dtc.c
===================================================================
--- dtc.orig/dtc.c	2007-12-11 14:12:07.000000000 +1100
+++ dtc/dtc.c	2007-12-11 14:12:09.000000000 +1100
@@ -204,7 +204,7 @@ int main(int argc, char *argv[])
 	if (! bi || ! bi->dt)
 		die("Couldn't read input tree\n");
 
-	process_checks(force, bi, check, outversion, boot_cpuid_phys);
+	process_checks(force, bi);
 
 	if (streq(outname, "-")) {
 		outf = stdout;

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply

* [0/2] Merge dtc
From: David Gibson @ 2007-12-18  4:03 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

Here is a revised set of patches to merge dtc into the kernel tree.

The various methods suggested for doing some sort of automagic git
pull of the dtc repository into the kernel git all appear to me to be
more trouble than they're worth at this stage.  So, at this stage this
is just a raw patch importing the source.  I have scripts which make
it an easy job to produce a patch updating the embedded copy of dtc.

If at some future point we want to move dtc to a more general place so
it can be used by microblaze or other architectures as well, we can
revisit how the import is done at that time.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply

* [1/2] Merge dtc upstream source
From: David Gibson @ 2007-12-18  4:06 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <20071218040348.GB10348@localhost.localdomain>

This large patch incorporates a copy of dtc into the kernel source, in
arch/powerpc/boot/dtc-src.  This patch only imports the upstream
sources verbatim, a later patches is needed to actually link it into
the kernel Makefiles and use the embedded code during the kernel
build.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

---
 arch/powerpc/boot/dtc-src/Makefile.dtc             |   25 
 arch/powerpc/boot/dtc-src/checks.c                 |  750 +++++++
 arch/powerpc/boot/dtc-src/data.c                   |  321 +++
 arch/powerpc/boot/dtc-src/dtc-lexer.l              |  328 +++
 arch/powerpc/boot/dtc-src/dtc-lexer.lex.c_shipped  | 2174 +++++++++++++++++++++
 arch/powerpc/boot/dtc-src/dtc-parser.tab.c_shipped | 1983 +++++++++++++++++++
 arch/powerpc/boot/dtc-src/dtc-parser.tab.h_shipped |  111 +
 arch/powerpc/boot/dtc-src/dtc-parser.y             |  336 +++
 arch/powerpc/boot/dtc-src/dtc.c                    |  231 ++
 arch/powerpc/boot/dtc-src/dtc.h                    |  269 ++
 arch/powerpc/boot/dtc-src/flattree.c               |  968 +++++++++
 arch/powerpc/boot/dtc-src/fstree.c                 |   94 
 arch/powerpc/boot/dtc-src/livetree.c               |  305 ++
 arch/powerpc/boot/dtc-src/srcpos.c                 |  105 +
 arch/powerpc/boot/dtc-src/srcpos.h                 |   75 
 arch/powerpc/boot/dtc-src/treesource.c             |  275 ++
 arch/powerpc/boot/dtc-src/version_gen.h            |    1 
 17 files changed, 8351 insertions(+)

Patch is too big for the list (224k).  Download from:
	http://ozlabs.org/~dgibson/home/merge-dtc.patch

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply

* [2/2] Use embedded dtc in kernel builds
From: David Gibson @ 2007-12-18  4:07 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <20071218040348.GB10348@localhost.localdomain>

This patch alters the kernel makefiles to build dtc from the sources
embedded in the previous patch.  It also changes the
arch/powerpc/boot/wrapper script to use the embedded dtc, rather than
expecting a copy of dtc already installed on the system.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

---
 arch/powerpc/boot/Makefile |   39 +++++++++++++++++++++++++++++++++++++--
 arch/powerpc/boot/wrapper  |    2 +-
 2 files changed, 38 insertions(+), 3 deletions(-)

Index: working-2.6/arch/powerpc/boot/Makefile
===================================================================
--- working-2.6.orig/arch/powerpc/boot/Makefile	2007-12-18 14:30:51.000000000 +1100
+++ working-2.6/arch/powerpc/boot/Makefile	2007-12-18 14:33:22.000000000 +1100
@@ -112,17 +112,52 @@ $(patsubst %.S,%.o, $(filter %.S, $(src-
 $(obj)/wrapper.a: $(obj-wlib) FORCE
 	$(call if_changed,bootar)
 
-hostprogs-y	:= addnote addRamDisk hack-coff mktree
+hostprogs-y	:= addnote addRamDisk hack-coff mktree dtc
 
 targets		+= $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a)
 extra-y		:= $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \
 		   $(obj)/zImage.lds $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds
 
 wrapper		:=$(srctree)/$(src)/wrapper
-wrapperbits	:= $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree) \
+wrapperbits	:= $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree dtc) \
 			$(wrapper) FORCE
 
 #############
+# Bits for building dtc
+# DTC_GENPARSER      := 1    # Uncomment to rebuild flex/bison output
+
+dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o srcpos.o checks.o
+dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o
+dtc-objs := $(addprefix dtc-src/, $(dtc-objs))
+
+# prerequisites on generated files needs to be explicit
+$(obj)/dtc-src/dtc-parser.tab.o: $(obj)/dtc-src/dtc-parser.tab.c $(obj)/dtc-src/dtc-parser.tab.h
+$(obj)/dtc-src/dtc-lexer.lex.o:  $(obj)/dtc-src/dtc-lexer.lex.c $(obj)/dtc-src/dtc-parser.tab.h
+
+HOSTCFLAGS += -I$(src)/dtc-src/ -I$(src)/libfdt/
+
+targets += dtc-src/dtc-parser.tab.c
+targets += dtc-src/dtc-lexer.lex.c
+
+ifdef DTC_GENPARSER
+BISON = bison
+FLEX = flex
+
+quiet_cmd_bison = BISON   $@
+      cmd_bison = $(BISON) -o$@ -d $<; cp $@ $@_shipped
+quiet_cmd_flex = FLEX    $@
+      cmd_flex = $(FLEX) -o$@ $<; cp $@ $@_shipped
+
+$(obj)/dtc-src/dtc-parser.tab.c: $(src)/dtc-src/dtc-parser.y FORCE
+     $(call if_changed,bison)
+
+$(obj)/dtc-src/dtc-parser.tab.h: $(obj)/dtc-src/dtc-parser.tab.c
+
+$(obj)/dtc-src/dtc-lexer.lex.c: $(src)/dtc-src/dtc-lexer.l FORCE
+     $(call if_changed,flex)
+endif
+
+#############
 # Bits for building various flavours of zImage
 
 ifneq ($(CROSS32_COMPILE),)
Index: working-2.6/arch/powerpc/boot/wrapper
===================================================================
--- working-2.6.orig/arch/powerpc/boot/wrapper	2007-12-18 14:30:52.000000000 +1100
+++ working-2.6/arch/powerpc/boot/wrapper	2007-12-18 14:33:22.000000000 +1100
@@ -124,7 +124,7 @@ if [ -n "$dts" ]; then
     if [ -z "$dtb" ]; then
 	dtb="$platform.dtb"
     fi
-    dtc -O dtb -o "$dtb" -b 0 -V 16 "$dts"
+    $object/dtc -O dtb -o "$dtb" -b 0 "$dts"
 fi
 
 if [ -z "$kernel" ]; then


-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply

* How about the I2S audio driver for arch/powerpc within MPC5200B
From: TomX @ 2007-12-18  9:14 UTC (permalink / raw)
  To: linuxppc-embedded


Hi, all:

I am now using the sound/ppc/mpc52xx_aic26.c from snapshot of denx. And with
this, need use the arch/ppc, not the arch/powerpc. Is somebody have finished
change this files to arch/poweprc. I have try, but it seems a lot work
needed and must familar with arch/powerpc.

Many thanks,
Best Regards,
Tao
-- 
View this message in context: http://www.nabble.com/How-about-the-I2S-audio-driver-for-arch-powerpc-within-MPC5200B-tp14387041p14387041.html
Sent from the linuxppc-embedded mailing list archive at Nabble.com.

^ permalink raw reply

* Re: USB configuration
From: Misbah khan @ 2007-12-18  9:34 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <4766940E.4090801@freescale.com>


I have configured MPC82xx USB controler 
the debug msg is this " g_file_storage gadget: controller 'mpc8272_udc' not
recognized "
Is this the problem ?????

USB Led is also not glowing where in all the other configurations are
registered success ....viz

/----------------------------------------------------------------------------------------------------
7:255.255.248.0:cashel:eth1:off
PID hash table entries: 512 (order: 9, 8192 bytes)
hr_time_init: arch_to_nsec = 83886080, nsec_to_arch = 107374182
Warning: real time clock seems stuck!
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 62208k available (1952k kernel code, 588k data, 108k init, 0k
highmem)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
spawn_desched_task(00000000)
desched cpu_callback 3/00000000
ksoftirqd started up.
desched cpu_callback 2/00000000
desched thread 0 started up.
NET: Registered protocol family 16
mpc8272ads: Init
PCI: Probing PCI hardware
PCI: Cannot allocate resource region 0 of device 0000:00:00.0
PCI: Cannot allocate resource region 1 of device 0000:00:00.0
SCSI subsystem initialized
usbcore: registered new driver usbfs
usbcore: registered new driver hub
Serial: CPM driver $Revision: 0.01 $
ttyCPM0 at MMIO 0xf0011a00 (irq = 40) is a CPM UART
ttyCPM1 at MMIO 0xf0011a60 (irq = 43) is a CPM UART
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
loop: loaded (max 8 devices)
fs_enet.c:v1.0 (Aug 8, 2005)
fs_enet: eth0 Phy @ 0x0, type DM9161 (0x0181b881)
fs_enet: eth1 Phy @ 0x3, type DM9161 (0x0181b881)
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
st: Version 20041025, fixed bufsize 32768, s/g segs 256
osst :I: Tape driver with OnStream support version 0.99.1
osst :I: $Id: osst.c,v 1.70 2003/12/23 14:22:12 wriede Exp $
USB Universal Host Controller Interface driver v2.2
sl811: driver sl811-hcd, 06 Dec 2004
usbcore: registered new driver cdc_acm
drivers/usb/class/cdc-acm.c: v0.23:USB Abstract Control Model driver for USB
modems and ISDN adapters
drivers/usb/class/bluetty.c: USB Bluetooth support registered
usbcore: registered new driver bluetty
drivers/usb/class/bluetty.c: USB Bluetooth tty driver v0.13
usbcore: registered new driver usblp
drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver
Initializing USB Mass Storage driver...
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
MPC8272 USB peripheral device
g_file_storage gadget: controller 'mpc8272_udc' not recognized
g_file_storage gadget: no file given for LUN0
NET: Registered protocol family 2
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 4096 bind 8192)
NET: Registered protocol family 1
NET: Registered protocol family 17
IP-Config: Complete:
      device=eth1, addr=192.168.33.136, mask=255.255.248.0,
gw=192.168.32.47,
     host=cashel, domain=, nis-domain=(none),
     bootserver=192.168.33.96, rootserver=192.168.33.96, rootpath=
Looking up port of RPC 100003/2 on 192.168.33.96
Looking up port of RPC 100005/1 on 192.168.33.96
VFS: Mounted root (nfs filesystem).
Freeing unused kernel memory: 108k init
INIT: version 2.85 booting
Setting up IP spoofing protection: rp_filter.
Disable TCP/IP Explicit Congestion Notification: done.
Starting network interfaces: /sbin/ifup: interface lo already configured
done.
Starting portmap daemon: portmap.
INIT: Entering runlevel: 3
Starting internet superserver: inetd.

MontaVista(R) Linux(R) Professional Edition 4.0.1 (0502020)

----------------------------------------------------------------------------------------------------/

--------Misbah<><



Scott Wood-2 wrote:
> 
> Misbah khan wrote:
>> I have configured for mass storage device still i am not getting the
>> debug
>> msg that the kernel has detected the pen drive (after i connect the pen
>> drive ).
>> 
>>   " Initializing USB Mass Storage driver...
>>      usbcore: registered new driver usb-storage
>>      USB Mass Storage support registered. 
>>   "
> 
> Did you get any output indicating that the USB controller was found and 
> initialized?  This *is* a PCI-based OHCI controller you're trying to 
> use, and not the CPM USB, right?  Do other PCI devices work?
> 
> -Scott
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> 
> 

-- 
View this message in context: http://www.nabble.com/USB-configuration-tp14192347p14387839.html
Sent from the linuxppc-embedded mailing list archive at Nabble.com.

^ permalink raw reply

* Re: USB configuration
From: Misbah khan @ 2007-12-18  9:42 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <20071217213341.630cbdf5@kernel.crashing.org>


hi ...

The montavista version we are using is " 2.6.10_mvl401-8272ads " 

Montavista people says that they are supporting USB host interface ....

but still why i am facing the problem ????

Yes i have enabled generic support but i guess its fine ....

----Misbah <><



Vitaly Bordug-2 wrote:
> 
> On Thu, 6 Dec 2007 05:27:14 -0800 (PST)
> Misbah khan wrote:
> 
>> 
>> HI all ...
>> I have configured the Montavista Kernel for USB support and for
>> PPC8272-ADS board I need to know that how could i test that my USB is
>> working ????
>> 
> 
> I'm not sure what MV version you are trying to use, but there is no
> support for USB host(I am about 8272ads).
> MV supports USB gadget though...
>> Its creating the directory :- /proc/bus/usb/ but doesent contain any
>> file under it ????
>> 
> you enabled generic usb support. But no HW/driver picking it up
>> 
>> its also creating the directory :- /sys/bus/usb/   but doesent
>> contain any file under it ????
>> 
> same reason
>> 
>> Please let me know the procedure to test whether my USB configuration
>> is all right ????
>> 
> First, if you want to use USB host, you'll have to develop the driver
> first or assist someone doing that (there yet another such attempt
> recently initiated - see linuxppc-dev logs)
> 
>> Thank u 
>> Misbah <><
> 
> 
> -- 
> Sincerely, Vitaly
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> 
> 

-- 
View this message in context: http://www.nabble.com/USB-configuration-tp14192347p14389002.html
Sent from the linuxppc-embedded mailing list archive at Nabble.com.

^ permalink raw reply

* Re: [PATCH/RFC] [POWERPC] Add fixed-phy support for fs_enet
From: Jochen Friedrich @ 2007-12-18 10:13 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev, linux-kernel, linuxppc-dev
In-Reply-To: <4767042E.2070903@garzik.org>

Hi Jeff,

> ACK, pass this through paulus?

Yes, that's fine for me.

Thanks,
Jochen

^ permalink raw reply

* Re: [MPC5200] problem running FEC and ATA
From: Juergen Beisert @ 2007-12-18 10:41 UTC (permalink / raw)
  To: Arnon Kaufman; +Cc: linuxppc-dev
In-Reply-To: <47656048.7060809@gmail.com>

On Sunday 16 December 2007 18:28, Arnon Kaufman wrote:
> Robert Schwebel wrote:
>> On Sun, Dec 16, 2007 at 03:24:34PM +0200, Arnon Kaufman wrote:
>>> does any one succeed running a functional FEC and ATA (pata) running
>>> together?
>>
>> Yes, we do, on the phyCORE-MPC5200B-tiny; you can check our patches here:
>> http://www.pengutronix.de/oselas/bsp/phytec/download/phyCORE-MPC5200B-ti=
ny/
>
> thanks, my kernels are already patched and still observing that kind of
> behavior. I'm using Domen's new FEC code and ATA from 2.6.24-rc2.

I tried our kernel (see link above) with an external harddisk and NFS. I=20
copied various files from the harddisk to NFS root and vice versa. No data=
=20
corruption.

Can you check our patch stack on your hardware?

Juergen
=2D-=20
Dipl.-Ing. Juergen Beisert | http://www.pengutronix.de
=A0Pengutronix - Linux Solutions for Science and Industry
=A0   Handelsregister: Amtsgericht Hildesheim, HRA 2686
=A0 =A0 =A0    Vertretung Sued/Muenchen, Germany
   Phone: +49-8766-939 228 |  Fax: +49-5121-206917-9

^ permalink raw reply

* Re: Raising list size limit
From: Josh Boyer @ 2007-12-18 12:01 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: ppc-dev
In-Reply-To: <20071218143627.94f76142.sfr@canb.auug.org.au>

On Tue, 18 Dec 2007 14:36:27 +1100
Stephen Rothwell <sfr@canb.auug.org.au> wrote:

> Hi,
> 
> I am considering raising the limit on the size of postings to 400k.  Does
> anyone have a real problem with this?  Limiting message size was done to
> limit the damage of larges spams (and we don;t get very many of those on
> the list) and to ease the pain for people downloading emails over a slow
> (like dialup) link (and are there many of those left?).

Fine by me!

josh

^ permalink raw reply

* Re: [PATCH] Fix sleep on powerbook 3400
From: Johannes Berg @ 2007-12-18 11:28 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <18277.49950.354034.86146@cargo.ozlabs.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 462 bytes --]


> Sleep on the powerbook 3400 has been broken since the change that made
> powerbook_sleep_3400 call pmac_suspend_devices(), which disables
> interrupts.  There are a couple of loops in powerbook_sleep_3400 that
> depend on interrupts being enabled, and in fact it has to have
> interrupts enabled at the point of going to sleep since it is an
> interrupt from the PMU that wakes it up.

Do you want me to rebase my patches on top of this?

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply

* [PATCH] Platform Changes for UCC TDM driver for MPC8323ERDB. Also includes related QE changes.
From: Poonam_Aggrwal-b10812 @ 2007-12-18  9:02 UTC (permalink / raw)
  To: rubini, linuxppc-dev, netdev, kumar.gala
  Cc: michael.barkowski, rich.cutler, ashish.kalra

From: Poonam Aggrwal <b10812@freescale.com>

This patch makes necessary changes in the QE and UCC framework to support 
TDM. It also adds support to configure the BRG properly through device 
tree entries. Includes the device tree changes for UCC TDM driver as well.
It also includes device tree entries for UCC TDM driver.

Tested on MPC8323ERDB platform.


Signed-off-by: Poonam Aggrwal <b10812@freescale.com>
Signed-off-by: Ashish Kalra <ashish.kalra@freescale.com>
Signed-off-by: Kim Phillips <Kim.Phillips@freescale.com>
Signed-off-by: Michael Barkowski <michael.barkowski@freescale.com>
---
Incorporated comments of Stephen and Tabi. Please review if they look 
fine.

 arch/powerpc/boot/dts/mpc832x_rdb.dts |   58 +++++++
 arch/powerpc/sysdev/qe_lib/qe.c       |  205 ++++++++++++++++++++++++--
 arch/powerpc/sysdev/qe_lib/ucc.c      |  265 +++++++++++++++++++++++++++++++++
 arch/powerpc/sysdev/qe_lib/ucc_fast.c |   37 +++++
 include/asm-powerpc/qe.h              |    8 +
 include/asm-powerpc/ucc.h             |    4 +
 include/asm-powerpc/ucc_fast.h        |    4 +
 7 files changed, 568 insertions(+), 13 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index 388c8a7..c0e6283 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -105,6 +105,17 @@
 			device_type = "par_io";
 			num-ports = <7>;
 
+			ucc1pio:ucc_pin@01 {
+				pio-map = <
+			/* port  pin  dir  open_drain  assignment  has_irq */
+					0  e  2  0  1  0	/* CLK11 */
+					3 16  1  0  2  0	/* BRG9 */
+					3 1b  1  0  2  0	/* BRG3 */
+					0  0  3  0  2  0	/* TDMATxD0 */
+					0  4  3  0  2  0	/* TDMARxD0 */
+					3 1b  2  0  1  0>;	/* CLK1 */
+			};
+
 			ucc2pio:ucc_pin@02 {
 				pio-map = <
 			/* port  pin  dir  open_drain  assignment  has_irq */
@@ -169,6 +180,36 @@
 			};
 		};
 
+		clocks {
+			compatible = "fsl,cpm-clocks";
+			/* clock freqs in Hz(for CLK1~CLK24).
+			 * CLK11 is 1024KHz,
+			 * all other clocks unused
+			 * #clock-cells define number of cells
+			 * used by the clock-frequency.
+			 * right now only #clock cells=1 is
+			 * implemented. Provision is there to
+			 * handle frequencies >4Gig
+			 */
+			#clock-cells = <1>;
+			clock-frequency = <0 0 0 0 0 0
+					   0 0 0 0 d#1024000 0
+					   0 0 0 0 0 0
+					   0 0 0 0 0 0>;
+		};
+
+		brg@640 {
+			compatible = "fsl,cpm-brg";
+			/* input clock sources for all the 16 BRGs.
+			 * 1-24 for CLK1 to CLK24.
+			 * BRG9 uses CLK11,BRG1 and BRG2-8 use
+			 * the QE clock.
+			 */
+			fsl,brg-sources = <0 0 0 0 0 0 0 0
+					   b 0 0 0 0 0 0 0>;
+			reg = <640 7f>;
+		};
+
 		spi@4c0 {
 			device_type = "spi";
 			compatible = "fsl_spi";
@@ -187,6 +228,23 @@
 			mode = "cpu";
 		};
 
+		ucc@2000 {
+			device_type = "tdm";
+			compatible = "fsl,ucc-tdm";
+			model = "UCC";
+			device-id = <1>;
+			fsl,tdm-num = <1>;
+			fsl,si-num = <1>;
+			fsl,tdm-tx-clk = "CLK1";
+			fsl,tdm-rx-clk = "CLK1";
+			fsl,tdm-tx-sync = "BRG9";
+			fsl,tdm-rx-sync = "BRG9";
+			reg = <2000 200>;
+			interrupts = <20>;
+			interrupt-parent = <&qeic>;
+			pio-handle = <&ucc1pio>;
+		};
+
 		ucc@3000 {
 			device_type = "network";
 			compatible = "ucc_geth";
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index 1df3b4a..f1bc902 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -149,20 +149,189 @@ EXPORT_SYMBOL(qe_issue_cmd);
  */
 static unsigned int brg_clk = 0;
 
-unsigned int get_brg_clk(void)
+u32 get_brg_clk(enum qe_clock brgclk, enum qe_clock *brg_source)
 {
-	struct device_node *qe;
-	if (brg_clk)
-		return brg_clk;
+	struct device_node *qe, *brg, *clocks;
+	enum qe_clock brg_src;
+	u32 brg_input_freq = 0;
+	u32 brg_num;
+	int ret;
+	const unsigned int *prop;
 
-	qe = of_find_node_by_type(NULL, "qe");
-	if (qe) {
+	*brg_source = 0;
+
+	brg_num = brgclk - QE_BRG1;
+	brg = of_find_compatible_node(NULL, NULL, "fsl,cpm-brg");
+	if (brg) {
 		unsigned int size;
-		const u32 *prop = of_get_property(qe, "brg-frequency", &size);
-		brg_clk = *prop;
-		of_node_put(qe);
-	};
-	return brg_clk;
+		prop = of_get_property(brg,
+					"fsl,brg-sources", &size);
+		of_node_put(brg);
+
+		if (prop && *prop >= 1 && *prop <= 24)
+			brg_src = *(prop + brg_num);
+		else {
+			printk(KERN_ERR "%s: invalid fsl,brg-sources in device "
+				"tree\n", __FUNCTION__);
+			ret = -EINVAL;
+			goto err;
+		}
+		if (brg_src == 0) {
+			*brg_source = 0;
+			if (brg_clk > 0)
+				return brg_clk;
+			qe = of_find_node_by_type(NULL, "qe");
+			if (qe) {
+				unsigned int size;
+				prop = of_get_property
+						(qe, "brg-frequency", &size);
+				if (!prop) {
+					printk(KERN_ERR "%s: QE brg-frequency"
+						"not present in device tree\n",
+						 __FUNCTION__);
+					ret = -EINVAL;
+					of_node_put(qe);
+					goto err;
+				}
+				if (*prop) {
+					of_node_put(qe);
+					brg_clk = *prop;
+					return *prop;
+				} else {
+				/*
+				 * Older versions of U-Boot do not initialize
+				 * the brg-frequency property, so in this case
+				 * we assume the BRG frequency is half the QE
+				 * bus frequency.
+				 */
+					prop = of_get_property(qe,
+						 "bus-frequency", NULL);
+					of_node_put(qe);
+					if (!prop) {
+						printk(KERN_ERR "%s: "
+						" QE bus-frequency not present"
+						" in device tree\n",
+						 __FUNCTION__);
+						ret = -EINVAL;
+						goto err;
+					}
+					if (*prop) {
+						brg_clk = *prop / 2;
+						return brg_clk;
+					} else {
+						printk(KERN_ERR "%s: invalid"
+						" QE bus-frequency in device"
+						" tree\n", __FUNCTION__);
+						ret = -EINVAL;
+						goto err;
+					}
+				}
+			} else {
+				printk(KERN_ERR "%s: no qe node in device tree"
+					"\n", __FUNCTION__);
+				ret = EINVAL;
+				goto err;
+			}
+		} else {
+			*brg_source = brg_src + QE_CLK1 - 1;
+			clocks = of_find_compatible_node(NULL, NULL,
+							"fsl,cpm-clocks");
+			if (!clocks) {
+				printk(KERN_ERR "%s: no clocks node in device"
+					" tree \n", __FUNCTION__);
+				ret = -EINVAL;
+				goto err;
+			} else {
+				prop = of_get_property(clocks,
+						"#clock-cells", &size);
+				/*
+				 * clock-cells = 1 only supported right now.
+				 */
+				if (!prop || *prop != 1) {
+					printk(KERN_ERR "%s: invalid "
+					"#clock-cells value in device tree \n",
+					 __FUNCTION__);
+					of_node_put(clocks);
+					ret = -EINVAL;
+					goto err;
+				}
+
+				prop = of_get_property(clocks,
+						"clock-frequency", &size);
+				if (!prop) {
+					printk(KERN_ERR "%s: no"
+					" #clock-frequency prop in device"
+					" tree\n", __FUNCTION__);
+					of_node_put(clocks);
+					ret = -EINVAL;
+					goto err;
+				}
+				brg_input_freq = *(prop+(brg_src - 1));
+				of_node_put(clocks);
+				return brg_input_freq;
+			}
+		}
+	} else {
+		printk(KERN_ERR "%s: no brg node in device tree\n",
+			 __FUNCTION__);
+		ret = -EINVAL;
+		goto err;
+	}
+err: return ret;
+}
+
+u32 qe_brg_src(int brg_num, enum qe_clock brg_src)
+{
+	u32 clock_bits, shift;
+
+	clock_bits = 0;
+
+	switch (brg_num) {
+	case 1:
+	case 2:
+	case 5:
+	case 6:
+		switch (brg_src) {
+		case QE_CLK3:   clock_bits = 1; break;
+		case QE_CLK5:   clock_bits = 2; break;
+		default: break;
+		}
+		break;
+	case 3:
+	case 4:
+	case 7:
+	case 8:
+		switch (brg_src) {
+		case QE_CLK9:    clock_bits = 1; break;
+		case QE_CLK15:   clock_bits = 2; break;
+		default: break;
+		}
+		break;
+	case 9:
+	case 10:
+		switch (brg_src) {
+		case QE_CLK11:    clock_bits = 1; break;
+		default: break;
+		}
+		break;
+	case 11:
+	case 15:
+	case 16:
+		switch (brg_src) {
+		case QE_CLK13:    clock_bits = 1; break;
+		default: break;
+		}
+		break;
+	default: clock_bits = 0; break;
+	}
+	shift = 14;
+
+	if (!clock_bits)
+		return -ENOENT;
+
+	clock_bits <<= shift;
+
+	return clock_bits;
 }
 
 /* Program the BRG to the given sampling rate and multiplier
@@ -177,11 +346,18 @@ int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier)
 {
 	u32 divisor, tempval;
 	u32 div16 = 0;
+	u32 brg_clock;
+	enum qe_clock brgsrc;
+	u32 src_bits = 0;
 
 	if ((brg < QE_BRG1) || (brg > QE_BRG16))
 		return -EINVAL;
 
-	divisor = get_brg_clk() / (rate * multiplier);
+	brg_clock = get_brg_clk(brg, &brgsrc);
+	if (brg_clock < 0)
+		return -EINVAL;
+
+	divisor = brg_clock / (rate * multiplier);
 
 	if (divisor > QE_BRGC_DIVISOR_MAX + 1) {
 		div16 = QE_BRGC_DIV16;
@@ -194,8 +370,11 @@ int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier)
 	if (!div16 && (divisor & 1))
 		divisor++;
 
+	if (brgsrc > 0)
+		src_bits = qe_brg_src(brg - QE_BRG1 + 1, brgsrc);
+
 	tempval = ((divisor - 1) << QE_BRGC_DIVISOR_SHIFT) |
-		QE_BRGC_ENABLE | div16;
+		QE_BRGC_ENABLE | div16 | src_bits;
 
 	out_be32(&qe_immr->brg.brgc[brg - QE_BRG1], tempval);
 
diff --git a/arch/powerpc/sysdev/qe_lib/ucc.c b/arch/powerpc/sysdev/qe_lib/ucc.c
index 0e348d9..f2de0ed 100644
--- a/arch/powerpc/sysdev/qe_lib/ucc.c
+++ b/arch/powerpc/sysdev/qe_lib/ucc.c
@@ -213,3 +213,268 @@ int ucc_set_qe_mux_rxtx(unsigned int ucc_num, enum qe_clock clock,
 
 	return 0;
 }
+
+int ucc_set_tdm_rxtx_clk(int tdm_num, char *clk_src, enum comm_dir mode)
+{
+	enum qe_clock clock;
+	u32 clock_bits, shift;
+	struct qe_mux *qe_mux_reg = NULL;
+
+	clock_bits = 0;
+	qe_mux_reg = &qe_immr->qmx;
+
+	if ((tdm_num > 3 || tdm_num < 0))
+		return -EINVAL;
+
+	/* The communications direction must be RX or TX */
+	if (!((mode == COMM_DIR_RX) || (mode == COMM_DIR_TX)))
+		return -EINVAL;
+
+	clock = qe_clock_source(clk_src);
+	switch (mode) {
+	case COMM_DIR_RX:
+		switch (tdm_num) {
+		case 0:
+			switch (clock) {
+			case QE_BRG3:   clock_bits = 1; break;
+			case QE_BRG4:   clock_bits = 2; break;
+			case QE_CLK1:   clock_bits = 4; break;
+			case QE_CLK2:   clock_bits = 5; break;
+			case QE_CLK3:   clock_bits = 6; break;
+			case QE_CLK8:   clock_bits = 7; break;
+			default: break;
+			}
+			shift = 28;
+			break;
+		case 1:
+			switch (clock) {
+			case QE_BRG3:   clock_bits = 1; break;
+			case QE_BRG4:   clock_bits = 2; break;
+			case QE_CLK1:   clock_bits = 4; break;
+			case QE_CLK2:   clock_bits = 5; break;
+			case QE_CLK5:   clock_bits = 6; break;
+			case QE_CLK10:  clock_bits = 7; break;
+			default: break;
+			}
+			shift = 24;
+			break;
+		case 2:
+			switch (clock) {
+			case QE_BRG3:   clock_bits = 1; break;
+			case QE_BRG4:   clock_bits = 2; break;
+			case QE_CLK1:   clock_bits = 4; break;
+			case QE_CLK2:   clock_bits = 5; break;
+			case QE_CLK7:   clock_bits = 6; break;
+			case QE_CLK12:  clock_bits = 7; break;
+			default: break;
+			}
+			shift = 20;
+			break;
+		case 3:
+			switch (clock) {
+			case QE_BRG3:   clock_bits = 1; break;
+			case QE_BRG4:   clock_bits = 2; break;
+			case QE_CLK1:   clock_bits = 4; break;
+			case QE_CLK2:   clock_bits = 5; break;
+			case QE_CLK9:   clock_bits = 6; break;
+			case QE_CLK14:  clock_bits = 7; break;
+			default: break;
+			}
+			shift = 16;
+			break;
+		default:
+			break;
+		}
+		break;
+	case COMM_DIR_TX:
+		switch (tdm_num) {
+		case 0:
+			switch (clock) {
+			case QE_BRG3:   clock_bits = 1; break;
+			case QE_BRG4:   clock_bits = 2; break;
+			case QE_CLK1:   clock_bits = 4; break;
+			case QE_CLK2:   clock_bits = 5; break;
+			case QE_CLK4:   clock_bits = 6; break;
+			case QE_CLK9:   clock_bits = 7; break;
+			default: break;
+			}
+			shift = 12;
+			break;
+		case 1:
+			switch (clock) {
+			case QE_BRG3:   clock_bits = 1; break;
+			case QE_BRG4:   clock_bits = 2; break;
+			case QE_CLK1:   clock_bits = 4; break;
+			case QE_CLK2:   clock_bits = 5; break;
+			case QE_CLK6:   clock_bits = 6; break;
+			case QE_CLK11:  clock_bits = 7; break;
+			default: break;
+			}
+			shift = 8;
+			break;
+		case 2:
+			switch (clock) {
+			case QE_BRG3:   clock_bits = 1; break;
+			case QE_BRG4:   clock_bits = 2; break;
+			case QE_CLK1:   clock_bits = 4; break;
+			case QE_CLK2:   clock_bits = 5; break;
+			case QE_CLK8:   clock_bits = 6; break;
+			case QE_CLK13:  clock_bits = 7; break;
+			default: break;
+			}
+			shift = 4;
+			break;
+		case 3:
+			switch (clock) {
+			case QE_BRG3:   clock_bits = 1; break;
+			case QE_BRG4:   clock_bits = 2; break;
+			case QE_CLK1:   clock_bits = 4; break;
+			case QE_CLK2:   clock_bits = 5; break;
+			case QE_CLK10:  clock_bits = 6; break;
+			case QE_CLK15:  clock_bits = 7; break;
+			default: break;
+			}
+			shift = 0;
+			break;
+		default:
+			break;
+		}
+		break;
+	default:
+		break;
+	}
+
+	if (!clock_bits)
+		return -ENOENT;
+
+	clock_bits <<= shift;
+
+	qe_mux_reg->cmxsi1cr_l |= clock_bits;
+
+	return 0;
+}
+
+int ucc_set_tdm_rxtx_sync(int tdm_num, char *sync_src, enum comm_dir mode)
+{
+	enum qe_clock clock;
+	u32 shift, clock_bits;
+	struct qe_mux *qe_mux_reg = NULL;
+	int source;
+
+	source = -1;
+	qe_mux_reg = &qe_immr->qmx;
+
+	if ((tdm_num > 3 || tdm_num < 0))
+		return -EINVAL;
+
+	/* The communications direction must be RX or TX */
+	if (!((mode == COMM_DIR_RX) || (mode == COMM_DIR_TX)))
+		return -EINVAL;
+
+	switch (mode) {
+	case COMM_DIR_RX:
+		if (strcasecmp("RSYNC", sync_src) == 0) {
+			source = 0;
+			shift = 0;
+			break;
+		}
+		clock = qe_clock_source(sync_src);
+		switch (tdm_num) {
+		case 0:
+			switch (clock) {
+			case QE_BRG9:   source = 1; break;
+			case QE_BRG10:  source = 2; break;
+			default: source = -1; break;
+			}
+			shift = 30;
+			break;
+		case 1:
+			switch (clock) {
+			case QE_BRG9:   source = 1; break;
+			case QE_BRG10:  source = 2; break;
+			default: source = -1; break;
+			}
+			shift = 28;
+			break;
+		case 2:
+			switch (clock) {
+			case QE_BRG9:   source = 1; break;
+			case QE_BRG11:  source = 2; break;
+			default: source = -1; break;
+			}
+			shift = 26;
+			break;
+		case 3:
+			switch (clock) {
+			case QE_BRG9:   source = 1; break;
+			case QE_BRG11:  source = 2; break;
+			default: source = -1; break;
+			}
+			shift = 24;
+			break;
+		default:
+			source = -1;
+			break;
+		}
+		break;
+	case COMM_DIR_TX:
+		if (strcasecmp("TSYNC", sync_src) == 0) {
+			source = 0;
+			shift = 0;
+			break;
+		}
+		clock = qe_clock_source(sync_src);
+		switch (tdm_num) {
+		case 0:
+			switch (clock) {
+			case QE_BRG9:   source = 1; break;
+			case QE_BRG10:  source = 2; break;
+			default: source = -1; break;
+			}
+			shift = 14;
+			break;
+		case 1:
+			switch (clock) {
+			case QE_BRG9:   source = 1; break;
+			case QE_BRG10:  source = 2; break;
+			default: source = -1; break;
+			}
+			shift = 12;
+			break;
+		case 2:
+			switch (clock) {
+			case QE_BRG9:   source = 1; break;
+			case QE_BRG11:  source = 2; break;
+			default: source = -1; break;
+			}
+			shift = 10;
+			break;
+		case 3:
+			switch (clock) {
+			case QE_BRG9:   source = 1; break;
+			case QE_BRG11:  source = 2; break;
+			default: source = -1; break;
+			}
+			shift = 8;
+			break;
+		default:
+			source = -1;
+			break;
+		}
+		break;
+	default:
+		source = -1;
+		break;
+	}
+
+	if (source == -1)
+		return -ENOENT;
+
+	clock_bits = (u32) source;
+	clock_bits <<= shift;
+
+
+	qe_mux_reg->cmxsi1syr  |= clock_bits;
+
+	return 0;
+}
diff --git a/arch/powerpc/sysdev/qe_lib/ucc_fast.c b/arch/powerpc/sysdev/qe_lib/ucc_fast.c
index 3223acb..9c8559f 100644
--- a/arch/powerpc/sysdev/qe_lib/ucc_fast.c
+++ b/arch/powerpc/sysdev/qe_lib/ucc_fast.c
@@ -327,6 +327,43 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
 			ucc_fast_free(uccf);
 			return -EINVAL;
 		}
+	} else {
+		/* TDM Rx clock routing */
+		if ((uf_info->tdm_rx_clk != NULL) &&
+			ucc_set_tdm_rxtx_clk(uf_info->ucc_num,
+				uf_info->tdm_rx_clk, COMM_DIR_RX)) {
+			printk(KERN_ERR "%s: illegal value for TDM RX clock",
+				__FUNCTION__);
+			ucc_fast_free(uccf);
+			return -EINVAL;
+		}
+		/* TDM Tx clock routing */
+		if ((uf_info->tdm_tx_clk != NULL) &&
+			ucc_set_tdm_rxtx_clk(uf_info->ucc_num,
+				uf_info->tdm_tx_clk, COMM_DIR_TX)) {
+			printk(KERN_ERR "%s: illegal value for TDM TX clock",
+				__FUNCTION__);
+			ucc_fast_free(uccf);
+			return -EINVAL;
+		}
+		/* TDM Rx sync routing */
+		if ((uf_info->tdm_rx_sync != NULL) &&
+			ucc_set_tdm_rxtx_sync(uf_info->ucc_num,
+				uf_info->tdm_rx_sync, COMM_DIR_RX)) {
+			printk(KERN_ERR "%s: illegal value for TDM RX"
+				"Frame sync", __FUNCTION__);
+			ucc_fast_free(uccf);
+			return -EINVAL;
+		}
+		/* TDM Tx sync routing */
+		if ((uf_info->tdm_tx_sync != NULL) &&
+			ucc_set_tdm_rxtx_sync(uf_info->ucc_num,
+				uf_info->tdm_tx_sync, COMM_DIR_TX)) {
+			printk(KERN_ERR "%s: illegal value for TDM TX"
+					"Frame sync", __FUNCTION__);
+			ucc_fast_free(uccf);
+			return -EINVAL;
+		}
 	}
 
 	/* Set interrupt mask register at UCC level. */
diff --git a/include/asm-powerpc/qe.h b/include/asm-powerpc/qe.h
index bcf60be..51de236 100644
--- a/include/asm-powerpc/qe.h
+++ b/include/asm-powerpc/qe.h
@@ -497,6 +497,14 @@ struct ucc_slow_pram {
 #define UCC_GETH_UCCE_RXF1      0x00000002
 #define UCC_GETH_UCCE_RXF0      0x00000001
 
+/* Transparent UCC Event Register (UCCE) */
+#define UCC_TRANS_UCCE_GRA	0x0080
+#define UCC_TRANS_UCCE_TXE	0x0010
+#define UCC_TRANS_UCCE_RXF	0x0008
+#define UCC_TRANS_UCCE_BSY	0x0004
+#define UCC_TRANS_UCCE_TXB	0x0002
+#define UCC_TRANS_UCCE_RXB	0x0001
+
 /* UPSMR, when used as a UART */
 #define UCC_UART_UPSMR_FLC		0x8000
 #define UCC_UART_UPSMR_SL		0x4000
diff --git a/include/asm-powerpc/ucc.h b/include/asm-powerpc/ucc.h
index 46b09ba..153db97 100644
--- a/include/asm-powerpc/ucc.h
+++ b/include/asm-powerpc/ucc.h
@@ -42,6 +42,10 @@ int ucc_set_qe_mux_mii_mng(unsigned int ucc_num);
 int ucc_set_qe_mux_rxtx(unsigned int ucc_num, enum qe_clock clock,
 	enum comm_dir mode);
 
+int ucc_set_tdm_rxtx_clk(int tdm_num, char *clk_src, enum comm_dir mode);
+
+int ucc_set_tdm_rxtx_sync(int tdm_num, char *clk_src, enum comm_dir mode);
+
 int ucc_mux_set_grant_tsa_bkpt(unsigned int ucc_num, int set, u32 mask);
 
 /* QE MUX clock routing for UCC
diff --git a/include/asm-powerpc/ucc_fast.h b/include/asm-powerpc/ucc_fast.h
index f529f70..d267983 100644
--- a/include/asm-powerpc/ucc_fast.h
+++ b/include/asm-powerpc/ucc_fast.h
@@ -152,6 +152,10 @@ struct ucc_fast_info {
 	enum ucc_fast_rx_decoding_method renc;
 	enum ucc_fast_transparent_tcrc tcrc;
 	enum ucc_fast_sync_len synl;
+	char *tdm_rx_clk;
+	char *tdm_tx_clk;
+	char *tdm_rx_sync;
+	char *tdm_tx_sync;
 };
 
 struct ucc_fast_private {
-- 
1.5.3.3

^ permalink raw reply related

* Re: dtc: Remove remaining old-style checks
From: Jon Loeliger @ 2007-12-18 13:56 UTC (permalink / raw)
  To: David Gibson; +Cc: linuxppc-dev
In-Reply-To: <20071218035438.GA10348@localhost.localdomain>

So, like, the other day David Gibson mumbled:
> The remaining old-style tree checking code: check_root(), check_cpus()
> and check_memory() really aren't that useful.  They mostly check for
> the presence of particular nodes and properties.  That's inherently
> prone to false-positives, because we could be dealing with an
> artificial tree (like many of the testcases) or it could be expected
> that the missing properties are filled in by a bootloader or other
> agent.
> 
> If any of these checks really turns out to be useful, we can
> reimplement them later in a better conceived way on top of the new
> checking infrastructure.  For now, just get rid of them, removing the
> last vestiges of the old-style checking code (hoorah).
> 
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

Applied.

Thanks,
jdl

^ permalink raw reply

* Re: [PATCH/RFC] [POWERPC] Add fixed-phy support for fs_enet
From: Vitaly Bordug @ 2007-12-18 15:10 UTC (permalink / raw)
  To: Jochen Friedrich; +Cc: linuxppc-dev, linux-kernel, Jeff Garzik, netdev
In-Reply-To: <4767042E.2070903@garzik.org>

On Mon, 17 Dec 2007 18:20:14 -0500
Jeff Garzik wrote:

> Jochen Friedrich wrote:
> > This patch adds support to use the fixed-link property
> > of an ethernet node to fs_enet for the
> > CONFIG_PPC_CPM_NEW_BINDING case.
> > 
> > Signed-off-by: Jochen Friedrich <jochen@scram.de>
Acked-by: Vitaly Bordug <vitb@kernel.crashing.org>

Jochen,
will you resend the patch with all acks to paulus? I'll do that if not.


-- 
Sincerely, Vitaly

^ permalink raw reply

* [PATCH] [POWERPC] Add fixed-phy support for fs_enet
From: Jochen Friedrich @ 2007-12-18 15:25 UTC (permalink / raw)
  To: Paul Mackerras, Vitaly Bordug
  Cc: linuxppc-dev, Garzik, Jeff, Kernel, Linux, netdev

This patch adds support to use the fixed-link property
of an ethernet node to fs_enet for the
CONFIG_PPC_CPM_NEW_BINDING case.

Signed-off-by: Jochen Friedrich <jochen@scram.de>
Acked-by: Jeff Garzik <jeff@garzik.org>
Acked-by: Vitali Bordug <vitb@kernel.crashing.org>
---
 drivers/net/fs_enet/fs_enet-main.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c
index f2a4d39..8220c70 100644
--- a/drivers/net/fs_enet/fs_enet-main.c
+++ b/drivers/net/fs_enet/fs_enet-main.c
@@ -1174,8 +1174,15 @@ static int __devinit find_phy(struct device_node *np,
 	struct device_node *phynode, *mdionode;
 	struct resource res;
 	int ret = 0, len;
+	const u32 *data;
+
+	data  = of_get_property(np, "fixed-link", NULL);
+	if (data) {
+		snprintf(fpi->bus_id, 16, PHY_ID_FMT, 0, *data);
+		return 0;
+	}

-	const u32 *data = of_get_property(np, "phy-handle", &len);
+	data = of_get_property(np, "phy-handle", &len);
 	if (!data || len != 4)
 		return -EINVAL;

-- 
1.5.3.7

^ permalink raw reply related

* Re: [PATCH] [POWERPC][RFC] MPC8360E-RDK: Device tree and board file
From: Kumar Gala @ 2007-12-18 15:53 UTC (permalink / raw)
  To: avorontsov; +Cc: Stephen Rothwell, linuxppc-dev
In-Reply-To: <20071215162331.GA24999@localhost.localdomain>


On Dec 15, 2007, at 10:23 AM, Anton Vorontsov wrote:

>
> +		i2c@3000 {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +			device_type = "i2c";
> +			compatible = "fsl-i2c";
> +			reg = <0x3000 0x100>;
> +			interrupts = <14 8>;
> +			interrupt-parent = <&ipic>;
> +			dfsrr;
> +		};
> +
> +		i2c@3100 {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +			device_type = "i2c";
> +			compatible = "fsl-i2c";
> +			reg = <0x3100 0x100>;
> +			interrupts = <16 8>;
> +			interrupt-parent = <&ipic>;
> +			dfsrr;
> +		};
> +

In addition to David's comments.  I've added cell-index:

                 i2c@3000 {
                         #address-cells = <1>;
                         #size-cells = <0>;
                         cell-index = <0>;
                         compatible = "fsl-i2c";
                         reg = <3000 100>;
                         interrupts = <e 8>;
                         interrupt-parent = < &ipic >;
                         dfsrr;
                 };

                 i2c@3100 {
                         #address-cells = <1>;
                         #size-cells = <0>;
                         cell-index = <1>;
                         compatible = "fsl-i2c";
                         reg = <3100 100>;
                         interrupts = <f 8>;
                         interrupt-parent = < &ipic >;
                         dfsrr;
                 };

^ permalink raw reply

* Re: [PATCH 1/7] Copy mpc-i2c to preserve support for ARCH=ppc and allow changes on ARCH=powerpc
From: Kumar Gala @ 2007-12-18 15:53 UTC (permalink / raw)
  To: Jon Smirl; +Cc: linuxppc-dev, i2c, linux-kernel
In-Reply-To: <20071218023915.8530.67500.stgit@terra.home>


On Dec 17, 2007, at 8:39 PM, Jon Smirl wrote:

> Temporarily copy the mpc-i2c driver to continue support for the ppc  
> architecture until it is removed in mid-2008. This file should be  
> deleted as part of ppc's final removal.
>
> Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
>
> Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
>
> Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
> ---
>
> arch/ppc/configs/TQM8540_defconfig     |    2
> arch/ppc/configs/TQM8541_defconfig     |    2
> arch/ppc/configs/TQM8555_defconfig     |    2
> arch/ppc/configs/TQM8560_defconfig     |    2
> arch/ppc/configs/mpc834x_sys_defconfig |    2
> arch/ppc/configs/mpc8540_ads_defconfig |    2
> arch/ppc/configs/mpc8548_cds_defconfig |    2
> arch/ppc/configs/mpc8555_cds_defconfig |    2
> arch/ppc/configs/mpc8560_ads_defconfig |    2
> drivers/i2c/busses/Kconfig             |   16 +
> drivers/i2c/busses/Makefile            |    1
> drivers/i2c/busses/i2c-mpc-ppc.c       |  418 +++++++++++++++++++++++ 
> +++++++++
> 12 files changed, 443 insertions(+), 10 deletions(-)
> create mode 100644 drivers/i2c/busses/i2c-mpc-ppc.c

Nak.

Just ifdef the probe functionality in i2c-mpc.c based on  
CONFIG_PPC_MERGE.  Your patch set shows the reason you should do  
this.  You provide fixes to the error path handling, but only for i2c- 
mpc.c and not i2c-mpc-ppc.c.

- k

^ permalink raw reply

* Re: Raising list size limit
From: Kumar Gala @ 2007-12-18 15:54 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: ppc-dev
In-Reply-To: <20071218060105.368f0bd4@zod.rchland.ibm.com>


On Dec 18, 2007, at 6:01 AM, Josh Boyer wrote:

> On Tue, 18 Dec 2007 14:36:27 +1100
> Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
>> Hi,
>>
>> I am considering raising the limit on the size of postings to  
>> 400k.  Does
>> anyone have a real problem with this?  Limiting message size was  
>> done to
>> limit the damage of larges spams (and we don;t get very many of  
>> those on
>> the list) and to ease the pain for people downloading emails over a  
>> slow
>> (like dialup) link (and are there many of those left?).
>
> Fine by me!

Do you really have patches that are 400k?

- k

^ permalink raw reply

* Re: Raising list size limit
From: Olof Johansson @ 2007-12-18 16:12 UTC (permalink / raw)
  To: Kumar Gala; +Cc: Stephen Rothwell, ppc-dev
In-Reply-To: <2420E261-C9AB-49B8-8F99-C24C7A865044@kernel.crashing.org>

On Tue, Dec 18, 2007 at 09:54:15AM -0600, Kumar Gala wrote:
> 
> On Dec 18, 2007, at 6:01 AM, Josh Boyer wrote:
> 
> > On Tue, 18 Dec 2007 14:36:27 +1100
> > Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> >> Hi,
> >>
> >> I am considering raising the limit on the size of postings to  
> >> 400k.  Does
> >> anyone have a real problem with this?  Limiting message size was  
> >> done to
> >> limit the damage of larges spams (and we don;t get very many of  
> >> those on
> >> the list) and to ease the pain for people downloading emails over a  
> >> slow
> >> (like dialup) link (and are there many of those left?).
> >
> > Fine by me!
> 
> Do you really have patches that are 400k?

I'm guessing stuff such as "dtc merge" could reach those sizes?

Since it's somewhat common to cross-post patches (especially some of the
@de.ibm.com guys seem to post to 2-5 lists at a time), having a limit
higher than other lists could mean we see the same (large) patches several
times in case they bounce from other lists and get reposted. But it should
be a small fraction of the traffic no matter what.


-Olof

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox