LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* 2.6.25: pmac_newworld undefined
From: Christian Kujau @ 2008-04-27 18:03 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: LKML

Hi,

the build failure reported[0] by Kamalesh back in 01/2008 is still 
present in today's 2.6.25-git with CONFIG_NVRAM=m (instead of =y):

   Building modules, stage 2.
   MODPOST 72 modules
ERROR: "pmac_newworld" [arch/powerpc/platforms/powermac/nvram.ko] undefined!
ERROR: "__alloc_bootmem" [arch/powerpc/platforms/powermac/nvram.ko] undefined!
make[1]: *** [__modpost] Error 1

Full .config and make.log: http://nerdbynature.de/bits/2.6.25/nvram/

I could not find an #ifdef or sth. around pmac_newworld....

Thanks,
Christian.

[0] http://lkml.org/lkml/2008/1/17/55
-- 
BOFH excuse #187:

Reformatting Page. Wait...

^ permalink raw reply

* filenames with spaces in /sys?
From: Christian Kujau @ 2008-04-27 18:35 UTC (permalink / raw)
  To: dwmw2; +Cc: linuxppc-dev

Hi,

I was a bit puzzled today when I came across
/sys/devices/platform/pmu-battery.0/power_supply/PMU battery 0/power
and thought to myself: why are there spaces in "PMU battery 0"? Wouldn't
../pmu-battery.0/power_supply/PMU_battery_0/power be feasible too? I find 
it rather annoying to special case the spaces whenever to look for 
something in /sys, when I'm so used not to when doing the same 
find/grep/xargs stuff in /usr/src/linux.

There are ~2000 directories in my /sys but only a handful contain spaces:

# find /sys/ -type d -regex '.*\ .*' | sort -u
/sys/bus/mdio_bus/drivers/Broadcom BCM5411
/sys/bus/mdio_bus/drivers/Broadcom BCM5421
/sys/bus/mdio_bus/drivers/Broadcom BCM5461
/sys/bus/mdio_bus/drivers/Broadcom BCM5464
/sys/bus/mdio_bus/drivers/Broadcom BCM5481
/sys/bus/mdio_bus/drivers/Broadcom BCM5482
/sys/bus/mdio_bus/drivers/Generic PHY
/sys/devices/platform/pmu-battery.0/power_supply/PMU battery 0
/sys/devices/platform/pmu-battery.0/power_supply/PMU battery 0/power

