LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ppc32: 8xx board-specific platform stuff for fs_enet
From: Vitaly Bordug @ 2005-11-16 12:04 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: linuxppc-embedded list

This adds board-specific files needed to utilize fs_enet Ethernet driver
for MPC885ADS and MPC866ADS.

Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>


---

  arch/ppc/Kconfig                     |   47 ++++
  arch/ppc/platforms/Makefile          |    2
  arch/ppc/platforms/fads.h            |    2
  arch/ppc/platforms/mpc866ads_setup.c |  290 ++++++++++++++++++++++++
  arch/ppc/platforms/mpc885ads_setup.c |  408 ++++++++++++++++++++++++++++++++++
  5 files changed, 748 insertions(+), 1 deletions(-)
  create mode 100644 arch/ppc/platforms/mpc866ads_setup.c
  create mode 100644 arch/ppc/platforms/mpc885ads_setup.c

applies-to: f358a802ba9f62bb4777d5f626f2972d1b0fa43b
4c4f454bd8e79fd67bc86aa9a22604f66d682d3b
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index 8fa51b0..8e6fcb2 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -506,6 +506,53 @@ config WINCEPT

  endchoice

+menu "Freescale Ethernet driver platform-specific options"
+	depends on FS_ENET
+
+	config MPC8xx_SECOND_ETH
+	bool "Second Ethernet channel"
+	depends on (MPC885ADS || MPC86XADS)
+	default y
+	help
+	  This enables support for second Ethernet on MPC885ADS and MPC86xADS boards.
+	  The latter will use SCC1, for 885ADS you can select it below.
+
+	choice
+		prompt "Second Ethernet channel"
+		depends on MPC8xx_SECOND_ETH
+		default MPC8xx_SECOND_ETH_FEC2
+
+		config MPC8xx_SECOND_ETH_FEC2
+		bool "FEC2"
+		depends on MPC885ADS
+		help
+		  Enable FEC2 to serve as 2-nd Ethernet channel. Note that SMC2
+		  (often 2-nd UART) will not work if this is enabled.
+
+		config MPC8xx_SECOND_ETH_SCC1
+		bool "SCC1"
+		depends on MPC86XADS
+		select MPC8xx_SCC_ENET_FIXED
+		help
+		  Enable SCC1 to serve as 2-nd Ethernet channel. Note that SMC1
+		  (often 1-nd UART) will not work if this is enabled.
+
+		config MPC8xx_SECOND_ETH_SCC3
+		bool "SCC3"
+		depends on MPC885ADS
+		help
+		  Enable SCC3 to serve as 2-nd Ethernet channel. Note that SMC1
+		  (often 1-nd UART) will not work if this is enabled.
+
+	endchoice
+
+	config MPC8xx_SCC_ENET_FIXED
+	depends on MPC8xx_SECOND_ETH_SCC
+	default n
+	bool "Use fixed MII-less mode for SCC Ethernet"
+
+endmenu
+
  choice
  	prompt "Machine Type"
  	depends on 6xx || POWER3 || POWER4
diff --git a/arch/ppc/platforms/Makefile b/arch/ppc/platforms/Makefile
index 7c5cdab..cce6487 100644
--- a/arch/ppc/platforms/Makefile
+++ b/arch/ppc/platforms/Makefile
@@ -45,6 +45,8 @@ obj-$(CONFIG_SBC82xx)		+= sbc82xx.o
  obj-$(CONFIG_SPRUCE)		+= spruce.o
  obj-$(CONFIG_LITE5200)		+= lite5200.o
  obj-$(CONFIG_EV64360)		+= ev64360.o
+obj-$(CONFIG_MPC86XADS)		+= mpc866ads_setup.o
+obj-$(CONFIG_MPC885ADS)		+= mpc885ads_setup.o

  ifeq ($(CONFIG_SMP),y)
  obj-$(CONFIG_PPC_PMAC)		+= pmac_smp.o
diff --git a/arch/ppc/platforms/fads.h b/arch/ppc/platforms/fads.h
index a48fb8d..e1c0b1b 100644
--- a/arch/ppc/platforms/fads.h
+++ b/arch/ppc/platforms/fads.h
@@ -112,7 +112,7 @@

  /* CPM Ethernet through SCC1 or SCC2 */