Hm, OTOH /proc also does contain some elements with spaces in it (e.g. 
/proc/irq/47/GPIO1 ADB)...so, in short: would patches be accepted to
turn ' ' into '_' again (if they don't break too much userspace stuff)?

Thanks,
Christian.
-- 
BOFH excuse #373:

Suspicious pointer corrupted virtual machine

^ permalink raw reply

* Re: filenames with spaces in /sys?
From: David Woodhouse @ 2008-04-27 18:54 UTC (permalink / raw)
  To: Christian Kujau; +Cc: linuxppc-dev
In-Reply-To: <alpine.DEB.1.10.0804272012000.11017@sheep.housecafe.de>

On Sun, 2008-04-27 at 20:35 +0200, Christian Kujau wrote:
> 
> /sys/devices/platform/pmu-battery.0/power_supply/PMU battery 0
> /sys/devices/platform/pmu-battery.0/power_supply/PMU battery 0/power
> 
> Hm, OTOH /proc also does contain some elements with spaces in it (e.g. 
> /proc/irq/47/GPIO1 ADB)...so, in short: would patches be accepted to
> turn ' ' into '_' again (if they don't break too much userspace stuff)?

I see no reason not to for the battery class, certainly.

-- 
dwmw2

^ permalink raw reply

* Re: [RESEND][PATCH][POWERPC] PIKA Warp: Update platform code to supportRev B boards
From: Sean MacLennan @ 2008-04-27 19:25 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <20080417152251.2bf07219@lappy.seanm.ca>

Update. HW decided that the panic was bad. Added a flashing led to the
critical temperature.

Cheers,
   Sean

PIKA Warp: Update platform code to support Rev B boards.
* Switched from 64M NOR/64M NAND to 4M NOR/256M NAND.
* Full DTM support including critical temperature.
* Added POST information.
* Removed LED function, moved to new LED driver.
* Moved ad7414 to new style I2C initialization.

Signed-off-by: Sean MacLennan <smaclennan@pikatech.com>

diff --git a/arch/powerpc/boot/cuboot-warp.c b/arch/powerpc/boot/cuboot-warp.c
index eb108a8..2178021 100644
--- a/arch/powerpc/boot/cuboot-warp.c
+++ b/arch/powerpc/boot/cuboot-warp.c
@@ -10,6 +10,7 @@
 #include "ops.h"
 #include "4xx.h"
 #include "cuboot.h"
+#include "stdio.h"

 #define TARGET_4xx
 #define TARGET_44x
@@ -17,0 +18,0 @@

 static bd_t bd;

-static void warp_fixups(void)
+static void warp_fixup_one_nor(u32 from, u32 to)
 {
-	unsigned long sysclk = 66000000;
+	void *devp;
+	char name[50];
+	u32 v[2];
+
+	sprintf(name, "/plb/opb/ebc/nor_flash@0,0/partition@%x", from);
+
+	devp = finddevice(name);
+	if (!devp)
+		return;
+
+	if (getprop(devp, "reg", v, sizeof(v)) == sizeof(v)) {
+		v[0] = to;
+		setprop(devp, "reg", v, sizeof(v));
+
+		printf("NOR 64M fixup %x -> %x\r\n", from, to);
+	}
+}
+
 
-	ibm440ep_fixup_clocks(sysclk, 11059200, 50000000);
+static void warp_fixups(void)
+{
+	ibm440ep_fixup_clocks(66000000, 11059200, 50000000);
 	ibm4xx_sdram_fixup_memsize();
 	ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
 	dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
+
+	/* Fixup for 64M flash on Rev A boards. */
+	if (bd.bi_flashsize == 0x4000000) {
+		void *devp;
+		u32 v[3];
+
+		devp = finddevice("/plb/opb/ebc/nor_flash@0,0");
+		if (!devp)
+			return;
+
+		/* Fixup the size */
+		if (getprop(devp, "reg", v, sizeof(v)) == sizeof(v)) {
+			v[2] = bd.bi_flashsize;
+			setprop(devp, "reg", v, sizeof(v));
+		}
+
+		/* Fixup parition offsets */
+		warp_fixup_one_nor(0x300000, 0x3f00000);
+		warp_fixup_one_nor(0x340000, 0x3f40000);
+		warp_fixup_one_nor(0x380000, 0x3f80000);
+	}
 }
 
 
diff --git a/arch/powerpc/boot/dts/warp.dts b/arch/powerpc/boot/dts/warp.dts
index b04a52e..fa070b0 100644
--- a/arch/powerpc/boot/dts/warp.dts
+++ b/arch/powerpc/boot/dts/warp.dts
@@ -132,40 +132,33 @@
 
 				fpga@2,0 {
 					compatible = "pika,fpga";
-			   		reg = <2 0 2200>;
+			   		reg = <2 0 1000>;
 					interrupts = <18 8>;
 					interrupt-parent = <&UIC0>;
 				};
 
+				fpga@2,4000 {
+					compatible = "pika,fpga-sd";
+					reg = <2 4000 A00>;
+				};
+
 				nor_flash@0,0 {
-					compatible = "amd,s29gl512n", "cfi-flash";
+					compatible = "amd,s29gl032a", "cfi-flash";
 					bank-width = <2>;
-					reg = <0 0 4000000>;
+					reg = <0 0 400000>;
 					#address-cells = <1>;
 					#size-cells = <1>;
-					partition@0 {
-						label = "kernel";
-						reg = <0 180000>;
-					};
-					partition@180000 {
-						label = "root";
-						reg = <180000 3480000>;
-					};
-					partition@3600000 {
-						label = "user";
-						reg = <3600000 900000>;
-					};
-					partition@3f00000 {
+					partition@300000 {
 						label = "fpga";
-						reg = <3f00000 40000>;
+						reg = <300000 40000>;
 					};
-					partition@3f40000 {
+					partition@340000 {
 						label = "env";
-						reg = <3f40000 40000>;
+						reg = <340000 40000>;
 					};
-					partition@3f80000 {
+					partition@380000 {
 						label = "u-boot";
-						reg = <3f80000 80000>;
+						reg = <380000 80000>;
 					};
 				};
 			};
@@ -186,6 +179,16 @@
 				reg = <ef600700 14>;
 				interrupt-parent = <&UIC0>;
 				interrupts = <2 4>;
+				index = <0>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				ad7414@4a {
+					compatible = "adi,ad7414";
+					reg = <4a>;
+					interrupts = <19 8>;
+					interrupt-parent = <&UIC0>;
+				};
 			};
 
 			GPIO0: gpio@ef600b00 {
diff --git a/arch/powerpc/platforms/44x/warp-nand.c b/arch/powerpc/platforms/44x/warp-nand.c
index 9150318..4c6a2a5 100644
--- a/arch/powerpc/platforms/44x/warp-nand.c
+++ b/arch/powerpc/platforms/44x/warp-nand.c
@@ -11,8 +11,10 @@
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/ndfc.h>
+#include <linux/of_platform.h>
 #include <asm/machdep.h>
 
+
 #ifdef CONFIG_MTD_NAND_NDFC
 
 #define CS_NAND_0	1	/* use chip select 1 for NAND device 0 */
@@ -35,13 +37,23 @@ static struct mtd_partition nand_parts[] = {
 	{
 		.name   = "root",
 		.offset = 0x0200000,
-		.size   = 0x3400000
+		.size   = 0x3E00000
+	},
+	{
+		.name   = "persistent",
+		.offset = 0x4000000,
+		.size   = 0x4000000
 	},
 	{
-		.name   = "user",
-		.offset = 0x3600000,
-		.size   = 0x0A00000
+		.name   = "persistent1",
+		.offset = 0x8000000,
+		.size   = 0x4000000
 	},
+	{
+		.name   = "persistent2",
+		.offset = 0xC000000,
+		.size   = 0x4000000
+	}
 };
 
 struct ndfc_controller_settings warp_ndfc_settings = {
@@ -67,19 +79,15 @@ static struct platform_device warp_ndfc_device = {
 	.resource = &warp_ndfc,
 };
 
-static struct nand_ecclayout nand_oob_16 = {
-	.eccbytes = 3,
-	.eccpos = { 0, 1, 2, 3, 6, 7 },
-	.oobfree = { {.offset = 8, .length = 16} }
-};
-
+/* Do NOT set the ecclayout: let it default so it is correct for both
+ * 64M and 256M flash chips.
+ */
 static struct platform_nand_chip warp_nand_chip0 = {
 	.nr_chips = 1,
 	.chip_offset = CS_NAND_0,
 	.nr_partitions = ARRAY_SIZE(nand_parts),
 	.partitions = nand_parts,
-	.chip_delay = 50,
-	.ecclayout = &nand_oob_16,
+	.chip_delay = 20,
 	.priv = &warp_chip0_settings,
 };
 
@@ -96,6 +104,23 @@ static struct platform_device warp_nand_device = {
 
 static int warp_setup_nand_flash(void)
 {
+	struct device_node *np;
+
+	/* Try to detect a rev A based on NOR size. */
+	np = of_find_compatible_node(NULL, NULL, "cfi-flash");
+	if (np) {
+		struct property *pp;
+
+		pp = of_find_property(np, "reg", NULL);
+		if (pp && (pp->length == 12)) {
+			u32 *v = pp->value;
+			if (v[2] == 0x4000000)
+				/* Rev A = 64M NAND */
+				warp_nand_chip0.nr_partitions = 2;
+		}
+		of_node_put(np);
+	}
+
 	platform_device_register(&warp_ndfc_device);
 	platform_device_register(&warp_nand_device);
 
diff --git a/arch/powerpc/platforms/44x/warp.c b/arch/powerpc/platforms/44x/warp.c
index 39cf615..1b2d09e 100644
--- a/arch/powerpc/platforms/44x/warp.c
+++ b/arch/powerpc/platforms/44x/warp.c
@@ -12,6 +12,10 @@
 #include <linux/init.h>
 #include <linux/of_platform.h>
 #include <linux/kthread.h>
+#include <linux/i2c.h>
+#include <linux/interrupt.h>
+#include <linux/pika.h>
+#include <linux/delay.h>
 
 #include <asm/machdep.h>
 #include <asm/prom.h>
@@ -27,6 +31,18 @@ static __initdata struct of_device_id warp_of_bus[] = {
 	{},
 };
 
+static __initdata struct i2c_board_info warp_i2c_info[] = {
+	{ I2C_BOARD_INFO("ad7414", 0x4a) }
+};
+
+static int __init warp_arch_init(void)
+{
+	/* This should go away once support is moved to the dts. */
+	i2c_register_board_info(0, warp_i2c_info, ARRAY_SIZE(warp_i2c_info));
+	return 0;
+}
+machine_arch_initcall(warp, warp_arch_init);
+
 static int __init warp_device_probe(void)
 {
 	of_platform_bus_probe(NULL, warp_of_bus, NULL);
@@ -52,61 +68,200 @@ define_machine(warp) {
 };
 
 
-#define LED_GREEN (0x80000000 >> 0)
-#define LED_RED   (0x80000000 >> 1)
+/* I am not sure this is the best place for this... */
+static int __init warp_post_info(void)
+{
+	struct device_node *np;
+	void __iomem *fpga;
+	u32 post1, post2;
+
+	/* Sighhhh... POST information is in the sd area. */
+	np = of_find_compatible_node(NULL, NULL, "pika,fpga-sd");
+	if (np == NULL)
+		return -ENOENT;
+
+	fpga = of_iomap(np, 0);
+	of_node_put(np);
+	if (fpga == NULL)
+		return -ENOENT;
+
+	post1 = in_be32(fpga + 0x40);
+	post2 = in_be32(fpga + 0x44);
+
+	iounmap(fpga);
+
+	if (post1 || post2)
+		printk(KERN_INFO "Warp POST %08x %08x\n", post1, post2);
+	else
+		printk(KERN_INFO "Warp POST OK\n");
+
+	return 0;
+}
+machine_late_initcall(warp, warp_post_info);
+
+
+#ifdef CONFIG_SENSORS_AD7414
 
+static LIST_HEAD(dtm_shutdown_list);
+static void __iomem *dtm_fpga;
+static void __iomem *gpio_base;
 
-/* This is for the power LEDs 1 = on, 0 = off, -1 = leave alone */
-void warp_set_power_leds(int green, int red)
+
+struct dtm_shutdown {
+	struct list_head list;
+	void (*func)(void *arg);
+	void *arg;
+};
+
+
+int dtm_register_shutdown(void (*func)(void *arg), void *arg)
+{
+	struct dtm_shutdown *shutdown;
+
+	shutdown = kmalloc(sizeof(struct dtm_shutdown), GFP_KERNEL);
+	if (shutdown == NULL)
+		return -ENOMEM;
+
+	shutdown->func = func;
+	shutdown->arg = arg;
+
+	list_add(&shutdown->list, &dtm_shutdown_list);
+
+	return 0;
+}
+
+int dtm_unregister_shutdown(void (*func)(void *arg), void *arg)
 {
-	static void __iomem *gpio_base = NULL;
-	unsigned leds;
-
-	if (gpio_base == NULL) {
-		struct device_node *np;
-
-		/* Power LEDS are on the second GPIO controller */
-		np = of_find_compatible_node(NULL, NULL, "ibm,gpio-440EP");
-		if (np)
-			np = of_find_compatible_node(np, NULL, "ibm,gpio-440EP");
-		if (np == NULL) {
-			printk(KERN_ERR __FILE__ ": Unable to find gpio\n");
-			return;
+	struct dtm_shutdown *shutdown;
+
+	list_for_each_entry(shutdown, &dtm_shutdown_list, list)
+		if (shutdown->func == func && shutdown->arg == arg) {
+			list_del(&shutdown->list);
+			kfree(shutdown);
+			return 0;
+		}
+
+	return -EINVAL;
+}
+
+static irqreturn_t temp_isr(int irq, void *context)
+{
+	struct dtm_shutdown *shutdown;
+
+	local_irq_disable();
+
+	/* Run through the shutdown list. */
+	list_for_each_entry(shutdown, &dtm_shutdown_list, list)
+		shutdown->func(shutdown->arg);
+
+	printk(KERN_EMERG "\n\nCritical Temperature Shutdown\n");
+
+	while (1) {
+		if (dtm_fpga) {
+			unsigned reset = in_be32(dtm_fpga + 0x14);
+			out_be32(dtm_fpga + 0x14, reset);
+		}
+
+		if (gpio_base) {
+			unsigned leds = in_be32(gpio_base);
+
+			/* green off, red toggle */
+			leds &= ~0x80000000;
+			leds ^=  0x40000000;
+
+			out_be32(gpio_base, leds);
 		}
 
+		mdelay(500);
+	}
+}
+
+static void pika_setup_critical_temp(struct i2c_client *client)
+{
+	struct device_node *np;
+	int irq, rc;
+
+	/* Setup power LEDS for possible critical temp */
+	np = of_find_compatible_node(NULL, NULL, "ibm,gpio-440EP");
+	if (np)
+		np = of_find_compatible_node(np, NULL, "ibm,gpio-440EP");
+	if (np) {
 		gpio_base = of_iomap(np, 0);
 		of_node_put(np);
-		if (gpio_base == NULL) {
-			printk(KERN_ERR __FILE__ ": Unable to map gpio");
-			return;
-		}
 	}
 
-	leds = in_be32(gpio_base);
+	/* These registers are in 1 degree increments. */
+	i2c_smbus_write_byte_data(client, 2, 65); /* Thigh */
+	i2c_smbus_write_byte_data(client, 3, 55); /* Tlow */
 
-	switch (green) {
-	case 0: leds &= ~LED_GREEN; break;
-	case 1: leds |=  LED_GREEN; break;
+	np = of_find_compatible_node(NULL, NULL, "adi,ad7414");
+	if (np == NULL) {
+		printk(KERN_ERR __FILE__ ": Unable to find ad7414\n");
+		return;
 	}
-	switch (red) {
-	case 0: leds &= ~LED_RED; break;
-	case 1: leds |=  LED_RED; break;
+
+	irq = irq_of_parse_and_map(np, 0);
+	of_node_put(np);
+	if (irq  == NO_IRQ) {
+		printk(KERN_ERR __FILE__ ": Unable to get ad7414 irq\n");
+		return;
 	}
 
-	out_be32(gpio_base, leds);
+	rc = request_irq(irq, temp_isr, 0, "ad7414", NULL);
+	if (rc) {
+		printk(KERN_ERR __FILE__
+		       ": Unable to request ad7414 irq %d = %d\n", irq, rc);
+		return;
+	}
 }
-EXPORT_SYMBOL(warp_set_power_leds);
 
+static inline void pika_dtm_check_fan(void __iomem *fpga)
+{
+	static int fan_state;
+	u32 fan = in_be32(fpga + 0x34) & (1 << 14);
+
+	if (fan_state != fan) {
+		fan_state = fan;
+		if (fan)
+			printk(KERN_WARNING "Fan rotation error detected."
+				   " Please check hardware.\n");
+	}
+}
 
-#ifdef CONFIG_SENSORS_AD7414
 static int pika_dtm_thread(void __iomem *fpga)
 {
-	extern int ad7414_get_temp(int index);
+	struct i2c_adapter *adap;
+	struct i2c_client *client;
+
+	/* We loop in case either driver was compiled as a module and
+	 * has not been insmoded yet.
+	 */
+	while (!(adap = i2c_get_adapter(0))) {
+		set_current_state(TASK_INTERRUPTIBLE);
+		schedule_timeout(HZ);
+	}
+
+	while (1) {
+		list_for_each_entry(client, &adap->clients, list)
+			if (client->addr == 0x4a)
+				goto found_it;
+
+		set_current_state(TASK_INTERRUPTIBLE);
+		schedule_timeout(HZ);
+	}
+
+found_it:
+	i2c_put_adapter(adap);
+
+	pika_setup_critical_temp(client);
+
+	printk(KERN_INFO "PIKA DTM thread running.\n");
 
 	while (!kthread_should_stop()) {
-		int temp = ad7414_get_temp(0);
+		u16 temp = swab16(i2c_smbus_read_word_data(client, 0));
+		out_be32(fpga + 0x20, temp);
 
-		out_be32(fpga, temp);
+		pika_dtm_check_fan(fpga);
 
 		set_current_state(TASK_INTERRUPTIBLE);
 		schedule_timeout(HZ);
@@ -115,37 +270,44 @@ static int pika_dtm_thread(void __iomem *fpga)
 	return 0;
 }
 
+
 static int __init pika_dtm_start(void)
 {
 	struct task_struct *dtm_thread;
 	struct device_node *np;
-	struct resource res;
-	void __iomem *fpga;
 
 	np = of_find_compatible_node(NULL, NULL, "pika,fpga");
 	if (np == NULL)
 		return -ENOENT;
 
-	/* We do not call of_iomap here since it would map in the entire
-	 * fpga space, which is over 8k.
-	 */
-	if (of_address_to_resource(np, 0, &res)) {
-		of_node_put(np);
-		return -ENOENT;
-	}
+	dtm_fpga = of_iomap(np, 0);
 	of_node_put(np);
-
-	fpga = ioremap(res.start, 0x24);
-	if (fpga == NULL)
+	if (dtm_fpga == NULL)
 		return -ENOENT;
 
-	dtm_thread = kthread_run(pika_dtm_thread, fpga + 0x20, "pika-dtm");
+	dtm_thread = kthread_run(pika_dtm_thread, dtm_fpga, "pika-dtm");
 	if (IS_ERR(dtm_thread)) {
-		iounmap(fpga);
+		iounmap(dtm_fpga);
 		return PTR_ERR(dtm_thread);
 	}
 
 	return 0;
 }
-device_initcall(pika_dtm_start);
+machine_late_initcall(warp, pika_dtm_start);
+
+#else /* !CONFIG_SENSORS_AD7414 */
+
+int dtm_register_shutdown(void (*func)(void *arg), void *arg)
+{
+	return 0;
+}
+
+int dtm_unregister_shutdown(void (*func)(void *arg), void *arg)
+{
+	return 0;
+}
+
 #endif
+
+EXPORT_SYMBOL(dtm_register_shutdown);
+EXPORT_SYMBOL(dtm_unregister_shutdown);

^ permalink raw reply related

* ARCH=ppc strncmp undefined
From: David H. Lynch Jr. @ 2008-04-27 19:26 UTC (permalink / raw)
  To: linuxppc-embedded

    After pulling and rebasing to 2.6.25, I get  strncmp is undefined 
when  I try to link the kernel.

   I have not chased this down as  just added strncmp into
arch/ppc/lib/string.S

    But I would guess this is a side effect of changes to accomidate
migration to ARCH=powerpc.
    There appear to be a number of remaining arch/ppc BSP's that need
strncmp and therefore
    will not build in 2.6.25.




-- 
Dave Lynch 					  	    DLA Systems
Software Development:  				         Embedded Linux
717.627.3770 	       dhlii@dlasys.net 	  http://www.dlasys.net
fax: 1.253.369.9244 			           Cell: 1.717.587.7774
Over 25 years' experience in platforms, languages, and technologies too numerous to list.

"Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction."
Albert Einstein

^ permalink raw reply

* [PATCH] Re: filenames with spaces in /sys?
From: Christian Kujau @ 2008-04-27 19:44 UTC (permalink / raw)
  To: David Woodhouse; +Cc: linuxppc-dev
In-Reply-To: <1209322478.25560.84.camel@pmac.infradead.org>

On Sun, 27 Apr 2008, David Woodhouse wrote:
>> Hm, OTOH /proc also does contain some elements with spaces in it (e.g.
>> /proc/irq/47/GPIO1 ADB)...so, in short: would patches be accepted to
>> turn ' ' into '_' again (if they don't break too much userspace stuff)?
>
> I see no reason not to for the battery class, certainly.

Thanks. By changing drivers/power/pmu_battery.c I now have '_' instead of 
' ' (spaces) in /sys:

/sys/devices/platform/pmu-battery.0/power_supply/PMU_battery_0
/sys/class/power_supply/PMU_battery_0

I'm still not sure if some userspace tool out there uses the 
old paths and will break now.

Signed-off-by: Christian Kujau <lists@nerdbynature.de>

--- linux-2.6-git/drivers/power/pmu_battery.c.orig	2008-04-27 20:26:34.000000000 +0200
+++ linux-2.6-git/drivers/power/pmu_battery.c	2008-04-27 20:31:19.000000000 +0200
@@ -159,7 +159,7 @@ static int __init pmu_bat_init(void)
  		if (!pbat)
  			break;

-		sprintf(pbat->name, "PMU battery %d", i);
+		sprintf(pbat->name, "PMU_battery_%d", i);
  		pbat->bat.name = pbat->name;
  		pbat->bat.properties = pmu_bat_props;
  		pbat->bat.num_properties = ARRAY_SIZE(pmu_bat_props);


C.
-- 
BOFH excuse #189:

SCSI's too wide.

^ permalink raw reply

* Re: [PATCH 2/2] [PPC] Add strncmp to arch/ppc
From: Grant Likely @ 2008-04-27 20:23 UTC (permalink / raw)
  To: jwboyer; +Cc: linuxppc-dev, paulus
In-Reply-To: <1208825427.6654.46.camel@vader.jdub.homelinux.org>

On Mon, Apr 21, 2008 at 6:50 PM, Josh Boyer <jwboyer@linux.vnet.ibm.com> wrote:
> Commit 0119536cd314ef95553604208c25bc35581f7f0a added an assembly version
>  of strncmp to PowerPC.  However, it changed a common header file between
>  arch/ppc and arch/powerpc without adding strncmp to arch/ppc.  This fixes
>  that omission so that arch/ppc links again.
>
>  Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>

Acked-by: Grant Likely <grant.likely@secretlab.ca>

>
>  ---
>   arch/ppc/kernel/ppc_ksyms.c |    1 +
>   arch/ppc/lib/string.S       |   14 ++++++++++++++
>   2 files changed, 15 insertions(+)
>
>  --- linux-2.6.orig/arch/ppc/kernel/ppc_ksyms.c
>  +++ linux-2.6/arch/ppc/kernel/ppc_ksyms.c
>  @@ -89,6 +89,7 @@ EXPORT_SYMBOL(strncpy);
>   EXPORT_SYMBOL(strcat);
>   EXPORT_SYMBOL(strlen);
>   EXPORT_SYMBOL(strcmp);
>  +EXPORT_SYMBOL(strncmp);
>
>   EXPORT_SYMBOL(csum_partial);
>   EXPORT_SYMBOL(csum_partial_copy_generic);
>  --- linux-2.6.orig/arch/ppc/lib/string.S
>  +++ linux-2.6/arch/ppc/lib/string.S
>  @@ -121,6 +121,20 @@ _GLOBAL(strcmp)
>         beq     1b
>         blr
>
>  +_GLOBAL(strncmp)
>  +       PPC_LCMPI r5,0
>  +       beqlr
>  +       mtctr   r5
>  +       addi    r5,r3,-1
>  +       addi    r4,r4,-1
>  +1:     lbzu    r3,1(r5)
>  +       cmpwi   1,r3,0
>  +       lbzu    r0,1(r4)
>  +       subf.   r3,r0,r3
>  +       beqlr   1
>  +       bdnzt   eq,1b
>  +       blr
>  +
>   _GLOBAL(strlen)
>         addi    r4,r3,-1
>   1:     lbzu    r0,1(r4)
>
>  _______________________________________________
>  Linuxppc-dev mailing list
>  Linuxppc-dev@ozlabs.org
>  https://ozlabs.org/mailman/listinfo/linuxppc-dev
>



-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* Re: ARCH=ppc strncmp undefined
From: Grant Likely @ 2008-04-27 20:24 UTC (permalink / raw)
  To: dhlii; +Cc: linuxppc-embedded
In-Reply-To: <4814D35C.9070608@dlasys.net>

On Sun, Apr 27, 2008 at 1:26 PM, David H. Lynch Jr. <dhlii@dlasys.net> wrote:
>     After pulling and rebasing to 2.6.25, I get  strncmp is undefined
>  when  I try to link the kernel.
>
>    I have not chased this down as  just added strncmp into
>  arch/ppc/lib/string.S
>
>     But I would guess this is a side effect of changes to accomidate
>  migration to ARCH=powerpc.
>     There appear to be a number of remaining arch/ppc BSP's that need
>  strncmp and therefore
>     will not build in 2.6.25.

There is a patch to fix this bug:

http://ozlabs.org/pipermail/linuxppc-dev/2008-April/055094.html

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* Re: EABI
From: Ron Sass @ 2008-04-27 20:36 UTC (permalink / raw)
  To: Brian Silverman; +Cc: linuxppc-embedded
In-Reply-To: <4810B196.7000300@conceptxdesign.com>


Unfortunately, it is not that easy.  The Xilinx tool chain use
newlib but your Linux kernel (and rootfs) is probably built
around glibc.  When we've wanted to do a quick-and-dirty test of
something that relies on Xilinx's patches to gcc, we have used
powerpc-eabi-gcc to compile to assembler and then used our own
crosstools compilers to link and load.

That doesn't solve your problem but hopefully it explains the
issue.

Ron

> Is it possible to compile a Linux application using an EABI compiler 
> (specfically, Xilinx's EDK powerpc-eabi-gcc.exe)?
>  
> The issue at hand is that we'd like for our customers to be able to use 
> the Xilinx EDK toolchain (which we know they will have) to compile Linx 
> apps without having to install another toolchain (crosstool, ELDK, etc).
>  
> So, what I'm hoping is that the EDK toolchain can be configured to be 
> Linux compatible binaries, or that there is some kind of wrapper that 
> will handle the incompatible interfaces.  Searching around, I've seen 
> some mention of Linux EABI compatibility (for Debian ARM releases), but 
> I haven't found any clear concensus...
> 
> P.S. My apologies if this message appears on the mailing list twice...
> 
> -- 
> Brian Silverman
> Concept X, LLC

^ permalink raw reply

* Re: [RESEND][PATCH][POWERPC] PIKA Warp: Update platform code to supportRev B boards
From: Stephen Rothwell @ 2008-04-28  0:58 UTC (permalink / raw)
  To: Sean MacLennan; +Cc: linuxppc-dev
In-Reply-To: <20080427152546.1e26b145@lappy.seanm.ca>

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

Hi Sean,

On Sun, 27 Apr 2008 15:25:46 -0400 Sean MacLennan <smaclennan@pikatech.com> wrote:
>
> +++ b/arch/powerpc/platforms/44x/warp-nand.c
> @@ -11,8 +11,10 @@
>  #include <linux/mtd/partitions.h>
>  #include <linux/mtd/nand.h>
>  #include <linux/mtd/ndfc.h>
> +#include <linux/of_platform.h>

You really want linux.of.h (unless there was some preexisting reason to
require of_platform.h).

> +static void pika_setup_critical_temp(struct i2c_client *client)
> +{
> +	struct device_node *np;
> +	int irq, rc;
> +
> +	/* Setup power LEDS for possible critical temp */
> +	np = of_find_compatible_node(NULL, NULL, "ibm,gpio-440EP");
> +	if (np)
> +		np = of_find_compatible_node(np, NULL, "ibm,gpio-440EP");

Did you really mean to test if (!np) above instead?

-- 
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

* Re: [RESEND][PATCH][POWERPC] PIKA Warp: Update platform code to supportRev B boards
From: Grant Likely @ 2008-04-28  1:51 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linuxppc-dev, Sean MacLennan
In-Reply-To: <20080428105859.daef4d71.sfr@canb.auug.org.au>

On Sun, Apr 27, 2008 at 6:58 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> Hi Sean,
>
>
>  On Sun, 27 Apr 2008 15:25:46 -0400 Sean MacLennan <smaclennan@pikatech.com> wrote:
>  >
>  > +++ b/arch/powerpc/platforms/44x/warp-nand.c
>  > @@ -11,8 +11,10 @@
>  >  #include <linux/mtd/partitions.h>
>  >  #include <linux/mtd/nand.h>
>  >  #include <linux/mtd/ndfc.h>
>  > +#include <linux/of_platform.h>
>
>  You really want linux.of.h (unless there was some preexisting reason to
>  require of_platform.h).
>
>
>  > +static void pika_setup_critical_temp(struct i2c_client *client)
>  > +{
>  > +     struct device_node *np;
>  > +     int irq, rc;
>  > +
>  > +     /* Setup power LEDS for possible critical temp */
>  > +     np = of_find_compatible_node(NULL, NULL, "ibm,gpio-440EP");
>  > +     if (np)
>  > +             np = of_find_compatible_node(np, NULL, "ibm,gpio-440EP");
>
>  Did you really mean to test if (!np) above instead?

Actually, it looks like he's trying to find the second gpio node in the tree.

Sean, if that is true, then this is a very fragile way to do it.
Really, you should have a phandle somewhere that points to the GPIO
node that your LEDs are attached to.  Others have been addressing the
same problem and the consensus seems to be to add a 'leds' node for
each of your leds with a phandle and gpio descriptor to the gpio node.

See the documentation added by this patch (section 't'):
http://patchwork.ozlabs.org/linuxppc/patch?id=18156

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* Re: [RESEND][PATCH][POWERPC] PIKA Warp: Update platform code to supportRev B boards
From: Sean MacLennan @ 2008-04-28  2:25 UTC (permalink / raw)
  To: Grant Likely; +Cc: Stephen Rothwell, linuxppc-dev
In-Reply-To: <fa686aa40804271851t6d762a1et76fa3cc02c2205fe@mail.gmail.com>

On Sun, 27 Apr 2008 19:51:57 -0600
"Grant Likely" <grant.likely@secretlab.ca> wrote:

> Actually, it looks like he's trying to find the second gpio node in
> the tree.

Correct.

> Sean, if that is true, then this is a very fragile way to do it.
> Really, you should have a phandle somewhere that points to the GPIO
> node that your LEDs are attached to.  Others have been addressing the
> same problem and the consensus seems to be to add a 'leds' node for
> each of your leds with a phandle and gpio descriptor to the gpio node.
> 
> See the documentation added by this patch (section 't'):
> http://patchwork.ozlabs.org/linuxppc/patch?id=18156

I saw that earlier. I thought that that method relied on the gpio_led
driver? I want to use the gpio_led driver, but I believe the underlying
gpio code for the 440EP is not done yet.

If *either* assumption is wrong, let me know! It would be one less
driver (the warp_led driver) that I would have to support outside the
mainline kernel.

I believe, if the platform update gets accepted, that in 2.6.26 the
Warp will be usable with the the mainline kernel. You will just lose
some functionally, such as the SD driver which has already been
rejected.

Cheers,
   Sean

^ permalink raw reply

* Re: [RESEND][PATCH][POWERPC] PIKA Warp: Update platform code to supportRev B boards
From: Sean MacLennan @ 2008-04-28  2:31 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linuxppc-dev
In-Reply-To: <20080428105859.daef4d71.sfr@canb.auug.org.au>

On Mon, 28 Apr 2008 10:58:59 +1000
"Stephen Rothwell" <sfr@canb.auug.org.au> wrote:

> You really want linux.of.h (unless there was some preexisting reason
> to require of_platform.h).

You are correct. That was a cut and paste from warp.c which
specifically needs of_platform.h.

Cheers,
   Sean

^ permalink raw reply

* [PATCH] Add fast little-endian switch system call
From: Paul Mackerras @ 2008-04-28  3:52 UTC (permalink / raw)
  To: linuxppc-dev

This adds a system call on 64-bit platforms for switching between
little-endian and big-endian modes that is much faster than doing a
prctl call.  This system call is handled as a special case right at
the start of the system call entry code, and because it is a special
case, it uses a system call number which is out of the range of
normal system calls, namely 0x1ebe.

Measurements with lmbench on a 4.2GHz POWER6 showed no measurable
change in the speed of normal system calls with this patch.

Switching endianness with this new system call takes around 60ns on a
4.2GHz POWER6, compared with around 300ns to switch endian mode with a
prctl.  This can provide a significant performance advantage for
emulators for little-endian architectures that want to switch between
big-endian and little-endian mode frequently, e.g. because they are
generating instructions sequences on the fly and they want to run
those sequences in little-endian mode.

Signed-off-by: Paul Mackerras <paulus@samba.org>
---

diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 215973a..2eb49a7 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -239,6 +239,10 @@ instruction_access_slb_pSeries:
 	.globl	system_call_pSeries
 system_call_pSeries:
 	HMT_MEDIUM
+BEGIN_FTR_SECTION
+	cmpdi	r0,0x1ebe
+	beq-	1f
+END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE)
 	mr	r9,r13
 	mfmsr	r10
 	mfspr	r13,SPRN_SPRG3
@@ -253,6 +257,13 @@ system_call_pSeries:
 	rfid
 	b	.	/* prevent speculative execution */
 
+/* Fast LE/BE switch system call */
+1:	mfspr	r12,SPRN_SRR1
+	xori	r12,r12,MSR_LE
+	mtspr	SPRN_SRR1,r12
+	rfid		/* return to userspace */
+	b	.
+
 	STD_EXCEPTION_PSERIES(0xd00, single_step)
 	STD_EXCEPTION_PSERIES(0xe00, trap_0e)
 

^ permalink raw reply related

* Re: 2.6.25: pmac_newworld undefined
From: Tony Breeds @ 2008-04-28  4:20 UTC (permalink / raw)
  To: Christian Kujau, Sam Ravnborg; +Cc: linuxppc-dev, LKML
In-Reply-To: <alpine.DEB.1.10.0804271951190.11017@sheep.housecafe.de>

On Sun, Apr 27, 2008 at 08:03:46PM +0200, Christian Kujau wrote:
> Hi,
> 
> the build failure reported[0] by Kamalesh back in 01/2008 is still 
> present in today's 2.6.25-git with CONFIG_NVRAM=m (instead of =y):
> 
>   Building modules, stage 2.
>   MODPOST 72 modules
> ERROR: "pmac_newworld" [arch/powerpc/platforms/powermac/nvram.ko] undefined!
> ERROR: "__alloc_bootmem" [arch/powerpc/platforms/powermac/nvram.ko] 
> undefined!
> make[1]: *** [__modpost] Error 1

Yeah that isn't really surprising.  Essentially
arch/powerpc/platforms/powermac/nvram.c must be builtin (not modular)
but CONFIG_NVRAM is tristate, and your .config has CONFIG_NVRAM=m.

We can probably "fix" this by adding another config config symbol and
"selecting" that from CONFIG_NVRAM.  Then using this new symbol in
arch/powerpc/platforms/powermac/*

so I think with we need is:
config NVRAM
  bool "..." if PPC32
  tristate "..." if !PPC32
  ...
  ...

Sam is there some way to achieve that or should we just create an
secondary symbol?

Yours Tony

  linux.conf.au    http://www.marchsouth.org/
  Jan 19 - 24 2009 The Australian Linux Technical Conference!

^ permalink raw reply

* Re: get_cycles()
From: Tony Breeds @ 2008-04-28  4:38 UTC (permalink / raw)
  To: Kevin Diggs; +Cc: linuxppc-dev
In-Reply-To: <48145709.9020809@hypersurf.com>

On Sun, Apr 27, 2008 at 03:35:54AM -0700, Kevin Diggs wrote:

> I'm working on a cpufreq driver for the 750GX so I don't think I have to 
> worry about being to platform specific.
> 
> Would a compile time configuration be a good idea (hrtimer or 
> get_cycles() assisted timing)?

Save yourself the pain, and use the hrtimers infrastructure.
 
> In the 2.4 code I just used a timer 2 ticks in the future to be certain 
> I did not go under the 100 us PLL lock delay. I was trying to see if I 
> could cut the latency down.
> 
> What about using OF? Isn't there a timebase property for the cpus?

Sure, If you really don't want to use the infrastructure that's there
feel free to duplicate portions of arch/powerpc/kernel/time.c and
kernel/time/* into your cpufreq driver.

Yours Tony

  linux.conf.au    http://www.marchsouth.org/
  Jan 19 - 24 2009 The Australian Linux Technical Conference!

^ permalink raw reply

* [POWERPC] Use __always_inline for xchg* and cmpxchg*
From: Paul Mackerras @ 2008-04-28  4:44 UTC (permalink / raw)
  To: linuxppc-dev, linux-kernel

This changes the definitions of the xchg and cmpxchg families of
functions in include/asm-powerpc/system.h to be marked __always_inline
rather than __inline__.  The reason for doing this is that we rely on
the compiler inlining them in order to eliminate the references to 
__xchg_called_with_bad_pointer and __cmpxchg_called_with_bad_pointer,
which are deliberately left undefined.  Thus this change will enable
us to make the inline keyword be just a hint rather than a directive.

Signed-off-by: Paul Mackerras <paulus@samba.org>
---
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h
index fab1674..2b6559a 100644
--- a/include/asm-powerpc/system.h
+++ b/include/asm-powerpc/system.h
@@ -204,7 +204,7 @@ extern int powersave_nap;	/* set if nap mode can be used in idle loop */
  * Changes the memory location '*ptr' to be val and returns
  * the previous value stored there.
  */
-static __inline__ unsigned long
+static __always_inline unsigned long
 __xchg_u32(volatile void *p, unsigned long val)
 {
 	unsigned long prev;
@@ -229,7 +229,7 @@ __xchg_u32(volatile void *p, unsigned long val)
  * Changes the memory location '*ptr' to be val and returns
  * the previous value stored there.
  */
-static __inline__ unsigned long
+static __always_inline unsigned long
 __xchg_u32_local(volatile void *p, unsigned long val)
 {
 	unsigned long prev;
@@ -247,7 +247,7 @@ __xchg_u32_local(volatile void *p, unsigned long val)
 }
 
 #ifdef CONFIG_PPC64
-static __inline__ unsigned long
+static __always_inline unsigned long
 __xchg_u64(volatile void *p, unsigned long val)
 {
 	unsigned long prev;
@@ -266,7 +266,7 @@ __xchg_u64(volatile void *p, unsigned long val)
 	return prev;
 }
 
-static __inline__ unsigned long
+static __always_inline unsigned long
 __xchg_u64_local(volatile void *p, unsigned long val)
 {
 	unsigned long prev;
@@ -290,7 +290,7 @@ __xchg_u64_local(volatile void *p, unsigned long val)
  */
 extern void __xchg_called_with_bad_pointer(void);
 
-static __inline__ unsigned long
+static __always_inline unsigned long
 __xchg(volatile void *ptr, unsigned long x, unsigned int size)
 {
 	switch (size) {
@@ -305,7 +305,7 @@ __xchg(volatile void *ptr, unsigned long x, unsigned int size)
 	return x;
 }
 
-static __inline__ unsigned long
+static __always_inline unsigned long
 __xchg_local(volatile void *ptr, unsigned long x, unsigned int size)
 {
 	switch (size) {
@@ -338,7 +338,7 @@ __xchg_local(volatile void *ptr, unsigned long x, unsigned int size)
  */
 #define __HAVE_ARCH_CMPXCHG	1
 
-static __inline__ unsigned long
+static __always_inline unsigned long
 __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new)
 {
 	unsigned int prev;
@@ -361,7 +361,7 @@ __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new)
 	return prev;
 }
 
-static __inline__ unsigned long
+static __always_inline unsigned long
 __cmpxchg_u32_local(volatile unsigned int *p, unsigned long old,
 			unsigned long new)
 {
@@ -384,7 +384,7 @@ __cmpxchg_u32_local(volatile unsigned int *p, unsigned long old,
 }
 
 #ifdef CONFIG_PPC64
-static __inline__ unsigned long
+static __always_inline unsigned long
 __cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new)
 {
 	unsigned long prev;
@@ -406,7 +406,7 @@ __cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new)
 	return prev;
 }
 
-static __inline__ unsigned long
+static __always_inline unsigned long
 __cmpxchg_u64_local(volatile unsigned long *p, unsigned long old,
 			unsigned long new)
 {
@@ -432,7 +432,7 @@ __cmpxchg_u64_local(volatile unsigned long *p, unsigned long old,
    if something tries to do an invalid cmpxchg().  */
 extern void __cmpxchg_called_with_bad_pointer(void);
 
-static __inline__ unsigned long
+static __always_inline unsigned long
 __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new,
 	  unsigned int size)
 {
@@ -448,7 +448,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new,
 	return old;
 }
 
-static __inline__ unsigned long
+static __always_inline unsigned long
 __cmpxchg_local(volatile void *ptr, unsigned long old, unsigned long new,
 	  unsigned int size)
 {

^ permalink raw reply related

* Re: [RESEND][PATCH][POWERPC] PIKA Warp: Update platform code to supportRev B boards
From: Grant Likely @ 2008-04-28  4:47 UTC (permalink / raw)
  To: Sean MacLennan; +Cc: Stephen Rothwell, linuxppc-dev
In-Reply-To: <20080427222514.1086f2d3@lappy.seanm.ca>

On Sun, Apr 27, 2008 at 8:25 PM, Sean MacLennan <smaclennan@pikatech.com> wrote:
> On Sun, 27 Apr 2008 19:51:57 -0600
>  "Grant Likely" <grant.likely@secretlab.ca> wrote:
>
>  > Actually, it looks like he's trying to find the second gpio node in
>  > the tree.
>
>  Correct.
>
>
>  > Sean, if that is true, then this is a very fragile way to do it.
>  > Really, you should have a phandle somewhere that points to the GPIO
>  > node that your LEDs are attached to.  Others have been addressing the
>  > same problem and the consensus seems to be to add a 'leds' node for
>  > each of your leds with a phandle and gpio descriptor to the gpio node.
>  >
>  > See the documentation added by this patch (section 't'):
>  > http://patchwork.ozlabs.org/linuxppc/patch?id=18156
>
>  I saw that earlier. I thought that that method relied on the gpio_led
>  driver? I want to use the gpio_led driver, but I believe the underlying
>  gpio code for the 440EP is not done yet.

Something very important to remember:  The device tree is simply a
description of the hardware.  Its layout *must* *not* be driven by
device driver design.  Driver design can and will change over time;
hardware description conventions should be relatively stable.

If your LEDs are attached to gpio pins, then you should use the
current draft led->gpio bindings as shown in the above patch.  Then,
let your platform code extract whatever data it needs from the device
tree to set up the LEDs.

It is irrelevant that the 44EP GPIO driver doesn't support that
binding.  Just make sure that the warp platform code doesn't register
warp's linux,gpio-led device tree nodes onto the of_platform bus.
That way your platform code can do whatever it wants to handle the
LEDs itself.

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* Re: [PATCH] [POWERPC] Add IRQSTACKS support on ppc32
From: Paul Mackerras @ 2008-04-28  5:17 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <Pine.LNX.4.64.0804240814280.29846@blarg.am.freescale.net>

Kumar Gala writes:

> * Added allocation and initialization of the irq stacks.  We limit the
>   stacks to be in lowmem for ppc32.
> * Implemented ppc32 versions of call_do_softirq() and call_handle_irq()
>   to switch the stack pointers
> * Reworked how we do stack overflow detection.  We now keep around the
>   limit of the stack in the thread_struct and compare against the limit
>   to see if we've overflowed.  We can now use this on ppc64 if desired.

Mostly looks great.  One minor nit is that this ifdef could disappear
entirely now:

> @@ -352,7 +356,7 @@ void __init init_IRQ(void)
>  {
>  	if (ppc_md.init_IRQ)
>  		ppc_md.init_IRQ();
> -#ifdef CONFIG_PPC64
> +#ifdef CONFIG_IRQSTACKS
>  	irq_ctx_init();
>  #endif

Since it looks pretty much exactly like what 64-bit already does, and
it's under a config option, I withdraw my objection to it going into
2.6.26.

Paul.

^ permalink raw reply

* Re: [PATCH] [POWERPC] Add IRQSTACKS support on ppc32
From: Kumar Gala @ 2008-04-28  5:50 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <18453.24013.647603.723185@cargo.ozlabs.ibm.com>


On Apr 28, 2008, at 12:17 AM, Paul Mackerras wrote:
> Kumar Gala writes:
>
>> * Added allocation and initialization of the irq stacks.  We limit  
>> the
>>  stacks to be in lowmem for ppc32.
>> * Implemented ppc32 versions of call_do_softirq() and  
>> call_handle_irq()
>>  to switch the stack pointers
>> * Reworked how we do stack overflow detection.  We now keep around  
>> the
>>  limit of the stack in the thread_struct and compare against the  
>> limit
>>  to see if we've overflowed.  We can now use this on ppc64 if  
>> desired.
>
> Mostly looks great.  One minor nit is that this ifdef could disappear
> entirely now:

How do you figure?  If we want to maintain it as a config option (for  
at least 2.6.26) we  either need this ifdef or a dummy irq_ctx_init().


>> @@ -352,7 +356,7 @@ void __init init_IRQ(void)
>> {
>> 	if (ppc_md.init_IRQ)
>> 		ppc_md.init_IRQ();
>> -#ifdef CONFIG_PPC64
>> +#ifdef CONFIG_IRQSTACKS
>> 	irq_ctx_init();
>> #endif
>
> Since it looks pretty much exactly like what 64-bit already does, and
> it's under a config option, I withdraw my objection to it going into
> 2.6.26.

:)

- k

^ permalink raw reply

* [PATCH] celleb_scc_pciex __iomem annotations
From: Al Viro @ 2008-04-28  5:59 UTC (permalink / raw)
  To: torvalds; +Cc: linuxppc-dev, linux-kernel


Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 arch/powerpc/platforms/cell/celleb_scc_pciex.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/platforms/cell/celleb_scc_pciex.c b/arch/powerpc/platforms/cell/celleb_scc_pciex.c
index ab24d94..31da84c 100644
--- a/arch/powerpc/platforms/cell/celleb_scc_pciex.c
+++ b/arch/powerpc/platforms/cell/celleb_scc_pciex.c
@@ -36,8 +36,8 @@
 #include "celleb_scc.h"
 #include "celleb_pci.h"
 
-#define PEX_IN(base, off)	in_be32((void *)(base) + (off))
-#define PEX_OUT(base, off, data) out_be32((void *)(base) + (off), (data))
+#define PEX_IN(base, off)	in_be32((void __iomem *)(base) + (off))
+#define PEX_OUT(base, off, data) out_be32((void __iomem *)(base) + (off), (data))
 
 static void scc_pciex_io_flush(struct iowa_bus *bus)
 {
@@ -304,7 +304,7 @@ static int __init scc_pciex_iowa_init(struct iowa_bus *bus, void *data)
 	((((0x1 << (size))-1) << ((addr) & 0x3)) << PEXDCMND_BYTE_EN_SHIFT)
 #define MK_PEXDCMND(cmd, addr, size) ((cmd) | MK_PEXDCMND_BYTE_EN(addr, size))
 
-static uint32_t config_read_pciex_dev(unsigned int *base,
+static uint32_t config_read_pciex_dev(unsigned int __iomem *base,
 		uint64_t bus_no, uint64_t dev_no, uint64_t func_no,
 		uint64_t off, uint64_t size)
 {
@@ -320,7 +320,7 @@ static uint32_t config_read_pciex_dev(unsigned int *base,
 	return ret;
 }
 
-static void config_write_pciex_dev(unsigned int *base, uint64_t bus_no,
+static void config_write_pciex_dev(unsigned int __iomem *base, uint64_t bus_no,
 	uint64_t dev_no, uint64_t func_no, uint64_t off, uint64_t size,
 	uint32_t data)
 {
@@ -338,7 +338,7 @@ static void config_write_pciex_dev(unsigned int *base, uint64_t bus_no,
 	((((0x1 << (len)) - 1) << ((off) & 0x3)) << PEXCADRS_BYTE_EN_SHIFT)
 #define MK_PEXCADRS(cmd, addr, size) \
 	((cmd) | MK_PEXCADRS_BYTE_EN(addr, size) | ((addr) & ~0x3))
-static uint32_t config_read_pciex_rc(unsigned int *base,
+static uint32_t config_read_pciex_rc(unsigned int __iomem *base,
 				     uint32_t where, uint32_t size)
 {
 	PEX_OUT(base, PEXCADRS, MK_PEXCADRS(PEXCADRS_CMD_READ, where, size));
@@ -346,7 +346,7 @@ static uint32_t config_read_pciex_rc(unsigned int *base,
 		>> ((where & (4 - size)) * 8)) & ((0x1 << (size * 8)) - 1);
 }
 
-static void config_write_pciex_rc(unsigned int *base, uint32_t where,
+static void config_write_pciex_rc(unsigned int __iomem *base, uint32_t where,
 				  uint32_t size, uint32_t val)
 {
 	uint32_t data;
@@ -410,7 +410,7 @@ static struct pci_ops scc_pciex_pci_ops = {
 	scc_pciex_write_config,
 };
 
-static void pciex_clear_intr_all(unsigned int *base)
+static void pciex_clear_intr_all(unsigned int __iomem *base)
 {
 	PEX_OUT(base, PEXAERRSTS, 0xffffffff);
 	PEX_OUT(base, PEXPRERRSTS, 0xffffffff);
@@ -427,7 +427,7 @@ static void pciex_disable_intr_all(unsigned int *base)
 }
 #endif
 
-static void pciex_enable_intr_all(unsigned int *base)
+static void pciex_enable_intr_all(unsigned int __iomem *base)
 {
 	PEX_OUT(base, PEXINTMASK, 0x0000e7f1);
 	PEX_OUT(base, PEXAERRMASK, 0x03ff01ff);
@@ -435,7 +435,7 @@ static void pciex_enable_intr_all(unsigned int *base)
 	PEX_OUT(base, PEXVDMASK, 0x00000001);
 }
 
-static void pciex_check_status(unsigned int *base)
+static void pciex_check_status(unsigned int __iomem *base)
 {
 	uint32_t err = 0;
 	uint32_t intsts, aerr, prerr, rcvcp, lenerr;
-- 
1.5.3.GIT

^ permalink raw reply related

* Re: [PATCH] [POWERPC] Add IRQSTACKS support on ppc32
From: Paul Mackerras @ 2008-04-28  6:02 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <D84B894B-B6E8-47FD-97CE-CACDE7835B78@kernel.crashing.org>

Kumar Gala writes:

> > Mostly looks great.  One minor nit is that this ifdef could disappear
> > entirely now:
> 
> How do you figure?  If we want to maintain it as a config option (for  
> at least 2.6.26) we  either need this ifdef or a dummy irq_ctx_init().

In include/asm-powerpc/irq.h we already have a dummy definition:

#ifdef CONFIG_IRQSTACKS

...

#else
#define irq_ctx_init()

#endif /* CONFIG_IRQSTACKS */

Paul.

^ permalink raw reply

* Re: [PATCH] [POWERPC] Add IRQSTACKS support on ppc32
From: Kumar Gala @ 2008-04-28  6:10 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <18453.26718.402204.95133@cargo.ozlabs.ibm.com>


On Apr 28, 2008, at 1:02 AM, Paul Mackerras wrote:
> Kumar Gala writes:
>
>>> Mostly looks great.  One minor nit is that this ifdef could  
>>> disappear
>>> entirely now:
>>
>> How do you figure?  If we want to maintain it as a config option (for
>> at least 2.6.26) we  either need this ifdef or a dummy  
>> irq_ctx_init().
>
> In include/asm-powerpc/irq.h we already have a dummy definition:
>
> #ifdef CONFIG_IRQSTACKS
>
> ...
>
> #else
> #define irq_ctx_init()
>
> #endif /* CONFIG_IRQSTACKS */

Missed that.  Will drop the ifdef in irq.c and repost.

- k

^ permalink raw reply

* [PATHC V3] Watchdog on MPC85xx SMP system
From: Chen Gong @ 2008-04-28  6:20 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Chen Gong

On Book-E SMP systems each core has its own private watchdog.
If only one watchdog is enabled, when the core that doesn't
enable the watchdog is hung, system can't reset because no
watchdog is running on it. That's bad. It means we must enable
watchdogs on both cores.

We can use smp_call_function() to send appropriate messages to all the other
cores to enable and update the watchdog.

Signed-off-by: Chen Gong <g.chen@freescale.com>
---
Tested on MPC8572DS platform.

 drivers/char/watchdog/booke_wdt.c |   34 +++++++++++++++++++++++++++-------
 1 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/drivers/char/watchdog/booke_wdt.c b/drivers/char/watchdog/booke_wdt.c
index d362f5b..b3a37d0 100644
--- a/drivers/char/watchdog/booke_wdt.c
+++ b/drivers/char/watchdog/booke_wdt.c
@@ -6,7 +6,12 @@
  * Author: Matthew McClintock
  * Maintainer: Kumar Gala <galak@kernel.crashing.org>
  *
- * Copyright 2005 Freescale Semiconductor Inc.
+ * Copyright 2005, 2008 Freescale Semiconductor Inc.
+ *
+ * Changelog:
+ * 	2008-04-28 Chen Gong <g.chen@freescale.com>
+ * 	Add SMP support for MPC85xx system. Tested on
+ * 	MPC8572DS platform
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
@@ -16,6 +21,7 @@
 
 #include <linux/module.h>
 #include <linux/fs.h>
+#include <linux/smp.h>
 #include <linux/miscdevice.h>
 #include <linux/notifier.h>
 #include <linux/watchdog.h>
@@ -47,23 +53,31 @@ u32 booke_wdt_period = WDT_PERIOD_DEFAULT;
 #define WDTP(x)		(TCR_WP(x))
 #endif
 
+static DEFINE_SPINLOCK(booke_wdt_lock);
+
+static void __booke_wdt_ping(void *data)
+{
+	mtspr(SPRN_TSR, TSR_ENW|TSR_WIS);
+}
+
 /*
  * booke_wdt_ping:
  */
 static __inline__ void booke_wdt_ping(void)
 {
-	mtspr(SPRN_TSR, TSR_ENW|TSR_WIS);
+	smp_call_function(__booke_wdt_ping, NULL, 0, 0);
+	__booke_wdt_ping(NULL);
 }
 
 /*
- * booke_wdt_enable:
+ * __booke_wdt_enable:
  */
-static __inline__ void booke_wdt_enable(void)
+static __inline__ void __booke_wdt_enable(void *data)
 {
 	u32 val;
 
 	/* clear status before enabling watchdog */
-	booke_wdt_ping();
+	__booke_wdt_ping(NULL);
 	val = mfspr(SPRN_TCR);
 	val |= (TCR_WIE|TCR_WRC(WRC_CHIP)|WDTP(booke_wdt_period));
 
@@ -137,12 +151,15 @@ static int booke_wdt_ioctl (struct inode *inode, struct file *file,
  */
 static int booke_wdt_open (struct inode *inode, struct file *file)
 {
+	spin_lock(&booke_wdt_lock);
 	if (booke_wdt_enabled == 0) {
 		booke_wdt_enabled = 1;
-		booke_wdt_enable();
+		__booke_wdt_enable(NULL);
+		smp_call_function(__booke_wdt_enable, NULL, 0, 0);
 		printk (KERN_INFO "PowerPC Book-E Watchdog Timer Enabled (wdt_period=%d)\n",
 				booke_wdt_period);
 	}
+	spin_unlock(&booke_wdt_lock);
 
 	return nonseekable_open(inode, file);
 }
@@ -183,11 +200,14 @@ static int __init booke_wdt_init(void)
 		return ret;
 	}
 
+	spin_lock(&booke_wdt_lock);
 	if (booke_wdt_enabled == 1) {
 		printk (KERN_INFO "PowerPC Book-E Watchdog Timer Enabled (wdt_period=%d)\n",
 				booke_wdt_period);
-		booke_wdt_enable();
+		__booke_wdt_enable(NULL);
+		smp_call_function(__booke_wdt_enable, NULL, 0, 0);
 	}
+	spin_unlock(&booke_wdt_lock);
 
 	return ret;
 }
-- 
1.5.4

^ permalink raw reply related

* [PATCH v2] [POWERPC] Add IRQSTACKS support on ppc32
From: Kumar Gala @ 2008-04-28  6:21 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

* Added allocation and initialization of the irq stacks.  We limit the
  stacks to be in lowmem for ppc32.
* Implemented ppc32 versions of call_do_softirq() and call_handle_irq()
  to switch the stack pointers
* Reworked how we do stack overflow detection.  We now keep around the
  limit of the stack in the thread_struct and compare against the limit
  to see if we've overflowed.  We can now use this on ppc64 if desired.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---

Removed ifdef from init_IRQ since we have a dummy version of irq_ctx_init
in irq.h

 arch/powerpc/Kconfig.debug        |    1 -
 arch/powerpc/kernel/asm-offsets.c |    1 +
 arch/powerpc/kernel/entry_32.S    |    4 ++--
 arch/powerpc/kernel/irq.c         |   10 ++++++++--
 arch/powerpc/kernel/misc_32.S     |   25 +++++++++++++++++++++++++
 arch/powerpc/kernel/process.c     |    2 ++
 arch/powerpc/kernel/setup_32.c    |   21 +++++++++++++++++++++
 include/asm-powerpc/processor.h   |    6 ++++++
 8 files changed, 65 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
index a86d8d8..2cf72d2 100644
--- a/arch/powerpc/Kconfig.debug
+++ b/arch/powerpc/Kconfig.debug
@@ -118,7 +118,6 @@ config XMON_DISASSEMBLY

 config IRQSTACKS
 	bool "Use separate kernel stacks when processing interrupts"
-	depends on PPC64
 	help
 	  If you say Y here the kernel will use separate kernel stacks
 	  for handling hard and soft interrupts.  This can help avoid
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index adf1d09..0ef4d41 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -64,6 +64,7 @@ int main(void)
 #endif /* CONFIG_PPC64 */

 	DEFINE(KSP, offsetof(struct thread_struct, ksp));
+	DEFINE(KSP_LIMIT, offsetof(struct thread_struct, ksp_limit));
 	DEFINE(PT_REGS, offsetof(struct thread_struct, regs));
 	DEFINE(THREAD_FPEXC_MODE, offsetof(struct thread_struct, fpexc_mode));
 	DEFINE(THREAD_FPR0, offsetof(struct thread_struct, fpr[0]));
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index 84c8686..f33c1fe 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -137,8 +137,8 @@ transfer_to_handler:
 2:	/* if from kernel, check interrupted DOZE/NAP mode and
          * check for stack overflow
          */
-	lwz	r9,THREAD_INFO-THREAD(r12)
-	cmplw	r1,r9			/* if r1 <= current->thread_info */
+	lwz	r9,KSP_LIMIT(r12)
+	cmplw	r1,r9			/* if r1 <= ksp_limit */
 	ble-	stack_ovf		/* then the kernel stack overflowed */
 5:
 #ifdef CONFIG_6xx
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 425616f..2f73f70 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -307,6 +307,7 @@ void do_IRQ(struct pt_regs *regs)
 		if (curtp != irqtp) {
 			struct irq_desc *desc = irq_desc + irq;
 			void *handler = desc->handle_irq;
+			unsigned long saved_sp_limit = current->thread.ksp_limit;
 			if (handler == NULL)
 				handler = &__do_IRQ;
 			irqtp->task = curtp->task;
@@ -319,7 +320,10 @@ void do_IRQ(struct pt_regs *regs)
 				(irqtp->preempt_count & ~SOFTIRQ_MASK) |
 				(curtp->preempt_count & SOFTIRQ_MASK);

+			current->thread.ksp_limit = (unsigned long)irqtp +
+				_ALIGN_UP(sizeof(struct thread_info), 16);
 			call_handle_irq(irq, desc, irqtp, handler);
+			current->thread.ksp_limit = saved_sp_limit;
 			irqtp->task = NULL;


@@ -352,9 +356,7 @@ void __init init_IRQ(void)
 {
 	if (ppc_md.init_IRQ)
 		ppc_md.init_IRQ();
-#ifdef CONFIG_PPC64
 	irq_ctx_init();
-#endif
 }


@@ -383,11 +385,15 @@ void irq_ctx_init(void)
 static inline void do_softirq_onstack(void)
 {
 	struct thread_info *curtp, *irqtp;
+	unsigned long saved_sp_limit = current->thread.ksp_limit;

 	curtp = current_thread_info();
 	irqtp = softirq_ctx[smp_processor_id()];
 	irqtp->task = curtp->task;
+	current->thread.ksp_limit = (unsigned long)irqtp +
+				    _ALIGN_UP(sizeof(struct thread_info), 16);
 	call_do_softirq(irqtp);
+	current->thread.ksp_limit = saved_sp_limit;
 	irqtp->task = NULL;
 }

diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S
index 92ccc6f..89aaaa6 100644
--- a/arch/powerpc/kernel/misc_32.S
+++ b/arch/powerpc/kernel/misc_32.S
@@ -32,6 +32,31 @@

 	.text

+#ifdef CONFIG_IRQSTACKS
+_GLOBAL(call_do_softirq)
+	mflr	r0
+	stw	r0,4(r1)
+	stwu	r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r3)
+	mr	r1,r3
+	bl	__do_softirq
+	lwz	r1,0(r1)
+	lwz	r0,4(r1)
+	mtlr	r0
+	blr
+
+_GLOBAL(call_handle_irq)
+	mflr	r0
+	stw	r0,4(r1)
+	mtctr	r6
+	stwu	r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r5)
+	mr	r1,r5
+	bctrl
+	lwz	r1,0(r1)
+	lwz	r0,4(r1)
+	mtlr	r0
+	blr
+#endif /* CONFIG_IRQSTACKS */
+
 /*
  * This returns the high 64 bits of the product of two 64-bit numbers.
  */
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 6caad17..7de41c3 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -589,6 +589,8 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
 	kregs = (struct pt_regs *) sp;
 	sp -= STACK_FRAME_OVERHEAD;
 	p->thread.ksp = sp;
+	p->thread.ksp_limit = (unsigned long)task_stack_page(p) +
+				_ALIGN_UP(sizeof(struct thread_info), 16);

 #ifdef CONFIG_PPC64
 	if (cpu_has_feature(CPU_FTR_SLB)) {
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index 36f6779..5112a4a 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -16,6 +16,7 @@
 #include <linux/root_dev.h>
 #include <linux/cpu.h>
 #include <linux/console.h>
+#include <linux/lmb.h>

 #include <asm/io.h>
 #include <asm/prom.h>
@@ -229,6 +230,24 @@ int __init ppc_init(void)

 arch_initcall(ppc_init);

+#ifdef CONFIG_IRQSTACKS
+static void __init irqstack_early_init(void)
+{
+	unsigned int i;
+
+	/* interrupt stacks must be in lowmem, we get that for free on ppc32
+	 * as the lmb is limited to lowmem by LMB_REAL_LIMIT */
+	for_each_possible_cpu(i) {
+		softirq_ctx[i] = (struct thread_info *)
+			__va(lmb_alloc(THREAD_SIZE, THREAD_SIZE));
+		hardirq_ctx[i] = (struct thread_info *)
+			__va(lmb_alloc(THREAD_SIZE, THREAD_SIZE));
+	}
+}
+#else
+#define irqstack_early_init()
+#endif
+
 /* Warning, IO base is not yet inited */
 void __init setup_arch(char **cmdline_p)
 {
@@ -286,6 +305,8 @@ void __init setup_arch(char **cmdline_p)
 	init_mm.end_data = (unsigned long) _edata;
 	init_mm.brk = klimit;

+	irqstack_early_init();
+
 	/* set up the bootmem stuff with available memory */
 	do_init_bootmem();
 	if ( ppc_md.progress ) ppc_md.progress("setup_arch: bootmem", 0x3eab);
diff --git a/include/asm-powerpc/processor.h b/include/asm-powerpc/processor.h
index fd98ca9..cf83f2d 100644
--- a/include/asm-powerpc/processor.h
+++ b/include/asm-powerpc/processor.h
@@ -138,6 +138,8 @@ typedef struct {

 struct thread_struct {
 	unsigned long	ksp;		/* Kernel stack pointer */
+	unsigned long	ksp_limit;	/* if ksp <= ksp_limit stack overflow */
+
 #ifdef CONFIG_PPC64
 	unsigned long	ksp_vsid;
 #endif
@@ -182,11 +184,14 @@ struct thread_struct {
 #define ARCH_MIN_TASKALIGN 16

 #define INIT_SP		(sizeof(init_stack) + (unsigned long) &init_stack)
+#define INIT_SP_LIMIT \
+	(_ALIGN_UP(sizeof(init_thread_info), 16) + (unsigned long) &init_stack)


 #ifdef CONFIG_PPC32
 #define INIT_THREAD { \
 	.ksp = INIT_SP, \
+	.ksp_limit = INIT_SP_LIMIT, \
 	.fs = KERNEL_DS, \
 	.pgdir = swapper_pg_dir, \
 	.fpexc_mode = MSR_FE0 | MSR_FE1, \
@@ -194,6 +199,7 @@ struct thread_struct {
 #else
 #define INIT_THREAD  { \
 	.ksp = INIT_SP, \
+	.ksp_limit = INIT_SP_LIMIT, \
 	.regs = (struct pt_regs *)INIT_SP - 1, /* XXX bogus, I think */ \
 	.fs = KERNEL_DS, \
 	.fpr = {0}, \
-- 
1.5.4.1

^ permalink raw reply related


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