-#ifdef CONFIG_SCC1_ENET		/* Probably 860 variant */
+#if defined(CONFIG_SCC1_ENET) || defined(CONFIG_MPC8xx_SECOND_ETH_SCC1)		/* Probably 860
variant */
  /* Bits in parallel I/O port registers that have to be set/cleared
   * to configure the pins for SCC1 use.
   * TCLK - CLK1, RCLK - CLK2.
diff --git a/arch/ppc/platforms/mpc866ads_setup.c b/arch/ppc/platforms/mpc866ads_setup.c
new file mode 100644
index 0000000..6ffdb0e
--- /dev/null
+++ b/arch/ppc/platforms/mpc866ads_setup.c
@@ -0,0 +1,290 @@
+/*arch/ppc/platforms/mpc885ads-setup.c
+ *
+ * Platform setup for the Freescale mpc885ads board
+ *
+ * Vitaly Bordug <vbordug@ru.mvista.com>
+ *
+ * Copyright 2005 MontaVista Software Inc.
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/param.h>
+#include <linux/string.h>
+#include <linux/ioport.h>
+#include <linux/device.h>
+
+#include <linux/fs_enet_pd.h>
+#include <linux/mii.h>
+
+#include <asm/delay.h>
+#include <asm/io.h>
+#include <asm/machdep.h>
+#include <asm/page.h>
+#include <asm/processor.h>
+#include <asm/system.h>
+#include <asm/time.h>
+#include <asm/ppcboot.h>
+#include <asm/8xx_immap.h>
+#include <asm/commproc.h>
+#include <asm/ppc_sys.h>
+#include <asm/mpc8xx.h>
+
+extern unsigned char __res[];
+
+/* access ports */
+#define setbits32(_addr, _v) out_be32(&(_addr), in_be32(&(_addr)) |  (_v))
+#define clrbits32(_addr, _v) out_be32(&(_addr), in_be32(&(_addr)) & ~(_v))
+
+#define setbits16(_addr, _v) out_be16(&(_addr), in_be16(&(_addr)) |  (_v))
+#define clrbits16(_addr, _v) out_be16(&(_addr), in_be16(&(_addr)) & ~(_v))
+
+static struct fs_mii_bus_info fec_mii_bus_info = {
+	.method = fsmii_fec,
+	.id = 0,
+};
+
+static struct fs_mii_bus_info scc_mii_bus_info = {
+	.method = fsmii_fixed,
+	.id = 0,
+	.i.fixed.speed = 10,
+	.i.fixed.duplex = 0,
+};
+
+static struct fs_platform_info mpc8xx_fec_pdata[] = {
+	{
+	 .rx_ring = 128,
+	 .tx_ring = 16,
+	 .rx_copybreak = 240,
+
+	 .use_napi = 1,
+	 .napi_weight = 17,
+
+	 .phy_addr = 15,
+	 .phy_irq = -1,
+
+	 .use_rmii = 0,
+
+	 .bus_info = &fec_mii_bus_info,
+	 }
+};
+
+static struct fs_platform_info mpc8xx_scc_pdata = {
+	.rx_ring = 64,
+	.tx_ring = 8,
+	.rx_copybreak = 240,
+
+	.use_napi = 1,
+	.napi_weight = 17,
+
+	.phy_addr = -1,
+	.phy_irq = -1,
+
+	.bus_info = &scc_mii_bus_info,
+};
+
+static void mpc866_nonplatform_device_init(void)
+{
+	volatile cpm8xx_t *cp = cpmp;
+	unsigned *bcsr_io;
+
+	bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
+
+	if (bcsr_io == NULL) {
+		printk(KERN_CRIT "Could not remap BCSR1\n");
+		return;
+	}
+#ifdef CONFIG_SERIAL_CPM_SMC1
+	cp->cp_simode &= ~(0xe0000000 >> 17);	/* brg1 */
+	out_be32(bcsr_io, in_be32(bcsr_io) & ~(0x80000000 >> 7));
+#else
+	out_be32(bcsr_io, in_be32(bcsr_io) | (0x80000000 >> 7));
+	cp->cp_pbpar &= ~(0x000000c0);
+	cp->cp_pbdir |= 0x000000c0;
+	cp->cp_smc[0].smc_smcmr = 0;
+	cp->cp_smc[0].smc_smce = 0;
+#endif
+
+#ifdef CONFIG_SERIAL_CPM_SMC2
+	cp->cp_simode &= ~(0xe0000000 >> 1);
+	cp->cp_simode |= (0x20000000 >> 1);	/* brg2 */
+	out_be32(bcsr_io, in_be32(bcsr_io) & ~(0x80000000 >> 13));
+#else
+	out_be32(bcsr_io, in_be32(bcsr_io) | (0x80000000 >> 13));
+	cp->cp_pbpar &= ~(0x00000c00);
+	cp->cp_pbdir |= 0x00000c00;
+	cp->cp_smc[1].smc_smcmr = 0;
+	cp->cp_smc[1].smc_smce = 0;
+#endif
+	iounmap(bcsr_io);
+}
+
+static void setup_fec1_ioports(void)
+{
+	immap_t *immap = (immap_t *) IMAP_ADDR;
+
+	setbits16(immap->im_ioport.iop_pdpar, 0x1fff);
+	setbits16(immap->im_ioport.iop_pddir, 0x1fff);
+}
+
+static void setup_scc1_ioports(void)
+{
+	immap_t *immap = (immap_t *) IMAP_ADDR;
+	unsigned *bcsr_io;
+
+	bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
+
+	if (bcsr_io == NULL) {
+		printk(KERN_CRIT "Could not remap BCSR1\n");
+		return;
+	}
+
+	/* Enable the PHY.
+	 */
+	out_be32(bcsr_io, in_be32(bcsr_io) & ~BCSR1_ETHEN);
+
+	/* Configure port A pins for Txd and Rxd.
+	 */
+	/* Disable receive and transmit in case EPPC-Bug started it.
+	 */
+	setbits16(immap->im_ioport.iop_papar, PA_ENET_RXD | PA_ENET_TXD);
+	clrbits16(immap->im_ioport.iop_padir, PA_ENET_RXD | PA_ENET_TXD);
+	clrbits16(immap->im_ioport.iop_paodr, PA_ENET_TXD);
+
+	/* Configure port C pins to enable CLSN and RENA.
+	 */
+	clrbits16(immap->im_ioport.iop_pcpar, PC_ENET_CLSN | PC_ENET_RENA);
+	clrbits16(immap->im_ioport.iop_pcdir, PC_ENET_CLSN | PC_ENET_RENA);
+	setbits16(immap->im_ioport.iop_pcso, PC_ENET_CLSN | PC_ENET_RENA);
+	/* Configure port A for TCLK and RCLK.
+	 */
+	setbits16(immap->im_ioport.iop_papar, PA_ENET_TCLK | PA_ENET_RCLK);
+	clrbits16(immap->im_ioport.iop_padir, PA_ENET_TCLK | PA_ENET_RCLK);
+	clrbits32(immap->im_cpm.cp_pbpar, PB_ENET_TENA);
+	clrbits32(immap->im_cpm.cp_pbdir, PB_ENET_TENA);
+
+	/* Configure Serial Interface clock routing.
+	 * First, clear all SCC bits to zero, then set the ones we want.
+	 */
+	clrbits32(immap->im_cpm.cp_sicr, SICR_ENET_MASK);
+	setbits32(immap->im_cpm.cp_sicr, SICR_ENET_CLKRT);
+
+	/* In the original SCC enet driver the following code is placed at the end of the
initialization */
+	setbits32(immap->im_cpm.cp_pbpar, PB_ENET_TENA);
+	setbits32(immap->im_cpm.cp_pbdir, PB_ENET_TENA);
+
+}
+
+static void mpc866ads_fixup_enet_pdata(struct platform_device *pdev,
+					      int fs_no)
+{
+	struct fs_platform_info *fpi = pdev->dev.platform_data;
+
+	volatile cpm8xx_t *cp;
+	bd_t *bd = (bd_t *) __res;
+	char *e;
+	int i;
+
+	/* Get pointer to Communication Processor */
+	cp = cpmp;
+	switch (fs_no) {
+	case fsid_fec1:
+		fpi = &mpc8xx_fec_pdata[0];
+		fpi->init_ioports = &setup_fec1_ioports;
+
+		break;
+	case fsid_scc1:
+		fpi = &mpc8xx_scc_pdata;
+		fpi->init_ioports = &setup_scc1_ioports;
+
+		break;
+	default:
+		break;
+	}
+
+	pdev->dev.platform_data = fpi;
+	fpi->fs_no = fs_no;
+
+	e = (unsigned char *)&bd->bi_enetaddr;
+	for (i = 0; i < 6; i++)
+		fpi->macaddr[i] = *e++;
+
+	fpi->macaddr[5 - pdev->id]++;
+
+}
+
+static void mpc866ads_fixup_fec_enet_pdata(struct platform_device *pdev,
+						  int idx)
+{
+	/* This is for FEC devices only */
+	if (strcmp(pdev->name, "fsl-cpm-fec"))
+		return;
+	mpc866ads_fixup_enet_pdata(pdev, fsid_fec1 + pdev->id - 1);
+}
+
+static void mpc866ads_fixup_scc_enet_pdata(struct platform_device *pdev,
+						  int idx)
+{
+	/* This is for SCC devices only */
+	if (strcmp(pdev->name, "fsl-cpm-scc"))
+		return;
+
+	mpc866ads_fixup_enet_pdata(pdev, fsid_scc1 + pdev->id - 1);
+}
+
+static int mpc866ads_platform_notify(struct device *dev)
+{
+	static struct {
+		const char *bus_id;
+		void (*rtn) (struct platform_device * pdev, int idx);
+	} dev_map[] = {
+		{
+		"fsl-cpm-fec", mpc866ads_fixup_fec_enet_pdata}, {
+	"fsl-cpm-scc", mpc866ads_fixup_scc_enet_pdata},};
+	struct platform_device *pdev;
+	int i, j, idx;
+	const char *s;
+	if (dev && dev->bus_id)
+		for (i = 0; i < ARRAY_SIZE(dev_map); i++) {
+			idx = -1;
+
+			if ((s = strrchr(dev->bus_id, '.')) != NULL)
+				idx = (int)simple_strtol(s + 1, NULL, 10);
+			else
+				s = dev->bus_id;
+			j = s - dev->bus_id;
+			if (!strncmp(dev->bus_id, dev_map[i].bus_id, j)) {
+				pdev =
+				    container_of(dev, struct platform_device,
+						 dev);
+				dev_map[i].rtn(pdev, idx);
+			}
+		}
+	return 0;
+}
+
+int __init mpc866ads_init(void)
+{
+	printk(KERN_NOTICE "mpc866ads: Init\n");
+
+	mpc866_nonplatform_device_init();
+	platform_notify = mpc866ads_platform_notify;
+
+	identify_ppc_sys_by_name(BOARD_CHIP_NAME);
+
+	ppc_sys_device_remove(MPC8xx_CPM_FEC2);
+	ppc_sys_device_remove(MPC8xx_CPM_SCC3);
+	ppc_sys_device_remove(MPC8xx_CPM_SCC2);
+	ppc_sys_device_remove(MPC8xx_CPM_SCC4);
+	ppc_sys_device_remove(MPC8xx_CPM_SMC1);
+	ppc_sys_device_remove(MPC8xx_CPM_SMC2);
+
+	return 0;
+}
+
+arch_initcall(mpc866ads_init);
diff --git a/arch/ppc/platforms/mpc885ads_setup.c b/arch/ppc/platforms/mpc885ads_setup.c
new file mode 100644
index 0000000..37c5c7b
--- /dev/null
+++ b/arch/ppc/platforms/mpc885ads_setup.c
@@ -0,0 +1,408 @@
+/*arch/ppc/platforms/mpc885ads-setup.c
+ *
+ * Platform setup for the Freescale mpc885ads board
+ *
+ * Vitaly Bordug <vbordug@ru.mvista.com>
+ *
+ * Copyright 2005 MontaVista Software Inc.
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/param.h>
+#include <linux/string.h>
+#include <linux/ioport.h>
+#include <linux/device.h>
+
+#include <linux/fs_enet_pd.h>
+#include <linux/mii.h>
+
+#include <asm/delay.h>
+#include <asm/io.h>
+#include <asm/machdep.h>
+#include <asm/page.h>
+#include <asm/processor.h>
+#include <asm/system.h>
+#include <asm/time.h>
+#include <asm/ppcboot.h>
+#include <asm/8xx_immap.h>
+#include <asm/commproc.h>
+#include <asm/ppc_sys.h>
+
+extern unsigned char __res[];
+
+/* access ports */
+#define setbits32(_addr, _v) out_be32(&(_addr), in_be32(&(_addr)) |  (_v))
+#define clrbits32(_addr, _v) out_be32(&(_addr), in_be32(&(_addr)) & ~(_v))
+
+#define setbits16(_addr, _v) out_be16(&(_addr), in_be16(&(_addr)) |  (_v))
+#define clrbits16(_addr, _v) out_be16(&(_addr), in_be16(&(_addr)) & ~(_v))
+
+void __init mpc885ads_scc_phy_init(char);
+
+static struct fs_mii_bus_info fec_mii_bus_info = {
+	.method = fsmii_fec,
+	.id = 0,
+};
+
+static struct fs_mii_bus_info scc_mii_bus_info = {
+#ifdef CONFIG_SCC_ENET_8xx_FIXED
+	.method = fsmii_fixed,
+#else
+	.method = fsmii_fec,
+#endif
+
+	.id = 0,
+};
+
+static struct fs_platform_info mpc8xx_fec_pdata[] = {
+	{
+	 .rx_ring = 128,
+	 .tx_ring = 16,
+	 .rx_copybreak = 240,
+
+	 .use_napi = 1,
+	 .napi_weight = 17,
+
+	 .phy_addr = 0,
+	 .phy_irq = SIU_IRQ7,
+
+	 .bus_info = &fec_mii_bus_info,
+	 }, {
+	     .rx_ring = 128,
+	     .tx_ring = 16,
+	     .rx_copybreak = 240,
+
+	     .use_napi = 1,
+	     .napi_weight = 17,
+
+	     .phy_addr = 1,
+	     .phy_irq = SIU_IRQ7,
+
+	     .bus_info = &fec_mii_bus_info,
+	     }
+};
+
+static struct fs_platform_info mpc8xx_scc_pdata = {
+	.rx_ring = 64,
+	.tx_ring = 8,
+	.rx_copybreak = 240,
+
+	.use_napi = 1,
+	.napi_weight = 17,
+
+	.phy_addr = 2,
+#ifdef CONFIG_MPC8xx_SCC_ENET_FIXED
+	.phy_irq = -1,
+#else
+	.phy_irq = SIU_IRQ7,
+#endif
+
+	.bus_info = &scc_mii_bus_info,
+};
+
+static void mpc885_nonplatform_device_init(void)
+{
+	volatile cpm8xx_t *cp = cpmp;
+	unsigned *bcsr_io;
+
+#ifdef CONFIG_FS_ENET
+	immap_t *immap = (immap_t *) IMAP_ADDR;
+#endif
+	bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
+
+	if (bcsr_io == NULL) {
+		printk(KERN_CRIT "Could not remap BCSR\n");
+		return;
+	}
+#ifdef CONFIG_SERIAL_CPM_SMC1
+	cp->cp_simode &= ~(0xe0000000 >> 17);	/* brg1 */
+	out_be32(bcsr_io, in_be32(bcsr_io) & ~BCSR1_RS232EN_1);
+#else
+	out_be32(bcsr_io, in_be32(bcsr_io) | BCSR1_RS232EN_1);
+	cp->cp_smc[0].smc_smcmr = 0;
+	cp->cp_smc[0].smc_smce = 0;
+#endif
+
+#ifdef CONFIG_SERIAL_CPM_SMC2
+	cp->cp_simode &= ~(0xe0000000 >> 1);
+	cp->cp_simode |= (0x20000000 >> 1);	/* brg2 */
+	out_be32(bcsr_io, in_be32(bcsr_io) & ~BCSR1_RS232EN_2);
+#else
+	out_be32(bcsr_io, in_be32(bcsr_io) | BCSR1_RS232EN_2);
+	cp->cp_smc[1].smc_smcmr = 0;
+	cp->cp_smc[1].smc_smce = 0;
+#endif
+	iounmap(bcsr_io);
+
+#ifdef CONFIG_FS_ENET
+	/* use MDC for MII (common) */
+	setbits16(immap->im_ioport.iop_pdpar, 0x0080);
+	clrbits16(immap->im_ioport.iop_pddir, 0x0080);
+#endif
+}
+
+static void setup_fec1_ioports(void)
+{
+	immap_t *immap = (immap_t *) IMAP_ADDR;
+
+	/* configure FEC1 pins  */
+	setbits16(immap->im_ioport.iop_papar, 0xf830);
+	setbits16(immap->im_ioport.iop_padir, 0x0830);
+	clrbits16(immap->im_ioport.iop_padir, 0xf000);
+	setbits32(immap->im_cpm.cp_pbpar, 0x00001001);
+
+	clrbits32(immap->im_cpm.cp_pbdir, 0x00001001);
+	setbits16(immap->im_ioport.iop_pcpar, 0x000c);
+	clrbits16(immap->im_ioport.iop_pcdir, 0x000c);
+	setbits32(immap->im_cpm.cp_pepar, 0x00000003);
+
+	setbits32(immap->im_cpm.cp_pedir, 0x00000003);
+	clrbits32(immap->im_cpm.cp_peso, 0x00000003);
+	clrbits32(immap->im_cpm.cp_cptr, 0x00000100);
+}
+
+static void setup_fec2_ioports(void)
+{
+	immap_t *immap = (immap_t *) IMAP_ADDR;
+
+	/* configure FEC2 pins */
+	setbits32(immap->im_cpm.cp_pepar, 0x0003fffc);
+	setbits32(immap->im_cpm.cp_pedir, 0x0003fffc);
+	setbits32(immap->im_cpm.cp_peso, 0x00037800);
+	clrbits32(immap->im_cpm.cp_peso, 0x000087fc);
+	clrbits32(immap->im_cpm.cp_cptr, 0x00000080);
+}
+
+static void setup_scc3_ioports(void)
+{
+	immap_t *immap = (immap_t *) IMAP_ADDR;
+	unsigned *bcsr_io;
+
+	bcsr_io = ioremap(BCSR_ADDR, BCSR_SIZE);
+
+	if (bcsr_io == NULL) {
+		printk(KERN_CRIT "Could not remap BCSR\n");
+		return;
+	}
+
+	/* Enable the PHY.
+	 */
+	out_be32(bcsr_io + 4, in_be32(bcsr_io + 4) | BCSR4_ETH10_RST);
+
+	/* Configure port A pins for Txd and Rxd.
+	 */
+	setbits16(immap->im_ioport.iop_papar, PA_ENET_RXD | PA_ENET_TXD);
+	clrbits16(immap->im_ioport.iop_padir, PA_ENET_RXD | PA_ENET_TXD);
+
+	/* Configure port C pins to enable CLSN and RENA.
+	 */
+	clrbits16(immap->im_ioport.iop_pcpar, PC_ENET_CLSN | PC_ENET_RENA);
+	clrbits16(immap->im_ioport.iop_pcdir, PC_ENET_CLSN | PC_ENET_RENA);
+	setbits16(immap->im_ioport.iop_pcso, PC_ENET_CLSN | PC_ENET_RENA);
+
+	/* Configure port E for TCLK and RCLK.
+	 */
+	setbits32(immap->im_cpm.cp_pepar, PE_ENET_TCLK | PE_ENET_RCLK);
+	clrbits32(immap->im_cpm.cp_pepar, PE_ENET_TENA);
+	clrbits32(immap->im_cpm.cp_pedir,
+		  PE_ENET_TCLK | PE_ENET_RCLK | PE_ENET_TENA);
+	clrbits32(immap->im_cpm.cp_peso, PE_ENET_TCLK | PE_ENET_RCLK);
+	setbits32(immap->im_cpm.cp_peso, PE_ENET_TENA);
+
+	/* Configure Serial Interface clock routing.
+	 * First, clear all SCC bits to zero, then set the ones we want.
+	 */
+	clrbits32(immap->im_cpm.cp_sicr, SICR_ENET_MASK);
+	setbits32(immap->im_cpm.cp_sicr, SICR_ENET_CLKRT);
+
+	/* Disable Rx and Tx. SMC1 sshould be stopped if SCC3 eternet are used.
+	 */
+	immap->im_cpm.cp_smc[0].smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN);
+	/* On the MPC885ADS SCC ethernet PHY is initialized in the full duplex mode
+	 * by H/W setting after reset. SCC ethernet controller support only half duplex.
+	 * This discrepancy of modes causes a lot of carrier lost errors.
+	 */
+
+	/* In the original SCC enet driver the following code is placed at the end of the
initialization */
+	setbits32(immap->im_cpm.cp_pepar, PE_ENET_TENA);
+	clrbits32(immap->im_cpm.cp_pedir, PE_ENET_TENA);
+	setbits32(immap->im_cpm.cp_peso, PE_ENET_TENA);
+
+	out_be32(bcsr_io + 1, in_be32(bcsr_io + 1) | BCSR1_ETHEN);
+	iounmap(bcsr_io);
+}
+
+static void mpc885ads_fixup_enet_pdata(struct platform_device *pdev,
+					      int fs_no)
+{
+	struct fs_platform_info *fpi = pdev->dev.platform_data;
+
+	volatile cpm8xx_t *cp;
+	bd_t *bd = (bd_t *) __res;
+	char *e;
+	int i;
+
+	/* Get pointer to Communication Processor */
+	cp = cpmp;
+	switch (fs_no) {
+	case fsid_fec1:
+		fpi = &mpc8xx_fec_pdata[0];
+		fpi->init_ioports = &setup_fec1_ioports;
+		break;
+	case fsid_fec2:
+		fpi = &mpc8xx_fec_pdata[1];
+		fpi->init_ioports = &setup_fec2_ioports;
+		break;
+	case fsid_scc3:
+		fpi = &mpc8xx_scc_pdata;
+		fpi->init_ioports = &setup_scc3_ioports;
+		mpc885ads_scc_phy_init(fpi->phy_addr);
+		break;
+	default:
+		break;
+	}
+
+	pdev->dev.platform_data = fpi;
+	fpi->fs_no = fs_no;
+
+	e = (unsigned char *)&bd->bi_enetaddr;
+	for (i = 0; i < 6; i++)
+		fpi->macaddr[i] = *e++;
+
+	fpi->macaddr[5 - pdev->id]++;
+
+}
+
+static void mpc885ads_fixup_fec_enet_pdata(struct platform_device *pdev,
+						  int idx)
+{
+	/* This is for FEC devices only */
+	if (!strstr(pdev->name, "fsl-cpm-fec"))
+		return;
+	mpc885ads_fixup_enet_pdata(pdev, fsid_fec1 + pdev->id - 1);
+}
+
+static void __init mpc885ads_fixup_scc_enet_pdata(struct platform_device *pdev,
+						  int idx)
+{
+	/* This is for SCC devices only */
+	if (!strstr(pdev->name, "fsl-cpm-scc"))
+		return;
+
+	mpc885ads_fixup_enet_pdata(pdev, fsid_scc1 + pdev->id - 1);
+}
+
+/* SCC ethernet controller does not have MII management channel. FEC1 MII
+ * channel is used to communicate with the 10Mbit PHY.
+ */
+
+#define MII_ECNTRL_PINMUX        0x4
+#define FEC_ECNTRL_PINMUX        0x00000004
+#define FEC_RCNTRL_MII_MODE        0x00000004
+
+/* Make MII read/write commands.
+ */
+#define mk_mii_write(REG, VAL, PHY_ADDR)    (0x50020000 | (((REG) & 0x1f) << 18) | \
+                ((VAL) & 0xffff) | ((PHY_ADDR) << 23))
+
+static void mpc885ads_scc_phy_init(char phy_addr)
+{
+	volatile immap_t *immap;
+	volatile fec_t *fecp;
+	bd_t *bd;
+
+	bd = (bd_t *) __res;
+	immap = (immap_t *) IMAP_ADDR;	/* pointer to internal registers */
+	fecp = &(immap->im_cpm.cp_fec);
+
+	/* Enable MII pins of the FEC1
+	 */
+	setbits16(immap->im_ioport.iop_pdpar,0x0080);
+	clrbits16(immap->im_ioport.iop_pddir,0x0080);
+	/* Set MII speed to 2.5 MHz
+	 */
+	out_be32(&fecp->fec_mii_speed,
+		 ((((bd->bi_intfreq + 4999999) / 2500000) / 2) & 0x3F) << 1);
+
+	/* Enable FEC pin MUX
+	 */
+	setbits32(fecp->fec_ecntrl, MII_ECNTRL_PINMUX);
+	setbits32(fecp->fec_r_cntrl, FEC_RCNTRL_MII_MODE);
+
+	out_be32(&fecp->fec_mii_data, mk_mii_write(MII_BMCR, BMCR_ISOLATE, phy_addr));
+	udelay(100);
+	out_be32(&fecp->fec_mii_data,
+		 mk_mii_write(MII_ADVERTISE,
+			      ADVERTISE_10HALF | ADVERTISE_CSMA,phy_addr));
+	udelay(100);
+
+	/* Disable FEC MII settings
+	 */
+	clrbits32(fecp->fec_ecntrl, MII_ECNTRL_PINMUX);
+	clrbits32(fecp->fec_r_cntrl, FEC_RCNTRL_MII_MODE);
+	out_be32(&fecp->fec_mii_speed, 0);
+}
+
+static int mpc885ads_platform_notify(struct device *dev)
+{
+	static struct {
+		const char *bus_id;
+		void (*rtn) (struct platform_device * pdev, int idx);
+	} dev_map[] = {
+		{
+		"fsl-cpm-fec", mpc885ads_fixup_fec_enet_pdata}, {
+	"fsl-cpm-scc", mpc885ads_fixup_scc_enet_pdata},};
+	struct platform_device *pdev;
+	int i, j, idx;
+	const char *s;
+	if (dev && dev->bus_id)
+		for (i = 0; i < ARRAY_SIZE(dev_map); i++) {
+			idx = -1;
+
+			if ((s = strrchr(dev->bus_id, '.')) != NULL)
+				idx = (int)simple_strtol(s + 1, NULL, 10);
+			else
+				s = dev->bus_id;
+			j = s - dev->bus_id;
+			if (!strncmp(dev->bus_id, dev_map[i].bus_id, j)) {
+				pdev =
+				    container_of(dev, struct platform_device,
+						 dev);
+				dev_map[i].rtn(pdev, idx);
+			}
+		}
+	return 0;
+}
+
+int __init mpc885ads_init(void)
+{
+	printk(KERN_NOTICE "mpc885ads: Init\n");
+
+	mpc885_nonplatform_device_init();
+	platform_notify = mpc885ads_platform_notify;
+
+	identify_ppc_sys_by_name(BOARD_CHIP_NAME);
+
+#ifdef CONFIG_MPC8xx_SECOND_ETH_SCC3
+	ppc_sys_device_remove(MPC8xx_CPM_FEC2);
+#endif
+#ifdef CONFIG_MPC8xx_SECOND_ETH_FEC2
+	ppc_sys_device_remove(MPC8xx_CPM_SCC3);
+#endif
+
+	ppc_sys_device_remove(MPC8xx_CPM_SCC1);
+	ppc_sys_device_remove(MPC8xx_CPM_SCC2);
+	ppc_sys_device_remove(MPC8xx_CPM_SCC4);
+	ppc_sys_device_remove(MPC8xx_CPM_SMC1);
+	ppc_sys_device_remove(MPC8xx_CPM_SMC2);
+
+	return 0;
+}
+
+arch_initcall(mpc885ads_init);
---
Sincerely,
Vitaly

^ permalink raw reply related

* 11-16-05 2.6.14 on AMCC Yosemite board(PCI-IDE card boot error)
From: KylongMu @ 2005-11-16 12:18 UTC (permalink / raw)
  To: linuxppc-embedded


[-- Attachment #1.1: Type: text/plain, Size: 1256 bytes --]

Dear Denk,

     Thanks for your help; it makes my Yosemite run up! I'm try to add a
PCI-IDE

Card on it. I test my Promise-PDC20268 card and AEC6280 (ATP865-B chip type)
card,

Both of them all failed with same error, the boot message included in the
attachment.

     The kernel configure is based on the Yosemite_defconfig, add with:

Device Drivers-->

                   ATA/ATAPI/MFM/RLL support-->

                                               [*]AEC62XX Chipset support


                                               [*]PROMISE
PDC202{68|69|70|71|75|76|77} SUPPORT  

 

     Both of the PCI-IDE cards can work with X86PC+FEDORA4 configure, I
don't know 

What cause them fail on Yosemite with final 2.6.14 kernel.

     About my 2.6.14 tree, I type with "cg-log -s" command it shows:

99a21389c2b0e55f30b6cf6550cb492b87dbaa3b Heiko Schocher  2005-11-11 12:47
[PATCH]       ppc32: fix Kernel Panic for PM82x Board with gcc-4.0.

ff1df84b3c3154ffdb646941e1c70d17554e3042 Wolfgang Denk   2005-11-10 00:41
Merge with /home/wd/git/linux-2.6/stefan_roese

 

     It only shows 2.6.14 on the kernel message, I don't know why it doesn't
show the message as you told.

But it can work, and fixed the bugs on Yosemite.

 

Cordially,

Kylong Mu

 

 


[-- Attachment #1.2: Type: text/html, Size: 10598 bytes --]

[-- Attachment #2: bootmessage(acard6280 pci-ide card).txt --]
[-- Type: text/plain, Size: 6044 bytes --]

U-Boot 1.1.4 (Nov 11 2005 - 19:35:30)

AMCC PowerPC 440EP Rev. B
Board: Yosemite - AMCC PPC440EP Evaluation Board
        VCO: 1066 MHz
        CPU: 533 MHz
        PLB: 133 MHz
        OPB: 66 MHz
        EPB: 66 MHz
        PCI: 66 MHz
I2C:   ready
DRAM:  256 MB
FLASH: 64 MB
PCI:   Bus Dev VenId DevId Class Int
        00  0c  1191  0009  0180  00
In:    serial
Out:   serial
Err:   serial
Net:   ppc_4xx_eth0, ppc_4xx_eth1

Type "run flash_nfs" to mount root filesystem over NFS

Hit any key to stop autoboot:  0
=> tftp 400000 uImage
ENET Speed is 100 Mbps - FULL duplex connection
Using ppc_4xx_eth0 device
TFTP from server 192.168.0.93; our IP address is 192.168.0.66
Filename 'uImage'.
Load address: 0x400000
Loading: #################################################################
         #################################################################
         #################################################################
         ###########################################
done
Bytes transferred = 1217393 (129371 hex)
=> bootram
Unknown command 'bootram' - try 'help'
=> run bootram
## Booting image at 00400000 ...
   Image Name:   Linux-2.6.14
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    1217329 Bytes =  1.2 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
## Loading RAMDisk Image at fed40000 ...
   Image Name:   Yosemite Ramdisk
   Image Type:   PowerPC Linux RAMDisk Image (gzip compressed)
   Data Size:    17770706 Bytes = 16.9 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Ramdisk to 0ee47000, end 0ff398d2 ... OK
Linux version 2.6.14 (root@dxp) (gcc version 4.0.0) #7 Sun Nov 13 21:59:01 CST 2005
AMCC PowerPC 440EP Yosemite Platform
Built 1 zonelists
Kernel command line: ramdisk_size=49152 root=/dev/ram rw ip=192.168.0.66:192.168.0.93::255.255.255.0:yosemite:eth0:off panic=1 console=ttyS0,115200
PID hash table entries: 2048 (order: 11, 32768 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 239616k available (1860k kernel code, 596k data, 140k init, 0k highmem)
Mount-cache hash table entries: 512
checking if image is initramfs...it isn't (no cpio magic); looks like an initrd
softlockup thread 0 started up.
Freeing initrd memory: 17354k freed
NET: Registered protocol family 16
PCI: Probing PCI hardware
usbcore: registered new driver usbfs
usbcore: registered new driver hub
SCSI subsystem initialized
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
usbmon: debugfs is not available
ppc-soc-ohci ppc-soc-ohci.0: USB Host Controller
ppc-soc-ohci ppc-soc-ohci.0: new USB bus registered, assigned bus number 1
ppc-soc-ohci ppc-soc-ohci.0: irq 40, io mem 0xef601000
usb usb1: Product: USB Host Controller
usb usb1: Manufacturer: Linux 2.6.14 ohci_hcd
usb usb1: SerialNumber: PPC-SOC USB
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
pegasus: v0.6.12 (2005/01/13), Pegasus/Pegasus II USB Ethernet driver
usbcore: registered new driver pegasus
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
serial8250: ttyS0 at MMIO 0x0 (irq = 0) is a 16550A
serial8250: ttyS1 at MMIO 0x0 (irq = 1) is a 16550A
RAMDISK driver initialized: 16 RAM disks of 49152K size 1024 blocksize
PPC 4xx OCP EMAC driver, version 3.53
mal0: initialized, 4 TX channels, 2 RX channels
zmii0: bridge in RMII mode
eth0: emac0, MAC 00:10:ec:00:87:40
eth0: found Generic MII PHY (0x01)
eth1: emac1, MAC 00:10:ec:00:87:47
eth1: found Generic MII PHY (0x03)
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
Data machine check in kernel mode.
PLB0: BEAR=0x0000000000000000 ACR=  0x00000000 BESR= 0xfffff7ff
POB0: BEAR=0xc27e3194ffffffff BESR0=0x00000000 BESR1=0x00000000
OPB0: BEAR=0x0000000000000151 BSTAT=0x00000000
Oops: machine check, sig: 7 [#1]
NIP: 00000000 LR: C0263628 SP: CFF41F40 REGS: c0271f50 TRAP: 0202    Not tainted
MSR: 00000000 EE: 0 PR: 0 FP: 0 ME: 0 IR/DR: 00
TASK = c04f8b10[1] 'swapper' THREAD: cff40000
Last syscall: 120
GPR00: FDFFEF02 CFF41F40 C04F8B10 C04FC000 C026C6B4 C04FC000 00000009 CFF41EF4
GPR08: C04F9F70 00000000 00004000 C0270000 24254322 61000408 0FFB6800 00000001
GPR16: 00800000 0FFCEAD4 FFFFFFFF 00000000 007FFF00 0FFB1210 00000003 00000002
GPR24: C01D0000 C01D0000 C0270000 C01D0000 C0270000 C0223E10 C026C6B4 C04FC000
NIP [00000000] 0x0
LR [c0263628] aec62xx_init_one+0x38/0x48
Call trace:
 [c0263628] aec62xx_init_one+0x38/0x48
 [c02649b8] ide_scan_pcidev+0x68/0xb0
 [c0264a34] ide_scan_pcibus+0x34/0xe8
 [c026492c] ide_init+0x68/0x8c
 [c00013ac] init+0xb4/0x254
 [c00046c0] kernel_thread+0x48/0x64
Data machine check in kernel mode.
PLB0: BEAR=0x0000000000000000 ACR=  0x00000000 BESR= 0xfffff7ff
POB0: BEAR=0xc27e3194ffffffff BESR0=0x00000000 BESR1=0x00000000
OPB0: BEAR=0x0000000000000151 BSTAT=0x00000000
Oops: machine check, sig: 7 [#2]
NIP: 00000000 LR: C000235C SP: C0271E70 REGS: c0271f50 TRAP: 0202    Not tainted
MSR: 00000000 EE: 0 PR: 0 FP: 0 ME: 0 IR/DR: 00
TASK = c04f8b10[1] 'swapper' THREAD: cff40000
Last syscall: 120
GPR00: 08000000 C0271E70 C04F8B10 C0271E80 00001568 FFFFFFFF C0270000 00004000
GPR08: C0270000 C000235C 00021002 C00039E8 C04F8CD8 61000408 0FFB6800 00000001
GPR16: 00800000 0FFCEAD4 FFFFFFFF 00000000 007FFF00 0FFB1210 00000003 00000002
GPR24: C01D0000 C01D0000 C0270000 C01D0000 C0270000 C0223E10 00000007 C0271F50
NIP [00000000] 0x0
LR [c000235c] ret_from_except+0x0/0x18
Kernel panic - not syncing: Attempted to kill init!
 <0>Rebooting in 1 seconds..


^ permalink raw reply

* Re: [PATCH] m8xx_wdt: software watchdog reset/interrupt select
From: Marcelo Tosatti @ 2005-11-16  8:36 UTC (permalink / raw)
  To: Florian Schirmer; +Cc: obi, carjay, linux-ppc-embedded
In-Reply-To: <437B1C53.1060004@tuxbox.org>

On Wed, Nov 16, 2005 at 12:47:31PM +0100, Florian Schirmer wrote:
> Hi,
> 
> >>The SYPCR register can be set only _once_ at machine startup and the
> >>bootloader in question does not have an option to change the mode. Many
> >>bootloaders probably dont.
> 
> Okay, i was asuming you have control over the bootloader.
> 
> >Updated patch addresses code duplication issue you mentioned and also 
> >adds an error message in case timer interrupt frequency is higher
> >than the watchdog frequency.
> >
> >Can I add your Signed-off-by in case you're OK with it?
> 
> Maybe i'm missing something obvious, but why is the interrupt driven 
> reaming code not working for your configuration. Are you using the PIT 
> for something else?

Nope.

Anyway, the SWRI bit selects interrupt (0) or reset mode (1) for the watchdog.  

On reset mode no interrupt is sent to the kernel - the watchdog logic resets
the system with HRESET.

So, the timer in m8xx_wdt is _required_ for reset mode.

Does that make sense?

> Otherwise i'm fine with the patch. Feel free to add my Signed-off-by line.

Ok, lets sort this out first. 

I wonder how interrupt mode is supposed to work, because the manual states
that in interrupt mode (SWRI == 0) an NMI (IRQ0) is triggered, which jumps
to 0x100 exception vector (SW reset).

Maybe I'm misunderstanding the interrupt mode?

Folks who wrote the patch claim it works on their 8xx's (as can be found
on mailing list archives).

^ permalink raw reply

* Re: [PATCH 2.6.14] mm: 8xx MM fix for
From: Marcelo Tosatti @ 2005-11-16  8:39 UTC (permalink / raw)
  To: Joakim Tjernlund
  Cc: 'Tom Rini', 'Dan Malek', gtolstolytkin,
	linuxppc-embedded
In-Reply-To: <TMNT04NwMmRDltJmBYW0000000a@tmnt04.transmode.se>

On Sun, Nov 13, 2005 at 01:47:53PM +0100, Joakim Tjernlund wrote:
>  
> 
> > -----Original Message-----
> > From: Marcelo Tosatti [mailto:marcelo.tosatti@cyclades.com] 
> > Sent: den 12 november 2005 20:28
> > To: Joakim Tjernlund
> > Cc: Tom Rini; Dan Malek; gtolstolytkin@ru.mvista.com; 
> > linuxppc-embedded@ozlabs.org
> > Subject: Re: [PATCH 2.6.14] mm: 8xx MM fix for
> > 
> > On Mon, Nov 07, 2005 at 07:37:45PM +0100, Joakim Tjernlund wrote:
> > >  >
> > > > On Mon, Nov 07, 2005 at 07:14:15PM +0100, Joakim Tjernlund wrote:
> > > > > > -----Original Message-----
> > > > > > From: Tom Rini [mailto:trini@kernel.crashing.org]
> > > > > > Sent: 07 November 2005 16:52
> > > > > > To: Marcelo Tosatti
> > > > > > Cc: Joakim Tjernlund; Pantelis Antoniou; Dan Malek; 
> > > > > > linuxppc-embedded@ozlabs.org; gtolstolytkin@ru.mvista.com
> > > > > > Subject: Re: [PATCH 2.6.14] mm: 8xx MM fix for
> > > > > > 
> > > > > > On Mon, Nov 07, 2005 at 08:16:18AM -0200, Marcelo 
> > Tosatti wrote:
> > > > > > > Joakim!
> > > > > > > 
> > > > > > > On Mon, Nov 07, 2005 at 03:32:52PM +0100, Joakim
> > > > Tjernlund wrote:
> > > > > > > > Hi Marcelo
> > > > > > > > 
> > > > > > > > [SNIP]
> > > > > > > > > The root of the problem are the changes against the 8xx 
> > > > > > > > > TLB handlers introduced during v2.6. What 
> > happens is the 
> > > > > > > > > TLBMiss handlers load the zeroed pte into the 
> > TLB, causing 
> > > > > > > > > the TLBError handler to be invoked (thats two 
> > TLB faults 
> > > > > > > > > per pagefault), which then jumps to the generic 
> > MM code to
> > > > > > setup the pte.
> > > > > > > > > 
> > > > > > > > > The bug is that the zeroed TLB is not invalidated (the
> > > > > > same reason
> > > > > > > > > for the "dcbst" misbehaviour), resulting in infinite
> > > > > > TLBError faults.
> > > > > > > > > 
> > > > > > > > > Dan, I wonder why we just don't go back to v2.4 
> > behaviour.
> > > > > > > > 
> > > > > > > > This is one reason why it is the way it is:
> > > > > > > > 
> > > > > > 
> > > > 
> > http://ozlabs.org/pipermail/linuxppc-embedded/2005-January/016382.ht
> > > > ml
> > > > > > > > This details are little fuzzy ATM, but I think the
> > > > reason for the
> > > > > > > > current
> > > > > > > > impl. was only that it was less intrusive to impl.
> > > > > > > 
> > > > > > > Ah, I see. I wonder if the bug is processor specific: we
> > > > > > don't have such
> > > > > > > changes in our v2.4 tree and never experienced such problem.
> > > > > > > 
> > > > > > > It should be pretty easy to hit it right? (instruction
> > > > > > pagefaults should
> > > > > > > fail).
> > > > > > > 
> > > > > > > Grigori, Tom, can you enlight us about the issue on the URL
> > > > > > above. How
> > > > > > > can it be triggered?
> > > > > > 
> > > > > > So after looking at the code in 2.6.14 and current git, I
> > > > think the
> > > > > > above URL isn't relevant, unless there was a change I
> > > > missed (which
> > > > > > could totally be possible) that reverted the patch there and 
> > > > > > fixed that issue in a different manner.  But since I didn't 
> > > > > > figure that out until I had finished researching it again:
> > > > > 
> > > > > I wasn't clear enough. What I meant was that the above 
> > patch made 
> > > > > me think and the result was that I came up with a 
> > simpler fix, the 
> > > > > "two
> > > > exception"
> > > > > fix that
> > > > > is in current kernels. See
> > > > > 
> > > > http://linux.bkbits.net:8080/linux-2.6/diffs/arch/ppc/kernel/h
> > > > ead_8xx.S@
> > > > > 
> > > > 1.19?nav=index.html|src/.|src/arch|src/arch/ppc|src/arch/ppc/k
> > > > ernel|hist
> > > > > /arch/ppc/kernel/head_8xx.S
> > > > > It appears this fix has some other issues :(
> > > > > 
> > > > > How do the other ppc arches do? I am guessing that they don't 
> > > > > double fault, but bails out to do_page_fault from the TLB Miss 
> > > > > handler, like 8xx used to do.
> > > > 
> > > > Assuming Dan doesn't come up with a more simple & better 
> > fix, maybe 
> > > > we should go back to the original patch I made?
> > > 
> > > That was what I was thinking too(or some variation of your patch) I 
> > > wonder if that would solve the misbehaving dcbst problem 
> > Marcelo found 
> > > some time ago too?
> > 
> > Hi Joakim,
> > 
> > Yes, it would fix the "dcbst" issue. That problem was 
> > triggered by a zeroed TLB entry.
> > 
> > In practice it seems that the "three exception" approach does 
> > not impose a significant overhead in comparison with the "two 
> > exception" version (as can be seen by the results of the 
> > latency tests).
> > 
> > Anyway, if decided upon, the "two exception" version (no 
> > zeroed TLB entry state) needs the TLBMiss handler should to 
> > the present bit as Dan mentioned.
> > 
> > I don't know what Dan is up to, he meant to be doing 
> > significant changes.
> > 
> > I'll be playing with TLB preloading next week... how's your 
> > TLB handler shrinkage idea?
> 
> Hi Marcelo
> 
> Its still holding I think, it's a add on to whats in linuxppc-2.4:
> http://ppc.bkbits.net:8080/linuxppc-2.4/diffs/arch/ppc/kernel/head_8xx.S@1.21?nav=index.html|src/.|src/arch|src/arch/ppc|src/arch/pp
> c/kernel|hist/arch/ppc/kernel/head_8xx.S
> 
> If one could eliminate the test for a zero L1 entry you save an extra 4 instructions.
> +	mfcr	r20
> +	cmplwi	cr0, r21, 0x0fff /* Test page descriptor page address */
> +	bng-	2f		/* If zero, don't try to find a pte */
> +	mtcr	r20
> 
> If SPRG2 is free to use you can stash r21 there, then you don't need to use RAM to stash registers.
> 
> Maybe its possible to PIN some of the vmalloc space and use that for modules?

Sure it is. That could be part of the logic to fault large pages for the kernel 
address space when possible.

^ permalink raw reply

* Re: [PATCH] powerpc: Merge align.c
From: Kumar Gala @ 2005-11-16 15:15 UTC (permalink / raw)
  To: Gabriel Paubert; +Cc: linuxppc64-dev, linuxppc-dev list
In-Reply-To: <20051116093609.GA26269@iram.es>


On Nov 16, 2005, at 3:36 AM, Gabriel Paubert wrote:

> On Tue, Nov 15, 2005 at 08:19:58PM -0600, Becky Bruce wrote:
>> Ben,
>>
>> Yeah,  I clearly shouldn't run testcases at 11pm, because I got in a
>> rush and only confirmed that lmw/stmw were actually taking the
>> exception.  Those 2 are working beautifully.  To test the others, I
>> need to run on a different board which, of course,  isn't bootable at
>> the moment.  As soon as I can get that up and running, I'll try  
>> some of
>> the other cases and let you know how it goes......
>>
>> BTW, Based on the pile of docs I have here, I think the list of
>> alignment-exception-causing events on FSL's current parts (603, 603e,
>> 750, 74x, 74xx, e500) is:
>
> The 603 is still in production? And is the upcoming 8641 exactly
> the same as the 74xx series in this respect?

603 is used in all 82xx/83xx processors from Freescale. The 8641 is  
the same core as 7448.

>> - single and double precision floating point ld/st ops (non-E500, non
>> data size aligned)
>
> Hmm, you can load a double from any 4 byte aligned address AFAIR.

This is only because every processor handles the misalignment for  
you.  Its completely valid for someone to build a PPC that has an  
alignment exception in this case.

>> - dcbz to WT or CI memory (all procs)
>> - dcbz with cache disabled (all procs but 603e?)
>> - misaligned little endian accesses (603e)
>
> I understand that you mention it for completeness since we
> don't care about LE mode AFAICT. But I believe that there
> were some differences between 603 and 603e in this area.
>
> However we do care about byte reversal instructions, which
> probably believe like the corresponding normal instruction
> (i.e., lwbrx has the same rules as lwzx, etc.)
>
>> - lwarx/stwcx (all procs)
>
> And ldarx/stdcx. on 64 bit, but these ones should not
> be emulated. So it's easy ;-)
>
>> - multiple/string with LE set (750, 603e, 7450, 7400)
>
> Again LE mode is probably irrelevant.

Agree with that. We dont support LE on classic.

>> - eciwx/ecowx (750, 7450, 7400)
>
> Have these instructions ever been used for something
> under Linux?

I dont believe so.

>> - a couple of others related to vector processing
>
> Which ones? The Altivec load and store instructions
> simply mask the low order bits AFAIR.

SPE misalignment is something to look at.

>> If anybody knows offhand of something missing there, let me know.
>
> Nothing, but did you check when crossing a segment (256MB) boundary.
> I seem to remember that some processors performed misaligned
> load/store across pages but not across segments.

- kumar

^ permalink raw reply

* Re: [PATCH] Fix 8250 probe on ppc32
From: Kumar Gala @ 2005-11-16 15:24 UTC (permalink / raw)
  To: David Woodhouse; +Cc: Tom Rini, linuxppc-dev
In-Reply-To: <1132136755.21643.40.camel@hades.cambridge.redhat.com>


On Nov 16, 2005, at 4:25 AM, David Woodhouse wrote:

> On Wed, 2005-11-16 at 20:12 +1100, Paul Mackerras wrote:
>> Yes, it works on newworld (at least it does on my G4 powerbook).  It
>> should work on 32-bit CHRP with any luck, but for oldworld we'll have
>> to generate a COFF file.
>
> I'll try it on Pegasos some time tonight or tomorrow. AFAICT I'm going
> to need the patch which started this thread, if I want any serial  
> ports
> on my Pegasos. The newly-created asm-powerpc/serial.h file is  
> devoid of
> serial port definitions.
>
> Here it is again, with Tom's three criticisms addressed, deliberately
> ignored, and addressed. In that order.
>
> It no longer touches asm-ppc/serial.h, so doesn't break the legacy
> zImage.
>
> ---
> [PATCH] Fix 8250 probe on ppc32
>
> There are no serial ports defined in the new asm-powerpc/serial.h, and
> rightly so. The 64-bit setup code has a routine to look in the device
> tree for them and register a platform_device for any we find there;  
> this
> patch steals that routine and makes it available on 32-bit machines
> too...
>
> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
>

[snip]

> --- linux-2.6.13/drivers/serial/Kconfig.sof	2005-10-20  
> 12:54:48.000000000 +0100
> +++ linux-2.6.13/drivers/serial/Kconfig	2005-10-20  
> 13:05:39.000000000 +0100
> @@ -77,6 +77,11 @@ config SERIAL_8250_CS
>
>  	  If unsure, say N.
>
> +config SERIAL_8250_OF
> +       bool
> +       default y
> +       depends on PPC_OF && SERIAL_8250 && PPC_MERGE
> +
>  config SERIAL_8250_ACPI
>  	bool "8250/16550 device discovery via ACPI namespace"
>  	default y if IA64

[snip]

Should this really depend on PPC_OF?  Does it require true  
OpenFirmware or just a flat dev tree to work?

I ask because I'd like to extended this in the future to handle 8250  
serial ports that aren't on a PCI or ISA bus, but on SoCs like 83xx,  
85xx, 86xx, 4xx?  These will most likely not be running with true OF  
but I've got a flat dev tree working today.

The following is what I've been toying with for an description of the  
8250 node (in .dts format):

                 serial@4500 {
                         device_type = "serial";
                         compatible = "ns16550";
                         reg = <4500 100>;
                         clock-frequency = <0>;
                         interrupts = <1a 3>;
                         interrupt-parent = <40000>;
                 };


- kumar

^ permalink raw reply

* Re: MPC8555 USB host support
From: Kumar Gala @ 2005-11-16 15:50 UTC (permalink / raw)
  To: Vitaly Bordug; +Cc: 'linuxppc-embedded@ozlabs.org'
In-Reply-To: <437A016C.8070405@ru.mvista.com>

Hmm, we should understand what caveats it has and still look at  
getting it into mainline.

Also, are you aware of Freescale's driver for this?

- kumar

On Nov 15, 2005, at 9:40 AM, Vitaly Bordug wrote:

> Kumar Gala wrote:
>> Any reason not to get this driver into the kernel main line?
> I guess because this device is known to work in some specific  
> instance, but bot generic one. The best we can do is to consolidate  
> our efforts to make it more usable or state that it is impossible.
>
>> - kumar
>> On Nov 15, 2005, at 12:59 AM, Mike Rapoport wrote:
>>> Hans Schillstrom wrote:
>>>
>>>> Hi Mike
>>>> I'm working with a 8270 board and 2.6.12 kernel and searching  
>>>> for USB
>>>> drivers.
>>>>
>>>> Could you help me finding the files ?
>>>>
>>> I've opened a project on the SourceForge, http:// 
>>> cpm2usb.sourceforge.net. The file containing patch against  
>>> 2.6.12.3 can be downloaded at http://sourceforge.net/projects/ 
>>> cpm2usb.
>>>
>>>> I can help you with the testing.
>>>> What status do they have right now ?
>>>>
>>> The driver was developed on MPC8272ADS, but should go as well on  
>>> 8270 since they have the same USB host controller AFAIK.
>>> Currently, as far as I tested it works fine with full-speed  
>>> single device attached through hub, but fails is there are  
>>> transfers from/to several devices simultaneously.
>>> As for the code itself, it's far from being perfect.
>>>
>>>> Regards Hans
>>>>
>>>
>>>
>>> --Sincerely yours,
>>> Mike Rapoport
>>>
>>>
>>> _______________________________________________
>>> Linuxppc-embedded mailing list
>>> Linuxppc-embedded@ozlabs.org
>>> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>> _______________________________________________
>> Linuxppc-embedded mailing list
>> Linuxppc-embedded@ozlabs.org
>> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
>
> -- 
> Sincerely,
> Vitaly

^ permalink raw reply

* Re: MPC8555 USB host support
From: Vitaly Bordug @ 2005-11-16 15:57 UTC (permalink / raw)
  To: Kumar Gala; +Cc: 'linuxppc-embedded@ozlabs.org'
In-Reply-To: <F9559612-EC8F-44BB-BA15-05DB48D4F031@kernel.crashing.org>

Kumar Gala wrote:
> Hmm, we should understand what caveats it has and still look at getting 
> it into mainline.
> 
I also have a bunch of patches for gregkh, supporting serial function, but they need 
nontrivial cleanup I do not have time currently for. So I think I grab this one together 
with my stuff when I head for it.

> Also, are you aware of Freescale's driver for this?
> 
I used to try arabella one (came with MW bsp) but that version does not work with 8272.
If there are something usable, it will be interesting to look at.

> - kumar
> 
> On Nov 15, 2005, at 9:40 AM, Vitaly Bordug wrote:
> 
>> Kumar Gala wrote:
>>> Any reason not to get this driver into the kernel main line?
>> I guess because this device is known to work in some specific 
>> instance, but bot generic one. The best we can do is to consolidate 
>> our efforts to make it more usable or state that it is impossible.
>>
>>> - kumar
>>> On Nov 15, 2005, at 12:59 AM, Mike Rapoport wrote:
>>>> Hans Schillstrom wrote:
>>>>
>>>>> Hi Mike
>>>>> I'm working with a 8270 board and 2.6.12 kernel and searching for USB
>>>>> drivers.
>>>>>
>>>>> Could you help me finding the files ?
>>>>>
>>>> I've opened a project on the SourceForge, 
>>>> http://cpm2usb.sourceforge.net. The file containing patch against 
>>>> 2.6.12.3 can be downloaded at http://sourceforge.net/projects/cpm2usb.
>>>>
>>>>> I can help you with the testing.
>>>>> What status do they have right now ?
>>>>>
>>>> The driver was developed on MPC8272ADS, but should go as well on 
>>>> 8270 since they have the same USB host controller AFAIK.
>>>> Currently, as far as I tested it works fine with full-speed single 
>>>> device attached through hub, but fails is there are transfers 
>>>> from/to several devices simultaneously.
>>>> As for the code itself, it's far from being perfect.
>>>>
>>>>> Regards Hans
>>>>>
>>>>
>>>>
>>>> --Sincerely yours,
>>>> Mike Rapoport
>>>>
>>>>
>>>> _______________________________________________
>>>> Linuxppc-embedded mailing list
>>>> Linuxppc-embedded@ozlabs.org
>>>> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>>> _______________________________________________
>>> Linuxppc-embedded mailing list
>>> Linuxppc-embedded@ozlabs.org
>>> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>>
>>
>> --Sincerely,
>> Vitaly
> 
> 


-- 
Sincerely,
Vitaly

^ permalink raw reply

* Re: [PATCH] powerpc: Merge align.c
From: Becky Bruce @ 2005-11-16 16:31 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev list, linuxppc64-dev
In-Reply-To: <43D0A21D-89BC-4EFE-BA2A-94760BA32276@kernel.crashing.org>

> >
> > The 603 is still in production? And is the upcoming 8641 exactly
> > the same as the 74xx series in this respect?
>
> 603 is used in all 82xx/83xx processors from Freescale. The 8641 is=A0
> the same core as 7448.

The differences between 603 and 603e wrt alignment exceptions, as far=20
as I can tell, are:
- 603 does not take exception on misaligned LE accesses except for=20
strings and multiples
- 603 takes an alignment exception on ecowx/eciwx, 603e does not
- 603 generates an alignment when a ld/st crosses a segment boundary=20
and the T bit is different in the 2 segments

I should have listed these out above, sorry!

>
> >> - single and double precision floating point ld/st ops (non-E500,=20=

> non
> >> data size aligned)
> >
> > Hmm, you can load a double from any 4 byte aligned address AFAIR.
>
> This is only because every processor handles the misalignment for=A0
> you.=A0 Its completely valid for someone to build a PPC that has an=A0
> alignment exception in this case.

You're right, I should have said "word-aligned", not "data size=20
aligned".  While a load of a doubleword from a word aligned address is=20=

considered misaligned by the hardware, it doesn't generate an exception=20=

in any parts we have now that I know of.

> > However we do care about byte reversal instructions, which
> > probably believe like the corresponding normal instruction
> > (i.e., lwbrx has the same rules as lwzx, etc.)

Yep, they would work the same way, which for all of FSL's current parts=20=

would mean no exception.

> >
> >> - lwarx/stwcx (all procs)
> >
> > And ldarx/stdcx. on 64 bit, but these ones should not
> > be emulated. So it's easy ;-)
> >
> >> - multiple/string with LE set (750, 603e, 7450, 7400)
> >
> > Again LE mode is probably irrelevant.
>
> Agree with that. We dont support LE on classic.

Yep.  Just listed for completeness.

>
>
> >> - eciwx/ecowx (750, 7450, 7400)
> >
> > Have these instructions ever been used for something
> > under Linux?
>
> I dont believe so.

These guys are legagy - I don't think anyone uses them, and the=20
alignment exception doesn't (and, IMHO shouldn't) care about them at=20
all.   They're just listed here for completeness.

>
> >> - a couple of others related to vector processing
> >
> > Which ones? The Altivec load and store instructions
> > simply mask the low order bits AFAIR.
>
> SPE misalignment is something to look at.

I'll look into it when I have a moment to breathe......  There are 2=20
conditions here that aren't currently handled (from the manual):
- SPFP and SPE instructions are not aligned on a natural boundary=20
(defined by the size of the data element being accessed)
- physical address of certain evld/st instructions is not aligned on a=20=

64-bit boundary.
=09
>
> >> If anybody knows offhand of something missing there, let me know.
> >
> > Nothing, but did you check when crossing a segment (256MB) boundary.
> > I seem to remember that some processors performed misaligned
> > load/store across pages but not across segments.

As far as I can tell, the only one that cares about segment boundaries=20=

is 603 (604, 604e, and 601 may care, but I don't consider those=20
"current", and I don't have any working hardware).  And it only takes=20
an exception if there's a difference in the T-bit across the segments.

Cheers!
-B=

^ permalink raw reply

* Re: [PATCH] pmu_register_sleep_notifier needs ADB_PMU
From: Olaf Hering @ 2005-11-16 16:38 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, linuxppc-dev
In-Reply-To: <20051022213206.GB6097@suse.de>

 On Sat, Oct 22, Olaf Hering wrote:

> 
> a simple patch for a pegsos user:
> https://bugzilla.novell.com/show_bug.cgi?id=119606

Still not fully fixed:


drivers/video/aty/radeon_pm.c: In function `radeonfb_pm_init':
drivers/video/aty/radeon_pm.c:2769: warning: implicit declaration of function `pmac_call_feature'
drivers/video/aty/radeon_pm.c:2769: error: `PMAC_FTR_DEVICE_CAN_WAKE' undeclared (first use in this function)
drivers/video/aty/radeon_pm.c:2769: error: (Each undeclared identifier is reported only once
drivers/video/aty/radeon_pm.c:2769: error: for each function it appears in.)
drivers/video/aty/radeon_pm.c:2770: warning: implicit declaration of function `pmac_set_early_video_resume'

 drivers/video/aty/radeon_pm.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

Index: linux-2.6.15-rc1-olh/drivers/video/aty/radeon_pm.c
===================================================================
--- linux-2.6.15-rc1-olh.orig/drivers/video/aty/radeon_pm.c
+++ linux-2.6.15-rc1-olh/drivers/video/aty/radeon_pm.c
@@ -1321,7 +1321,7 @@ static void radeon_pm_full_reset_sdram(s
 	mdelay( 15);
 }
 
-#ifdef CONFIG_PPC_OF
+#ifdef CONFIG_PPC_PMAC
 
 static void radeon_pm_reset_pad_ctlr_strength(struct radeonfb_info *rinfo)
 {
@@ -2401,7 +2401,7 @@ static void radeon_reinitialize_QW(struc
 }
 #endif /* 0 */
 
-#endif /* CONFIG_PPC_OF */
+#endif /* CONFIG_PPC_PMAC */
 
 static void radeon_set_suspend(struct radeonfb_info *rinfo, int suspend)
 {
@@ -2700,7 +2700,7 @@ int radeonfb_pci_resume(struct pci_dev *
 	return rc;
 }
 
-#ifdef CONFIG_PPC_OF
+#ifdef CONFIG_PPC_PMAC
 static void radeonfb_early_resume(void *data)
 {
         struct radeonfb_info *rinfo = data;
@@ -2734,7 +2734,7 @@ void radeonfb_pm_init(struct radeonfb_in
 	 * BIOS does tho. Right now, all this PM stuff is pmac-only for that
 	 * reason. --BenH
 	 */
-#if defined(CONFIG_PM) && defined(CONFIG_PPC_OF)
+#if defined(CONFIG_PM) && defined(CONFIG_PPC_PMAC)
 	if (_machine == _MACH_Pmac && rinfo->of_node) {
 		if (rinfo->is_mobility && rinfo->pm_reg &&
 		    rinfo->family <= CHIP_FAMILY_RV250)
@@ -2778,12 +2778,12 @@ void radeonfb_pm_init(struct radeonfb_in
 		OUTREG(TV_DAC_CNTL, INREG(TV_DAC_CNTL) | 0x07000000);
 #endif
 	}
-#endif /* defined(CONFIG_PM) && defined(CONFIG_PPC_OF) */
+#endif /* defined(CONFIG_PM) && defined(CONFIG_PPC_PMAC) */
 }
 
 void radeonfb_pm_exit(struct radeonfb_info *rinfo)
 {
-#if defined(CONFIG_PM) && defined(CONFIG_PPC_OF)
+#if defined(CONFIG_PM) && defined(CONFIG_PPC_PMAC)
 	if (rinfo->pm_mode != radeon_pm_none)
 		pmac_set_early_video_resume(NULL, NULL);
 #endif

-- 
short story of a lazy sysadmin:
 alias appserv=wotan

^ permalink raw reply

* Re: [PATCH] powerpc: Merge align.c
From: Andrey Volkov @ 2005-11-16 16:54 UTC (permalink / raw)
  To: Becky Bruce; +Cc: linuxppc-dev list, linuxppc64-dev
In-Reply-To: <4ad202b87fa52d954e645b05fb45ca13@freescale.com>

Becky Bruce wrote:
> On Nov 15, 2005, at 8:34 PM, Benjamin Herrenschmidt wrote:
> 
>> >
>> > BTW, Based on the pile of docs I have here, I think the list of
>> > alignment-exception-causing events on FSL's current parts (603, 603e,
>> > 750, 74x, 74xx, e500) is:
>> >
>> > - lmw/stmw (all procs, non-word aligned)
>> > - single and double precision floating point ld/st ops (non-E500, non
>> > data size aligned)
>> > - dcbz to WT or CI memory (all procs)
>> > - dcbz with cache disabled (all procs but 603e?)
>> > - misaligned little endian accesses (603e)
>> > - lwarx/stwcx (all procs)
>> > - multiple/string with LE set (750, 603e, 7450, 7400)
>> > - eciwx/ecowx (750, 7450, 7400)
>> > - a couple of others related to vector processing
>> >
>> > If anybody knows offhand of something missing there, let me know.
>>
>> What about lwz/stw cropssing page boundaries ? Is this handled in HW ?
>>
>> Ben.
> 
> 
> Apparently so, much to my surprise - I ran the testcase with those
> instructions misaligned across a page boundary last night and got no
> alignment exception.  I was surprised, and asked my husband about it (he
> worked on the load/store units for a bunch of our parts), and he says
> these guys never cause an exception for any of FSL's current parts as
> far as he knows.  This is supported by our documentation as well - the
> only place I see these listed is on 603e, where they can cause an
> exception if the page is mapped little endian.
> 
Try this for 603e (BE):
 memcpy(xxxx3, xxxx0, 8);

I get invalid behavior (0 in second dword) on MPC5200 for external flash
access.

--
Regards
Andrey Volkov

^ permalink raw reply

* Re: 2.6.14 USB vs. sleep issues
From: Wolfgang Pfeiffer @ 2005-11-16 18:09 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list, debian-powerpc@lists.debian.org
In-Reply-To: <1130999620.4680.28.camel@gaston>

On Thu, Nov 03, 2005 at 05:33:39PM +1100, Benjamin Herrenschmidt wrote:
> For those who experience crashes on sleep and/or wakeup (typically due
> to USB) with 2.6.14, I made a test patch that might help. [ ... ]

Ben, I just compiled and installed a 2.6.14.1 from kernel.org with
none of your patches from this thread applied to it, and I have no
sleep/wakeup probs with it so far: about 3 instances of sleep/wakeup
until now, all of them successful.

Maybe I even made it a bit more complicated for the system, as I
connected a USB HUB, with 4 ports, to the machine: It just seems to
work ...

-------------------------------------
$ cat /proc/cpuinfo 
processor       : 0
cpu             : 7455, altivec supported
clock           : 867MHz
revision        : 0.2 (pvr 8001 0302)
bogomips        : 865.18
machine         : PowerBook3,5
motherboard     : PowerBook3,5 MacRISC2 MacRISC Power Macintosh
detected as     : 80 (PowerBook Titanium IV)
pmac flags      : 0000001b
L2 cache        : 256K unified
memory          : 768MB
pmac-generation : NewWorld
-----------------------------------

HTH

Best Regards
Wolfgang

-- 
Wolfgang Pfeiffer
http://profiles.yahoo.com/wolfgangpfeiffer

Key ID: E3037113
Key fingerprint = A8CA 9D8C 54C4 4CC1 0B26  AA3C 9108 FB42 E303 7113

^ permalink raw reply

* Re: 2.6.14 USB vs. sleep issues
From: Wolfgang Pfeiffer @ 2005-11-16 18:25 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list, debian-powerpc@lists.debian.org
In-Reply-To: <20051116180925.GB3080@localhost>

On Wed, Nov 16, 2005 at 07:09:26PM +0100, Wolfgang Pfeiffer wrote:

> Ben, I just compiled and installed a 2.6.14.1 from kernel.org with
> none of your patches from this thread applied to it, and I have no
> sleep/wakeup probs with it so far: about 3 instances of sleep/wakeup
> until now, all of them successful.
> 
> Maybe I even made it a bit more complicated for the system, as I
> connected a USB HUB, with 4 ports, to the machine: It just seems to
> work ... [ ... ]

Just for the sake of completeness: I have (SCSI) problems with 2.6.14.1,
but none of them seem to be USB/sleep related:
<http://sourceforge.net/mailarchive/forum.php?thread_id=8964383&forum_id=5389>

Not being sure whether this latter URL works: I just read "The
SourceForge.net Website is currently down for maintenance" But the
name of the thread up there is:
"Fw: 2.6.14.1: Loading FireWire disk fails. Fix: "modprobe ieee1394
disable_irm=1""

Best Regards
Wolfgang
-- 
Wolfgang Pfeiffer
http://profiles.yahoo.com/wolfgangpfeiffer

Key ID: E3037113
Key fingerprint = A8CA 9D8C 54C4 4CC1 0B26  AA3C 9108 FB42 E303 7113

^ permalink raw reply

* Re: [PATCH] powerpc: Merge align.c
From: Dan Malek @ 2005-11-16 19:20 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc64-dev, linuxppc-dev list
In-Reply-To: <43D0A21D-89BC-4EFE-BA2A-94760BA32276@kernel.crashing.org>


On Nov 16, 2005, at 10:15 AM, Kumar Gala wrote:

> 603 is used in all 82xx/83xx processors from Freescale. The 8641 is 
> the same core as 7448.

The 82xx uses G2_LE, and 83xx is e300, which are
similar to the old 603 but do have some subtle
improvements that make them better cores.


	-- Dan

^ permalink raw reply

* Re: [PATCH] powerpc: Merge align.c
From: Dan Malek @ 2005-11-16 19:24 UTC (permalink / raw)
  To: Becky Bruce; +Cc: linuxppc-dev list, linuxppc64-dev
In-Reply-To: <28076a8ba1e55469c74b0677a289fd0b@freescale.com>


On Nov 16, 2005, at 11:31 AM, Becky Bruce wrote:

> As far as I can tell, the only one that cares about segment boundaries 
> is 603

Why would 603 care about segment boundaries?  I couldn't
find any documentation old enough that indicated such a thing :-)

Thanks.

	-- Dan

^ permalink raw reply

* Re: [PATCH] powerpc: Merge align.c
From: Gabriel Paubert @ 2005-11-16 19:45 UTC (permalink / raw)
  To: Dan Malek; +Cc: linuxppc64-dev, linuxppc-dev list
In-Reply-To: <755b1bfb034aebb5de36dc0594e08ec6@embeddededge.com>

On Wed, Nov 16, 2005 at 02:20:43PM -0500, Dan Malek wrote:
> 
> On Nov 16, 2005, at 10:15 AM, Kumar Gala wrote:
> 
> >603 is used in all 82xx/83xx processors from Freescale. The 8641 is 
> >the same core as 7448.
> 
> The 82xx uses G2_LE, and 83xx is e300, which are
> similar to the old 603 but do have some subtle
> improvements that make them better cores.

I originally asked because I believed that these cores are 
actually closer to the 603e than to the original 603.

But take this with a pinch of salt, I might be wrong.

	Gabriel

^ permalink raw reply

* Re: [PATCH] powerpc: Merge align.c
From: Dan Malek @ 2005-11-16 20:36 UTC (permalink / raw)
  To: Gabriel Paubert; +Cc: linuxppc64-dev, linuxppc-dev list
In-Reply-To: <20051116194553.GA23679@iram.es>


On Nov 16, 2005, at 2:45 PM, Gabriel Paubert wrote:

> I originally asked because I believed that these cores are
> actually closer to the 603e than to the original 603.

That's correct.  In fact, I think the original 8260 and
perhaps the 5200 were 603e cores.  As I mentioned,
the newer ones are subtly different, but better than
the 603e ;-)

Thanks.

	-- Dan

^ permalink raw reply

* Re: 2.6.14 USB vs. sleep issues
From: Benjamin Herrenschmidt @ 2005-11-16 21:01 UTC (permalink / raw)
  To: Wolfgang Pfeiffer; +Cc: linuxppc-dev list, debian-powerpc@lists.debian.org
In-Reply-To: <20051116180925.GB3080@localhost>

On Wed, 2005-11-16 at 19:09 +0100, Wolfgang Pfeiffer wrote:
> On Thu, Nov 03, 2005 at 05:33:39PM +1100, Benjamin Herrenschmidt wrote:
> > For those who experience crashes on sleep and/or wakeup (typically due
> > to USB) with 2.6.14, I made a test patch that might help. [ ... ]
> 
> Ben, I just compiled and installed a 2.6.14.1 from kernel.org with
> none of your patches from this thread applied to it, and I have no
> sleep/wakeup probs with it so far: about 3 instances of sleep/wakeup
> until now, all of them successful.
> 
> Maybe I even made it a bit more complicated for the system, as I
> connected a USB HUB, with 4 ports, to the machine: It just seems to
> work ...

Only newer machines with a NEC USB2 chip that shares interrupts appear
to be affected by the problem.

Ben.

^ permalink raw reply

* Re: [PATCH] powerpc: Merge align.c (#2)
From: Paul Mackerras @ 2005-11-16 22:14 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list, linuxppc64-dev
In-Reply-To: <1132025664.6094.47.camel@gaston>

Benjamin Herrenschmidt writes:

> Since it's likely that I won't be able to test all scenario, code
> inspection is much welcome.

I think you need this patch on top...

Paul.

diff -urN powerpc/arch/powerpc/kernel/align.c merge-hack/arch/powerpc/kernel/align.c
--- powerpc/arch/powerpc/kernel/align.c	2005-11-17 09:05:04.000000000 +1100
+++ merge-hack/arch/powerpc/kernel/align.c	2005-11-17 09:06:29.000000000 +1100
@@ -198,21 +198,20 @@
 	/* bits  6:15 --> 22:31 */
 	dsisr = (instr & 0x03ff0000) >> 16;
 
-	if ( IS_XFORM(instr) ) {
+	if (IS_XFORM(instr)) {
 		/* bits 29:30 --> 15:16 */
 		dsisr |= (instr & 0x00000006) << 14;
 		/* bit     25 -->    17 */
 		dsisr |= (instr & 0x00000040) << 8;
 		/* bits 21:24 --> 18:21 */
 		dsisr |= (instr & 0x00000780) << 3;
-	}
-	else {
+	} else {
 		/* bit      5 -->    17 */
 		dsisr |= (instr & 0x04000000) >> 12;
 		/* bits  1: 4 --> 18:21 */
 		dsisr |= (instr & 0x78000000) >> 17;
 		/* bits 30:31 --> 12:13 */
-		if ( IS_DSFORM(instr) )
+		if (IS_DSFORM(instr))
 			dsisr |= (instr & 0x00000003) << 18;
 	}
 
@@ -247,13 +246,22 @@
 
 /*
  * Emulate load & store multiple instructions
+ * On 64-bit machines, these instructions only affect/use the
+ * bottom 4 bytes of each register, and the loads clear the
+ * top 4 bytes of the affected register.
  */
+#ifdef CONFIG_PPC64
+#define REG_BYTE(rp, i)		*((u8 *)((rp) + ((i) >> 2)) + ((i) & 3) + 4)
+#else
+#define REG_BYTE(rp, i)		*((u8 *)(rp) + (i))
+#endif
+
 static int emulate_multiple(struct pt_regs *regs, unsigned char __user *addr,
 			    unsigned int reg, unsigned int nb,
 			    unsigned int flags, unsigned int instr)
 {
-	unsigned char *rptr;
-	int nb0, i;
+	unsigned long *rptr;
+	unsigned int nb0, i;
 
 	/*
 	 * We do not try to emulate 8 bytes multiple as they aren't really
@@ -291,29 +299,38 @@
 	if (!access_ok((flags & ST ? VERIFY_WRITE: VERIFY_READ), addr, nb+nb0))
 		return -EFAULT;	/* bad address */
 
-	rptr = (unsigned char *) &regs->gpr[reg];
+	rptr = &regs->gpr[reg];
 	if (flags & LD) {
+		/*
+		 * This zeroes the top 4 bytes of the affected registers
+		 * in 64-bit mode, and also zeroes out any remaining
+		 * bytes of the last register for lsw*.
+		 */
+		memset(rptr, 0, ((nb + 3) / 4) * sizeof(unsigned long));
+		if (nb0 > 0)
+			memset(&regs->gpr[0], 0,
+			       ((nb0 + 3) / 4) * sizeof(unsigned long));
+
 		for (i = 0; i < nb; ++i)
-			if (__get_user(rptr[i], addr + i))
+			if (__get_user(REG_BYTE(rptr, i), addr + i))
 				return -EFAULT;
 		if (nb0 > 0) {
-			rptr = (unsigned char *) &regs->gpr[0];
+			rptr = &regs->gpr[0];
 			addr += nb;
 			for (i = 0; i < nb0; ++i)
-				if (__get_user(rptr[i], addr + i))
+				if (__get_user(REG_BYTE(rptr, i), addr + i))
 					return -EFAULT;
 		}
-		for (; (i & 3) != 0; ++i)
-			rptr[i] = 0;
+
 	} else {
 		for (i = 0; i < nb; ++i)
-			if (__put_user(rptr[i], addr + i))
+			if (__put_user(REG_BYTE(rptr, i), addr + i))
 				return -EFAULT;
 		if (nb0 > 0) {
-			rptr = (unsigned char *) &regs->gpr[0];
+			rptr = &regs->gpr[0];
 			addr += nb;
 			for (i = 0; i < nb0; ++i)
-				if (__put_user(rptr[i], addr + i))
+				if (__put_user(REG_BYTE(rptr, i), addr + i))
 					return -EFAULT;
 		}
 	}
@@ -338,7 +355,7 @@
 	unsigned char __user *p;
 	int ret, t;
 	union {
-		long ll;
+		u64 ll;
 		double dd;
 		unsigned char v[8];
 		struct {

^ permalink raw reply

* Re: 2.6.14 USB vs. sleep issues
From: Eddy Petrisor @ 2005-11-16 23:21 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list, debian-powerpc@lists.debian.org
In-Reply-To: <1132174868.5646.112.camel@gaston>

Benjamin Herrenschmidt wrote:
> On Wed, 2005-11-16 at 19:09 +0100, Wolfgang Pfeiffer wrote:
> 
>>>For those who experience crashes on sleep and/or wakeup (typically due
>>>to USB) with 2.6.14, I made a test patch that might help. [ ... ]

> Only newer machines with a NEC USB2 chip that shares interrupts appear
> to be affected by the problem.

So is there any chance that the sleep issue is fixed until 2.6.15?

-- 
Regards,
EddyP
=============================================
"Imagination is more important than knowledge" A.Einstein

^ permalink raw reply

* [REQUEST] Tap for right click on PowerBook trackpad
From: Felix Oxley @ 2005-11-17  2:13 UTC (permalink / raw)
  To: lkml; +Cc: linuxppc-dev


One big reason that I don't use Linux on my PowerBook (1.25 AlBook) is the difficulty of using the single button trackpad.
Under OS X I use SideTrack which provides the ability to tap for right-click.
I did some investigation a few months ago and could not find a Linux replacement for SideTrack.

Would this be a difficult feature to implement?
Would any one be interested in doing it? :-)

(Please CC me as I am not subscribed)
regards,
Felix

^ permalink raw reply

* U-Boot MPC859TnnA support !
From: zjznliang @ 2005-11-17  3:37 UTC (permalink / raw)
  To: linuxppc-embedded

SGkgbGludXhwcGMtZW1iZWRkZWSjoQ0KDQoJICAgICAgICAgIEkgYW0gcG9ydGluZyBVLUJvb3Qg
b24gdGhlIE1QQzg1OVRubkEgY2FyZCxidXQgVS1Cb290IGNhbid0IGZpbmQgdGhlIENQVSBpbiB0
aGUgaW5pdGlhbGl6YXRpb24gLiBJIGNoZWNrIHRoZSBjb2RlICx0aGVyZSBpcyBub3QgdHlwZSBv
ZiBNUEM4NTlUbm5BIHRvIHN1cHBvcnQgLlRoZSBVLUJvb3QgdmVyc2lvbiBpcyAxLjEuMy4NCg0K
CQkJCVRoZXJlIE1QQyBmYW1pbHkgdmVyc2lvbnMgaXMgaGVyZSA6DQoJCQkJaHR0cDovL3d3dy5m
cmVlc2NhbGUuY29tL3dlYmFwcC9zcHMvc2l0ZS9wcm9kX3N1bW1hcnkuanNwP2NvZGU9TVBDODU5
VCZzcmNoPTEgDQoNCgkJCQlNUEM4NjYgRmFtaWx5IFZlcnNpb25zIGFuZCBNYXNrcyANCgkJCQlS
ZXYgCU1hc2sgCVByb2Nlc3MgCVF1YWwgCUlNTVJbMTY6MzFdIAlNaWNyb2NvZGUgUkVWX05VTSAJ
UGFydCBOdW1iZXIgDQoJCQkJMC4zIAkzTDkwSCAJSGlQNlcgCQlNQyAJCTB4MDgwMCAJCQkJMHgw
MDAzIAkJCQkJCQkJICBNUEM4NjZQbm4NCgkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJ
CQkgIAlNUEM4NjZUbm4NCgkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJTVBDODU5
VG5uDQoJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCU1QQzg1OURTTG5uDQoJCQkJ
CQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCU1QQzg1MlRubiANCgkJCQlBLjAgCTBMOTZS
IAlIaVA2VyAJCU1DIAkJMHgwODAxIAkJCQkweDAwMDQgCQkJCQkJCQlNUEM4NjZQbm5BDQoJCQkJ
CQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCU1QQzg2NlRubkENCgkJCQkJCQkJCQkJCQkJ
CQkJCQkJCQkJCQkJCQkJCQkJCQkJTVBDODU5VG5uQQ0KCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJ
CQkJCQkJCQkJCQlNUEM4NTlEU0xubkEgDQoNCgkJCQlUaGUgY29kZSBpbiBVLUJvb3QgaXMgaW4g
dGhlIGNoZWNrX0NQVSgpICAobGluZSA0OCBvZiAiXGNwdVxtcGM4eHhcQ3B1LmMiKQ0KCQkJCVRo
ZSBVLUJvb3Qgc3VwcG9ydHMgdGhlIHR5cGUgb2YgMHgwODAwMDAwMyBidXQgbm90IDB4MDgwMTAw
MDQsIHNvIGFkZCB0aGUgY29kZSBmb3IgMHgwODAxMDAwNCx5b3Ugd2lsbCBmaW5kIHlvdXIgTVBD
eG5uQSBjcHUgLjopDQogCQkJCQ0KICAgICAgICAgICAgIAlQZXJoYXBzIEkgd2lsbCBiZSBhIGhl
bHAuDQqhoaGhemp6bmxpYW5nDQqhoaGhoaGhoXpqem5saWFuZ19wb3BvQDE2My5jb20NCqGhoaGh
oaGhoaGhoTIwMDUtMTEtMTcNCg==

^ permalink raw reply

* Re: [REQUEST] Tap for right click on PowerBook trackpad
From: Dustin Lang @ 2005-11-17  3:32 UTC (permalink / raw)
  To: Felix Oxley; +Cc: linuxppc-dev
In-Reply-To: <200511170213.16926.lkml@oxley.org>


Hi,

On my PowerBook, I map F11 to the middle mouse button and F12 to the right 
mouse button.  I've grown so used to it that I get annoyed when it doesn't 
work in OSX :)

You can do the same by:
-be sure to enable CONFIG_MAC_EMUMOUSEBTN in the kernel config
-at startup time (or whenever):
   echo "1" > /proc/sys/dev/mac_hid/mouse_button_emulation
   echo "87" > /proc/sys/dev/mac_hid/mouse_button2_keycode
   echo "88" > /proc/sys/dev/mac_hid/mouse_button3_keycode

Cheers,
dstn.


> One big reason that I don't use Linux on my PowerBook (1.25 AlBook) is 
> the difficulty of using the single button trackpad. Under OS X I use 
> SideTrack which provides the ability to tap for right-click. I did some 
> investigation a few months ago and could not find a Linux replacement 
> for SideTrack.
>
> Would this be a difficult feature to implement?
> Would any one be interested in doing it? :-)
>
> (Please CC me as I am not subscribed)
> regards,
> Felix

^ permalink raw reply

* Help ! 2.6.14 kernel can't bring up
From: zjznliang @ 2005-11-17  7:50 UTC (permalink / raw)
  To: linuxppc-embedded

SGkgbGludXhwcGMtZW1iZWRkZWSjoQ0KDQoJICAgICAgICAgSSAgaGF2ZSBkb3dubG9hZGVkIHRo
ZSBMaW51eCAyLjYuMTQgZnJvbSB3d3cuZGVueC5kZS5JIGFkZGVkIGFuZCBtb2RpZmllZCB0aGUg
ZmlsZSBhbmQgY29tcGlsZSBpdCBhcyB3aGF0IEkgZGlkIG9uIExpbnV4IDIuNC4yNSB3aGljaCB3
YXMgYWxzbyBkb3dubG9hZGVkIG9uIHd3dy5kZW54LmRlLiBNeSBib2FyZCBpcyBiYXNlIG9uIE1Q
QyA4NTcgLGFuZCBpdCBnb2VzIHdlbGwgaW4gTGludXggMi40LjI1IC4gTXkgYm9vdGxvYWRlciBp
cyBVLUJvb3QgMS4xLjMgd2hpY2ggZ29lcyB3ZWxsIHRvby4gQnV0IHdoZW4gSSBicmluZyB1cCB0
aGUgTGludXggMi42LjE0ICxJIG9ubHkgZ290IHRoZSBpbmZvcm1hdGlvbiBhcyBmb2xsb3cgOg0K
DQojIyBCb290aW5nIGltYWdlIGF0IGZmYzQwMDAwIC4uLg0KICAgSW1hZ2UgTmFtZTogICBMaW51
eC0yLjYuMTQNCiAgIENyZWF0ZWQ6ICAgICAgMjAwNS0xMS0xNyAgIDc6MTE6NDIgVVRDDQogICBJ
bWFnZSBUeXBlOiAgIFBvd2VyUEMgTGludXggS2VybmVsIEltYWdlIChnemlwIGNvbXByZXNzZWQp
DQogICBEYXRhIFNpemU6ICAgIDY3ODE3MCBCeXRlcyA9IDY2Mi4zIGtCDQogICBMb2FkIEFkZHJl
c3M6IDAwMDAwMDAwDQogICBFbnRyeSBQb2ludDogIDAwMDAwMDAwDQogICBWZXJpZnlpbmcgQ2hl
Y2tzdW0gLi4uIE9LDQogICBVbmNvbXByZXNzaW5nIEtlcm5lbCBJbWFnZSAuLi4gT0sNCiMjIExv
YWRpbmcgUkFNRGlzayBJbWFnZSBhdCBmZmQwMDAwMCAuLi4NCiAgIEltYWdlIE5hbWU6DQogICBD
cmVhdGVkOiAgICAgIDIwMDUtMTEtMDkgICA5OjI4OjI3IFVUQw0KICAgSW1hZ2UgVHlwZTogICBQ
b3dlclBDIExpbnV4IFJBTURpc2sgSW1hZ2UgKGd6aXAgY29tcHJlc3NlZCkNCiAgIERhdGEgU2l6
ZTogICAgMTU2NDM2OSBCeXRlcyA9ICAxLjUgTUINCiAgIExvYWQgQWRkcmVzczogMDBjMDAwMDAN
CiAgIEVudHJ5IFBvaW50OiAgMDBjMDAwMDANCiAgIFZlcmlmeWluZyBDaGVja3N1bSAuLi4gT0sN
CiAgIExvYWRpbmcgUmFtZGlzayB0byAwMGUzZTAwMCwgZW5kIDAwZmJiZWQxIC4uLiBPSw0KDQpB
bmQgdGhlcmUgaXMgbm90aGluZyBvdXRwdXQgLEkgdGhvdWdodCB0aGF0IGl0IHdhcyBzZXJpYWwg
cG9ydCBmYXVsdCAuIEkgY2hlY2tlZCBteSBMaW51eCBjb25maWd1cmF0aW9uICxidXQgZm91bmQg
bm90aGluZyAuDQoNCkhvdyB0byBtYWtlIHRoZSBsaW51eCAyLjYuMTQgd2VsbCBvbiBteSBib2Fy
ZCA/Pw0KDQogDQogICBBbnkgaGVscCBvbiB0aGlzIHdvdWxkIGJlIGdyZWF0bHkgYXBwcmVjaWF0
ZWQuIFRoYW5rcyBmb3IgeW91ciBwYXRpZW5jZS4gDQoNCiAJCQkJDQoNCqGhoaF6anpubGlhbmcN
CqGhoaGhoaGhemp6bmxpYW5nX3BvcG9AMTYzLmNvbQ0KoaGhoaGhoaGhoaGhMjAwNS0xMS0xNw0K

^ permalink raw reply

* Booting hangs after "Calibrating delay loop..."
From: Nguyen Thanh Binh @ 2005-11-17  8:19 UTC (permalink / raw)
  To: linuxppc-embedded

Hi all,

When booting Monta Vista Linux on Memec board
(Virtex-4 FX12 LC), it hung after printing the
following message:

    "Calibrating delay loop..."

By looking at the source code, I found that in the
init/main.c the problem came from the
calibrate_delay()
function: jiffies was not incremented (jiffies was
always equal to 0).

Have anyone get the similar problem or any experience
to fix it?

Thank you.

Binh Nguyen

Nguy&#7877;n Thanh Bình


		
___________________________________________________________ 
How much free photo storage do you get? Store your holiday 
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com

^ 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