LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* PowerPC/Linux device driver question
From: Madhu Saravana Sibi Govindan @ 2005-10-20 19:56 UTC (permalink / raw)
  To: linuxppc-dev

Hello all,

I'm trying to write a device driver in linux on a PowerPC processor.
The device has been allocated a range of addresses in the physical
address space of the processor (IBM 440GP) - from 0x100000000 -
0x13fffffff. (FYI, the 440GP is a 32 bit processor using 36 physical
addresses, the processor's MMU appends the extra 4 bits to get a
36-bit physical address).

I'm not sure how to request this range of physical memory from the
kernel. I thought I could use ioremap to map this range into the
virtual space, but ioremap takes only an unsigned long as an argument,
which is only 32 bits on 440GP. I don't think I can represent the range of =
my
device with 32 bits.

Could someone tell me how to solve the problem? I want this range of
physical addresses to be associated with my device driver and how do I
do that?

Thanks in advance,
G.Sibi

^ permalink raw reply

* [PATCH] 85xx PHY Platform Update
From: Andy Fleming @ 2005-10-20 19:50 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linuxppc-embedded

This patch updates the 85xx platform code to support the new PHY Layer.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Kumar Gala <Kumar.gala@freescale.com>


diff --git a/arch/ppc/platforms/85xx/mpc8540_ads.c b/arch/ppc/platforms/85xx/mpc8540_ads.c
--- a/arch/ppc/platforms/85xx/mpc8540_ads.c
+++ b/arch/ppc/platforms/85xx/mpc8540_ads.c
@@ -53,6 +53,10 @@
 
 #include <syslib/ppc85xx_setup.h>
 
+static const char *GFAR_PHY_0 = "phy0:0";
+static const char *GFAR_PHY_1 = "phy0:1";
+static const char *GFAR_PHY_3 = "phy0:3";
+
 /* ************************************************************************
  *
  * Setup the architecture
@@ -64,6 +68,7 @@ mpc8540ads_setup_arch(void)
 	bd_t *binfo = (bd_t *) __res;
 	unsigned int freq;
 	struct gianfar_platform_data *pdata;
+	struct gianfar_mdio_data *mdata;
 
 	/* get the core frequency */
 	freq = binfo->bi_intfreq;
@@ -90,34 +95,35 @@ mpc8540ads_setup_arch(void)
 	invalidate_tlbcam_entry(num_tlbcam_entries - 1);
 #endif
 
+	/* setup the board related info for the MDIO bus */
+	mdata = (struct gianfar_mdio_data *) ppc_sys_get_pdata(MPC85xx_MDIO);
+
+	mdata->irq[0] = MPC85xx_IRQ_EXT5;
+	mdata->irq[1] = MPC85xx_IRQ_EXT5;
+	mdata->irq[2] = -1;
+	mdata->irq[3] = MPC85xx_IRQ_EXT5;
+	mdata->irq[31] = -1;
+	mdata->paddr += binfo->bi_immr_base;
+
 	/* setup the board related information for the enet controllers */
 	pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
 	if (pdata) {
 		pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
-		pdata->interruptPHY = MPC85xx_IRQ_EXT5;
-		pdata->phyid = 0;
-		/* fixup phy address */
-		pdata->phy_reg_addr += binfo->bi_immr_base;
+		pdata->bus_id = GFAR_PHY_0;
 		memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
 	}
 
 	pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2);
 	if (pdata) {
 		pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
-		pdata->interruptPHY = MPC85xx_IRQ_EXT5;
-		pdata->phyid = 1;
-		/* fixup phy address */
-		pdata->phy_reg_addr += binfo->bi_immr_base;
+		pdata->bus_id = GFAR_PHY_1;
 		memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
 	}
 
 	pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_FEC);
 	if (pdata) {
 		pdata->board_flags = 0;
-		pdata->interruptPHY = MPC85xx_IRQ_EXT5;
-		pdata->phyid = 3;
-		/* fixup phy address */
-		pdata->phy_reg_addr += binfo->bi_immr_base;
+		pdata->bus_id = GFAR_PHY_3;
 		memcpy(pdata->mac_addr, binfo->bi_enet2addr, 6);
 	}
 
diff --git a/arch/ppc/platforms/85xx/mpc8560_ads.c b/arch/ppc/platforms/85xx/mpc8560_ads.c
--- a/arch/ppc/platforms/85xx/mpc8560_ads.c
+++ b/arch/ppc/platforms/85xx/mpc8560_ads.c
@@ -57,6 +57,10 @@
 #include <syslib/ppc85xx_setup.h>
 
 
+static const char *GFAR_PHY_0 = "phy0:0";
+static const char *GFAR_PHY_1 = "phy0:1";
+static const char *GFAR_PHY_3 = "phy0:3";
+
 /* ************************************************************************
  *
  * Setup the architecture
@@ -69,6 +73,7 @@ mpc8560ads_setup_arch(void)
 	bd_t *binfo = (bd_t *) __res;
 	unsigned int freq;
 	struct gianfar_platform_data *pdata;
+	struct gianfar_mdio_data *mdata;
 
 	cpm2_reset();
 
@@ -87,24 +92,28 @@ mpc8560ads_setup_arch(void)
 	mpc85xx_setup_hose();
 #endif
 
+	/* setup the board related info for the MDIO bus */
+	mdata = (struct gianfar_mdio_data *) ppc_sys_get_pdata(MPC85xx_MDIO);
+
+	mdata->irq[0] = MPC85xx_IRQ_EXT5;
+	mdata->irq[1] = MPC85xx_IRQ_EXT5;
+	mdata->irq[2] = -1;
+	mdata->irq[3] = MPC85xx_IRQ_EXT5;
+	mdata->irq[31] = -1;
+	mdata->paddr += binfo->bi_immr_base;
+
 	/* setup the board related information for the enet controllers */
 	pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
 	if (pdata) {
 		pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
-		pdata->interruptPHY = MPC85xx_IRQ_EXT5;
-		pdata->phyid = 0;
-		/* fixup phy address */
-		pdata->phy_reg_addr += binfo->bi_immr_base;
+		pdata->bus_id = GFAR_PHY_0;
 		memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
 	}
 
 	pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2);
 	if (pdata) {
 		pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
-		pdata->interruptPHY = MPC85xx_IRQ_EXT5;
-		pdata->phyid = 1;
-		/* fixup phy address */
-		pdata->phy_reg_addr += binfo->bi_immr_base;
+		pdata->bus_id = GFAR_PHY_1;
 		memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
 	}
 
diff --git a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c
--- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c
+++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c
@@ -395,6 +395,9 @@ mpc85xx_cds_pcibios_fixup(void)
 
 TODC_ALLOC();
 
+static const char *GFAR_PHY_0 = "phy0:0";
+static const char *GFAR_PHY_1 = "phy0:1";
+
 /* ************************************************************************
  *
  * Setup the architecture
@@ -406,6 +409,7 @@ mpc85xx_cds_setup_arch(void)
 	bd_t *binfo = (bd_t *) __res;
 	unsigned int freq;
 	struct gianfar_platform_data *pdata;
+	struct gianfar_mdio_data *mdata;
 
 	/* get the core frequency */
 	freq = binfo->bi_intfreq;
@@ -449,44 +453,42 @@ mpc85xx_cds_setup_arch(void)
 	invalidate_tlbcam_entry(num_tlbcam_entries - 1);
 #endif
 
+	/* setup the board related info for the MDIO bus */
+	mdata = (struct gianfar_mdio_data *) ppc_sys_get_pdata(MPC85xx_MDIO);
+
+	mdata->irq[0] = MPC85xx_IRQ_EXT5;
+	mdata->irq[1] = MPC85xx_IRQ_EXT5;
+	mdata->irq[2] = -1;
+	mdata->irq[3] = -1;
+	mdata->irq[31] = -1;
+	mdata->paddr += binfo->bi_immr_base;
+
 	/* setup the board related information for the enet controllers */
 	pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
 	if (pdata) {
 		pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
-		pdata->interruptPHY = MPC85xx_IRQ_EXT5;
-		pdata->phyid = 0;
-		/* fixup phy address */
-		pdata->phy_reg_addr += binfo->bi_immr_base;
+		pdata->bus_id = GFAR_PHY_0;
 		memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
 	}
 
 	pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2);
 	if (pdata) {
 		pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
-		pdata->interruptPHY = MPC85xx_IRQ_EXT5;
-		pdata->phyid = 1;
-		/* fixup phy address */
-		pdata->phy_reg_addr += binfo->bi_immr_base;
+		pdata->bus_id = GFAR_PHY_1;
 		memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
 	}
 
 	pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_eTSEC1);
 	if (pdata) {
 		pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
-		pdata->interruptPHY = MPC85xx_IRQ_EXT5;
-		pdata->phyid = 0;
-		/* fixup phy address */
-		pdata->phy_reg_addr += binfo->bi_immr_base;
+		pdata->bus_id = GFAR_PHY_0;
 		memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
 	}
 
 	pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_eTSEC2);
 	if (pdata) {
 		pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
-		pdata->interruptPHY = MPC85xx_IRQ_EXT5;
-		pdata->phyid = 1;
-		/* fixup phy address */
-		pdata->phy_reg_addr += binfo->bi_immr_base;
+		pdata->bus_id = GFAR_PHY_1;
 		memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
 	}
 
diff --git a/arch/ppc/platforms/85xx/sbc8560.c b/arch/ppc/platforms/85xx/sbc8560.c
--- a/arch/ppc/platforms/85xx/sbc8560.c
+++ b/arch/ppc/platforms/85xx/sbc8560.c
@@ -92,6 +92,9 @@ sbc8560_early_serial_map(void)
 }
 #endif
 
+static const char *GFAR_PHY_25 = "phy0:25";
+static const char *GFAR_PHY_26 = "phy0:26";
+
 /* ************************************************************************
  *
  * Setup the architecture
@@ -103,6 +106,7 @@ sbc8560_setup_arch(void)
 	bd_t *binfo = (bd_t *) __res;
 	unsigned int freq;
 	struct gianfar_platform_data *pdata;
+	struct gianfar_mdio_data *mdata;
 
 	/* get the core frequency */
 	freq = binfo->bi_intfreq;
@@ -127,24 +131,26 @@ sbc8560_setup_arch(void)
 	invalidate_tlbcam_entry(num_tlbcam_entries - 1);
 #endif
 
+	/* setup the board related info for the MDIO bus */
+	mdata = (struct gianfar_mdio_data *) ppc_sys_get_pdata(MPC85xx_MDIO);
+
+	mdata->irq[25] = MPC85xx_IRQ_EXT6;
+	mdata->irq[26] = MPC85xx_IRQ_EXT7;
+	mdata->irq[31] = -1;
+	mdata->paddr += binfo->bi_immr_base;
+
 	/* setup the board related information for the enet controllers */
 	pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
 	if (pdata) {
 		pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
-		pdata->interruptPHY = MPC85xx_IRQ_EXT6;
-		pdata->phyid = 25;
-		/* fixup phy address */
-		pdata->phy_reg_addr += binfo->bi_immr_base;
+		pdata->bus_id = GFAR_PHY_25;
 		memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
 	}
 
 	pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2);
 	if (pdata) {
 		pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
-		pdata->interruptPHY = MPC85xx_IRQ_EXT7;
-		pdata->phyid = 26;
-		/* fixup phy address */
-		pdata->phy_reg_addr += binfo->bi_immr_base;
+		pdata->bus_id = GFAR_PHY_26;
 		memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
 	}
 
diff --git a/arch/ppc/platforms/85xx/stx_gp3.c b/arch/ppc/platforms/85xx/stx_gp3.c
--- a/arch/ppc/platforms/85xx/stx_gp3.c
+++ b/arch/ppc/platforms/85xx/stx_gp3.c
@@ -92,6 +92,9 @@ static u8 gp3_openpic_initsenses[] __ini
 	0x0,				/* External 11: */
 };
 
+static const char *GFAR_PHY_2 = "phy0:2";
+static const char *GFAR_PHY_4 = "phy0:4";
+
 /*
  * Setup the architecture
  */
@@ -101,6 +104,7 @@ gp3_setup_arch(void)
 	bd_t *binfo = (bd_t *) __res;
 	unsigned int freq;
 	struct gianfar_platform_data *pdata;
+	struct gianfar_mdio_data *mdata;
 
 	cpm2_reset();
 
@@ -119,23 +123,26 @@ gp3_setup_arch(void)
 	mpc85xx_setup_hose();
 #endif
 
+	/* setup the board related info for the MDIO bus */
+	mdata = (struct gianfar_mdio_data *) ppc_sys_get_pdata(MPC85xx_MDIO);
+
+	mdata->irq[2] = MPC85xx_IRQ_EXT5;
+	mdata->irq[4] = MPC85xx_IRQ_EXT5;
+	mdata->irq[31] = -1;
+	mdata->paddr += binfo->bi_immr_base;
+
 	/* setup the board related information for the enet controllers */
 	pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
 	if (pdata) {
 	/*	pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; */
-		pdata->interruptPHY = MPC85xx_IRQ_EXT5;
-		pdata->phyid = 2;
-		pdata->phy_reg_addr += binfo->bi_immr_base;
+		pdata->bus_id = GFAR_PHY_2;
 		memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
 	}
 
 	pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2);
 	if (pdata) {
 	/*	pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR; */
-		pdata->interruptPHY = MPC85xx_IRQ_EXT5;
-		pdata->phyid = 4;
-		/* fixup phy address */
-		pdata->phy_reg_addr += binfo->bi_immr_base;
+		pdata->bus_id = GFAR_PHY_4;
 		memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
 	}
 
diff --git a/arch/ppc/syslib/mpc85xx_devices.c b/arch/ppc/syslib/mpc85xx_devices.c
--- a/arch/ppc/syslib/mpc85xx_devices.c
+++ b/arch/ppc/syslib/mpc85xx_devices.c
@@ -25,19 +25,20 @@
 /* We use offsets for IORESOURCE_MEM since we do not know at compile time
  * what CCSRBAR is, will get fixed up by mach_mpc85xx_fixup
  */
+struct gianfar_mdio_data mpc85xx_mdio_pdata = {
+	.paddr = MPC85xx_MIIM_OFFSET,
+};
 
 static struct gianfar_platform_data mpc85xx_tsec1_pdata = {
 	.device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT |
 	    FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON |
 	    FSL_GIANFAR_DEV_HAS_MULTI_INTR,
-	.phy_reg_addr = MPC85xx_ENET1_OFFSET,
 };
 
 static struct gianfar_platform_data mpc85xx_tsec2_pdata = {
 	.device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT |
 	    FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON |
 	    FSL_GIANFAR_DEV_HAS_MULTI_INTR,
-	.phy_reg_addr = MPC85xx_ENET1_OFFSET,
 };
 
 static struct gianfar_platform_data mpc85xx_etsec1_pdata = {
@@ -46,7 +47,6 @@ static struct gianfar_platform_data mpc8
 	    FSL_GIANFAR_DEV_HAS_MULTI_INTR |
 	    FSL_GIANFAR_DEV_HAS_CSUM | FSL_GIANFAR_DEV_HAS_VLAN |
 	    FSL_GIANFAR_DEV_HAS_EXTENDED_HASH,
-	.phy_reg_addr = MPC85xx_ENET1_OFFSET,
 };
 
 static struct gianfar_platform_data mpc85xx_etsec2_pdata = {
@@ -55,7 +55,6 @@ static struct gianfar_platform_data mpc8
 	    FSL_GIANFAR_DEV_HAS_MULTI_INTR |
 	    FSL_GIANFAR_DEV_HAS_CSUM | FSL_GIANFAR_DEV_HAS_VLAN |
 	    FSL_GIANFAR_DEV_HAS_EXTENDED_HASH,
-	.phy_reg_addr = MPC85xx_ENET1_OFFSET,
 };
 
 static struct gianfar_platform_data mpc85xx_etsec3_pdata = {
@@ -64,7 +63,6 @@ static struct gianfar_platform_data mpc8
 	    FSL_GIANFAR_DEV_HAS_MULTI_INTR |
 	    FSL_GIANFAR_DEV_HAS_CSUM | FSL_GIANFAR_DEV_HAS_VLAN |
 	    FSL_GIANFAR_DEV_HAS_EXTENDED_HASH,
-	.phy_reg_addr = MPC85xx_ENET1_OFFSET,
 };
 
 static struct gianfar_platform_data mpc85xx_etsec4_pdata = {
@@ -73,11 +71,10 @@ static struct gianfar_platform_data mpc8
 	    FSL_GIANFAR_DEV_HAS_MULTI_INTR |
 	    FSL_GIANFAR_DEV_HAS_CSUM | FSL_GIANFAR_DEV_HAS_VLAN |
 	    FSL_GIANFAR_DEV_HAS_EXTENDED_HASH,
-	.phy_reg_addr = MPC85xx_ENET1_OFFSET,
 };
 
 static struct gianfar_platform_data mpc85xx_fec_pdata = {
-	.phy_reg_addr = MPC85xx_ENET1_OFFSET,
+	.device_flags = 0,
 };
 
 static struct fsl_i2c_platform_data mpc85xx_fsl_i2c_pdata = {
@@ -718,6 +715,12 @@ struct platform_device ppc_sys_platform_
 				.flags	= IORESOURCE_IRQ,
 			},
 		},
+	},
+	[MPC85xx_MDIO] = {
+		.name = "fsl-gianfar_mdio",
+		.id = 0,
+		.dev.platform_data = &mpc85xx_mdio_pdata,
+		.num_resources = 0,
 	},
 };
 
diff --git a/arch/ppc/syslib/mpc85xx_sys.c b/arch/ppc/syslib/mpc85xx_sys.c
--- a/arch/ppc/syslib/mpc85xx_sys.c
+++ b/arch/ppc/syslib/mpc85xx_sys.c
@@ -24,19 +24,19 @@ struct ppc_sys_spec ppc_sys_specs[] = {
 		.ppc_sys_name	= "8540",
 		.mask 		= 0xFFFF0000,
 		.value 		= 0x80300000,
-		.num_devices	= 10,
+		.num_devices	= 11,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC85xx_TSEC1, MPC85xx_TSEC2, MPC85xx_FEC, MPC85xx_IIC1,
 			MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
-			MPC85xx_PERFMON, MPC85xx_DUART,
+			MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_MDIO,
 		},
 	},
 	{
 		.ppc_sys_name	= "8560",
 		.mask 		= 0xFFFF0000,
 		.value 		= 0x80700000,
-		.num_devices	= 19,
+		.num_devices	= 20,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC85xx_TSEC1, MPC85xx_TSEC2, MPC85xx_IIC1,
@@ -45,14 +45,14 @@ struct ppc_sys_spec ppc_sys_specs[] = {
 			MPC85xx_CPM_SPI, MPC85xx_CPM_I2C, MPC85xx_CPM_SCC1,
 			MPC85xx_CPM_SCC2, MPC85xx_CPM_SCC3, MPC85xx_CPM_SCC4,
 			MPC85xx_CPM_FCC1, MPC85xx_CPM_FCC2, MPC85xx_CPM_FCC3,
-			MPC85xx_CPM_MCC1, MPC85xx_CPM_MCC2,
+			MPC85xx_CPM_MCC1, MPC85xx_CPM_MCC2, MPC85xx_MDIO,
 		},
 	},
 	{
 		.ppc_sys_name	= "8541",
 		.mask 		= 0xFFFF0000,
 		.value 		= 0x80720000,
-		.num_devices	= 13,
+		.num_devices	= 14,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC85xx_TSEC1, MPC85xx_TSEC2, MPC85xx_IIC1,
@@ -60,13 +60,14 @@ struct ppc_sys_spec ppc_sys_specs[] = {
 			MPC85xx_PERFMON, MPC85xx_DUART,
 			MPC85xx_CPM_SPI, MPC85xx_CPM_I2C,
 			MPC85xx_CPM_FCC1, MPC85xx_CPM_FCC2,
+			MPC85xx_MDIO,
 		},
 	},
 	{
 		.ppc_sys_name	= "8541E",
 		.mask 		= 0xFFFF0000,
 		.value 		= 0x807A0000,
-		.num_devices	= 14,
+		.num_devices	= 15,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC85xx_TSEC1, MPC85xx_TSEC2, MPC85xx_IIC1,
@@ -74,13 +75,14 @@ struct ppc_sys_spec ppc_sys_specs[] = {
 			MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_SEC2,
 			MPC85xx_CPM_SPI, MPC85xx_CPM_I2C,
 			MPC85xx_CPM_FCC1, MPC85xx_CPM_FCC2,
+			MPC85xx_MDIO,
 		},
 	},
 	{
 		.ppc_sys_name	= "8555",
 		.mask 		= 0xFFFF0000,
 		.value 		= 0x80710000,
-		.num_devices	= 19,
+		.num_devices	= 20,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC85xx_TSEC1, MPC85xx_TSEC2, MPC85xx_IIC1,
@@ -91,13 +93,14 @@ struct ppc_sys_spec ppc_sys_specs[] = {
 			MPC85xx_CPM_FCC1, MPC85xx_CPM_FCC2,
 			MPC85xx_CPM_SMC1, MPC85xx_CPM_SMC2,
 			MPC85xx_CPM_USB,
+			MPC85xx_MDIO,
 		},
 	},
 	{
 		.ppc_sys_name	= "8555E",
 		.mask 		= 0xFFFF0000,
 		.value 		= 0x80790000,
-		.num_devices	= 20,
+		.num_devices	= 21,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC85xx_TSEC1, MPC85xx_TSEC2, MPC85xx_IIC1,
@@ -108,6 +111,7 @@ struct ppc_sys_spec ppc_sys_specs[] = {
 			MPC85xx_CPM_FCC1, MPC85xx_CPM_FCC2,
 			MPC85xx_CPM_SMC1, MPC85xx_CPM_SMC2,
 			MPC85xx_CPM_USB,
+			MPC85xx_MDIO,
 		},
 	},
 	/* SVRs on 8548 rev1.0 matches for 8548/8547/8545 */
@@ -115,104 +119,112 @@ struct ppc_sys_spec ppc_sys_specs[] = {
 		.ppc_sys_name	= "8548E",
 		.mask 		= 0xFFFF00F0,
 		.value 		= 0x80390010,
-		.num_devices	= 13,
+		.num_devices	= 14,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC85xx_eTSEC1, MPC85xx_eTSEC2, MPC85xx_eTSEC3,
 			MPC85xx_eTSEC4, MPC85xx_IIC1, MPC85xx_IIC2,
 			MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
 			MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_SEC2,
+			MPC85xx_MDIO,
 		},
 	},
 	{
 		.ppc_sys_name	= "8548",
 		.mask 		= 0xFFFF00F0,
 		.value 		= 0x80310010,
-		.num_devices	= 12,
+		.num_devices	= 13,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC85xx_eTSEC1, MPC85xx_eTSEC2, MPC85xx_eTSEC3,
 			MPC85xx_eTSEC4, MPC85xx_IIC1, MPC85xx_IIC2,
 			MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
 			MPC85xx_PERFMON, MPC85xx_DUART,
+			MPC85xx_MDIO,
 		},
 	},
 	{
 		.ppc_sys_name	= "8547E",
 		.mask 		= 0xFFFF00F0,
 		.value 		= 0x80390010,
-		.num_devices	= 13,
+		.num_devices	= 14,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC85xx_eTSEC1, MPC85xx_eTSEC2, MPC85xx_eTSEC3,
 			MPC85xx_eTSEC4, MPC85xx_IIC1, MPC85xx_IIC2,
 			MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
 			MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_SEC2,
+			MPC85xx_MDIO,
 		},
 	},
 	{
 		.ppc_sys_name	= "8547",
 		.mask 		= 0xFFFF00F0,
 		.value 		= 0x80310010,
-		.num_devices	= 12,
+		.num_devices	= 13,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC85xx_eTSEC1, MPC85xx_eTSEC2, MPC85xx_eTSEC3,
 			MPC85xx_eTSEC4, MPC85xx_IIC1, MPC85xx_IIC2,
 			MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
 			MPC85xx_PERFMON, MPC85xx_DUART,
+			MPC85xx_MDIO,
 		},
 	},
 	{
 		.ppc_sys_name	= "8545E",
 		.mask 		= 0xFFFF00F0,
 		.value 		= 0x80390010,
-		.num_devices	= 11,
+		.num_devices	= 12,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC85xx_eTSEC1, MPC85xx_eTSEC2,
 			MPC85xx_IIC1, MPC85xx_IIC2,
 			MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
 			MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_SEC2,
+			MPC85xx_MDIO,
 		},
 	},
 	{
 		.ppc_sys_name	= "8545",
 		.mask 		= 0xFFFF00F0,
 		.value 		= 0x80310010,
-		.num_devices	= 10,
+		.num_devices	= 11,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC85xx_eTSEC1, MPC85xx_eTSEC2,
 			MPC85xx_IIC1, MPC85xx_IIC2,
 			MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
 			MPC85xx_PERFMON, MPC85xx_DUART,
+			MPC85xx_MDIO,
 		},
 	},
 	{
 		.ppc_sys_name	= "8543E",
 		.mask 		= 0xFFFF00F0,
 		.value 		= 0x803A0010,
-		.num_devices	= 11,
+		.num_devices	= 12,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC85xx_eTSEC1, MPC85xx_eTSEC2,
 			MPC85xx_IIC1, MPC85xx_IIC2,
 			MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
 			MPC85xx_PERFMON, MPC85xx_DUART, MPC85xx_SEC2,
+			MPC85xx_MDIO,
 		},
 	},
 	{
 		.ppc_sys_name	= "8543",
 		.mask 		= 0xFFFF00F0,
 		.value 		= 0x80320010,
-		.num_devices	= 10,
+		.num_devices	= 11,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC85xx_eTSEC1, MPC85xx_eTSEC2,
 			MPC85xx_IIC1, MPC85xx_IIC2,
 			MPC85xx_DMA0, MPC85xx_DMA1, MPC85xx_DMA2, MPC85xx_DMA3,
 			MPC85xx_PERFMON, MPC85xx_DUART,
+			MPC85xx_MDIO,
 		},
 	},
 	{	/* default match */
diff --git a/include/asm-ppc/mpc85xx.h b/include/asm-ppc/mpc85xx.h
--- a/include/asm-ppc/mpc85xx.h
+++ b/include/asm-ppc/mpc85xx.h
@@ -67,6 +67,8 @@ extern unsigned char __res[];
 #define MPC85xx_DMA3_SIZE	(0x00080)
 #define MPC85xx_ENET1_OFFSET	(0x24000)
 #define MPC85xx_ENET1_SIZE	(0x01000)
+#define MPC85xx_MIIM_OFFSET	(0x24520)
+#define MPC85xx_MIIM_SIZE	(0x00018)
 #define MPC85xx_ENET2_OFFSET	(0x25000)
 #define MPC85xx_ENET2_SIZE	(0x01000)
 #define MPC85xx_ENET3_OFFSET	(0x26000)
@@ -132,6 +134,7 @@ enum ppc_sys_devices {
 	MPC85xx_eTSEC3,
 	MPC85xx_eTSEC4,
 	MPC85xx_IIC2,
+	MPC85xx_MDIO,
 };
 
 /* Internal interrupts are all Level Sensitive, and Positive Polarity */
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -47,14 +47,19 @@
 struct gianfar_platform_data {
 	/* device specific information */
 	u32 device_flags;
-	u32 phy_reg_addr;
 
 	/* board specific information */
 	u32 board_flags;
-	u32 phy_flags;
-	u32 phyid;
-	u32 interruptPHY;
+	const char *bus_id;
 	u8 mac_addr[6];
+};
+
+struct gianfar_mdio_data {
+	/* device specific information */
+	u32 paddr;
+
+	/* board specific information */
+	int irq[32];
 };
 
 /* Flags related to gianfar device features */

^ permalink raw reply

* v2.6.13.4 : Bad page state at prep_new_page when booting with quik
From: Marc Zyngier @ 2005-10-20 17:53 UTC (permalink / raw)
  To: linuxppc-dev

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

List,

I finally managed to bring back to life an old Apus 3000/200 (PowerMac
6400 clone, 603e@200, no L2 cache, 144MB RAM). Kernel is vanilla
2.6.13.4, userland is Debian Sarge.

The strange thing is : while the machine boots perfectly with BootX,
it fills the console with messages like this when booted from quik :

Bad page state at prep_new_page (in process 'S70nviboot', page c04301e0)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c00493cc] do_wp_page+0xdc/0x3cc
 [c004a6dc] __handle_mm_fault+0x154/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed

And no, rebooting doesn't help...

The system more or less manages to painfuly boot, still screaming on
the console. But the result is far from being usable.

Again, the very same kernel works perfectly when booted from BootX,
but I'd rather have the machine to stay headless, with serial console
hanging off the terminal server...

Does anyone have a clue, or at least a direction from where to start?

Thanks,

	M.


[-- Attachment #2: log --]
[-- Type: text/plain, Size: 22865 bytes --]


Second-stage QUIK loader
Welcome to quik. mate is good.
\chosen/bootargs = 
boot: ` 
Enter the kernel image name as [device:][partno]/path, where partno is a
number from 0 to 16.  Instead of /path you can type [mm-nn] to specify a
range of disk blocks (512B)
boot: v2.6.13.4
|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/initrd imagename = `, mem_size: 3267524
initrd_start: 

Inode error #2133571404 while loading file `.
initrd image not found....
Starting at 510000, , 9101312
no active packageopening display /valkyrie@F1000000... ok
copying OF device tree...done
Initializing fake screen: valkyrie
Calling quiesce ...
returning 0x00510000 from prom_init
Linux version 2.6.13.4 (maz@strange-fruit) (gcc version 3.3.5 (Debian 1:3.3.5-13)) #2 Sun Oct 16 20:36:15 CEST 2005
Found a OHare mac-io controller, rev: 1, mapped at 0xfdf00000
PowerMac motherboard: Alchemy
Cache coherency enabled for bandit/PSX
Found Bandit PCI host bridge at 0xf2000000. Firmware bus number: 0->0
nvram: OF partition at 0x1800
nvram: XP partition at 0x1300
nvram: NR partition at 0x1400
Built 1 zonelists
Kernel command line: root=/dev/hda6 ro root=/dev/hda6 console=ttyS0 console=tty0 
System has 32 possible interrupts
PID hash table entries: 1024 (order: 10, 16384 bytes)
GMT Delta read from XPRAM: 120 minutes, DST: on
via_calibrate_decr: ticks per jiffy = 10000 (600010 ticks)
Console: colour dummy device 80x25
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 142848k available (2056k kernel code, 1012k data, 140k init, 0k highmem)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
PCI: Probing PCI hardware
SCSI subsystem initialized
Monitor sense value = 0x603
using video mode 6 and color mode 0.
Console: switching to colour frame buffer device 80x30
fb0: valkyrie frame buffer device
Generic RTC Driver v1.07
Macintosh non-volatile memory driver v1.1
pmac_zilog: 0.6 (Benjamin Herrenschmidt <benh@kernel.crashing.org>)
ttyS0 at MMIO 0xf3013020 (irq = 15) is a Z85c30 ESCC - Serial port
ttyS1 at MMIO 0xf3013000 (irq = 16) is a Z85c30 ESCC - Serial port
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
fd0: SWIM3 floppy controller 
loop: loaded (max 8 devices)
PCI: Enabling device 0000:00:0f.0 (0014 -> 0017)
3c59x: Donald Becker and others. www.scyld.com/network/vortex.html
0000:00:0f.0: 3Com PCI 3c905B Cyclone 100baseTx at 0x400. Vers LK1.1.19
MacIO PCI driver attached to OHare chipset
Can't request resource 0 for MacIO device 0.f3000000:ohare
input: Macintosh mouse button emulation
Macintosh CUDA driver v0.5 for Unified ADB.
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
adb: starting probe task...
ide0: no intrs for device /bandit@F2000000/ohare@10/ATA@20000, using 13
ide0: Found Apple OHare ATA controller, bus ID 0, irq 13
ADB keyboard at 2, handler set to 3
Detected ADB keyboard, type ISO, swapping keys.
input: ADB keyboard on adb2:2.05/input
ADB mouse at 3, handler set to 2
input: ADB mouse on adb3:3.01/input
adb: finished probe task...
hda: SAMSUNG WINNER-3 WN32163A (2.1GB), ATA DISK drive
hda: Enabling MultiWord DMA 2
ide0 at 0xca10a000-0xca10a007,0xca10a160 on irq 13
hda: max request size: 128KiB
hda: 4219488 sectors (2160 MB) w/109KiB Cache, CHS=4186/16/63, DMA
hda: cache flushes not supported
 hda: [mac] hda1 hda2 hda3 hda4 hda5 hda6 hda7 hda8 hda9
mesh: configured for synchronous 5 MB/s
mesh: performing initial bus reset...
scsi0 : MESH
mesh: target 3 synchronous at 5.0 MB/s
  Vendor: MATSHITA  Model: CD-ROM CR-506     Rev: 8S05
  Type:   CD-ROM                             ANSI SCSI revision: 02
sr0: scsi-1 drive
Uniform CD-ROM driver Revision: 3.20
Attached scsi generic sg0 at scsi0, channel 0, id 3, lun 0,  type 5
mice: PS/2 mouse device common for all mice
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP reno registered
TCP bic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
kjournald starting.  Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem) readonly.
Freeing unused kernel memory: 140k init 4k chrp 8k prep
Adding 131064k swap on /dev/hda7.  Priority:-1 extents:1
EXT3 FS on hda6, internal journal
NET: Registered protocol family 10
IPv6 over IPv4 tunneling driver
Bad page state at prep_new_page (in process 'S70nviboot', page c04301e0)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c00493cc] do_wp_page+0xdc/0x3cc
 [c004a6dc] __handle_mm_fault+0x154/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S70nviboot', page c0430200)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c00493cc] do_wp_page+0xdc/0x3cc
 [c004a6dc] __handle_mm_fault+0x154/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S70nviboot', page c0430220)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0049fe0] do_anonymous_page+0x74/0x1b8
 [c004a190] do_no_page+0x6c/0x380
 [c004a668] __handle_mm_fault+0xe0/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S70nviboot', page c0430240)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0049fe0] do_anonymous_page+0x74/0x1b8
 [c004a190] do_no_page+0x6c/0x380
 [c004a668] __handle_mm_fault+0xe0/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S70nviboot', page c0430260)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0039480] find_or_create_page+0xf4/0x108
 [c005c4d8] grow_dev_page+0x30/0x184
 [c005c6c8] __getblk_slow+0x9c/0x15c
 [c005cbd0] __getblk+0x54/0x5c
 [c009cffc] ext3_getblk+0xc0/0x27c
 [c009d1d0] ext3_bread+0x18/0xc0
 [c0099e60] ext3_readdir+0xe8/0x4d4
 [c006ec14] vfs_readdir+0xc8/0xf0
 [c006f1d8] sys_getdents64+0x78/0xe0
 [c00042a0] ret_from_syscall+0x0/0x44
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S70nviboot', page c0430280)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c00493cc] do_wp_page+0xdc/0x3cc
 [c004a6dc] __handle_mm_fault+0x154/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S70nviboot', page c04301c0)
flags:0x00000000 mapping:00000000 mapcount:1 count:0
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c00493cc] do_wp_page+0xdc/0x3cc
 [c004a6dc] __handle_mm_fault+0x154/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S10sysklogd', page c04302a0)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c004a3bc] do_no_page+0x298/0x380
 [c004a668] __handle_mm_fault+0xe0/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S10sysklogd', page c04302c0)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c004a3bc] do_no_page+0x298/0x380
 [c004a668] __handle_mm_fault+0xe0/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S10sysklogd', page c04302e0)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0049fe0] do_anonymous_page+0x74/0x1b8
 [c004a190] do_no_page+0x6c/0x380
 [c004a668] __handle_mm_fault+0xe0/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S10sysklogd', page c0430300)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0049fe0] do_anonymous_page+0x74/0x1b8
 [c004a190] do_no_page+0x6c/0x380
 [c004a668] __handle_mm_fault+0xe0/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S10sysklogd', page c0430320)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c004a3bc] do_no_page+0x298/0x380
 [c004a668] __handle_mm_fault+0xe0/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S10sysklogd', page c0430340)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c004a3bc] do_no_page+0x298/0x380
 [c004a668] __handle_mm_fault+0xe0/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S10sysklogd', page c0430360)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0049fe0] do_anonymous_page+0x74/0x1b8
 [c004a190] do_no_page+0x6c/0x380
 [c004a668] __handle_mm_fault+0xe0/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S10sysklogd', page c0430380)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0049fe0] do_anonymous_page+0x74/0x1b8
 [c004a190] do_no_page+0x6c/0x380
 [c004a668] __handle_mm_fault+0xe0/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S10sysklogd', page c04303a0)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0049600] do_wp_page+0x310/0x3cc
 [c004a6dc] __handle_mm_fault+0x154/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S10sysklogd', page c04303c0)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0049fe0] do_anonymous_page+0x74/0x1b8
 [c004a190] do_no_page+0x6c/0x380
 [c004a668] __handle_mm_fault+0xe0/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'kjournald', page c04303e0)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0039480] find_or_create_page+0xf4/0x108
 [c005c4d8] grow_dev_page+0x30/0x184
 [c005c6c8] __getblk_slow+0x9c/0x15c
 [c005cbd0] __getblk+0x54/0x5c
 [c00b2ea0] journal_get_descriptor_buffer+0x3c/0xa8
 [c00b005c] journal_commit_transaction+0xb88/0xea8
 [c00b2608] kjournald+0xc8/0x1bc
 [c0006cc4] kernel_thread+0x44/0x60
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S10sysklogd', page c0430400)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0049fe0] do_anonymous_page+0x74/0x1b8
 [c004a190] do_no_page+0x6c/0x380
 [c004a668] __handle_mm_fault+0xe0/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'kjournald', page c0430420)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0039480] find_or_create_page+0xf4/0x108
 [c005c4d8] grow_dev_page+0x30/0x184
 [c005c6c8] __getblk_slow+0x9c/0x15c
 [c005cbd0] __getblk+0x54/0x5c
 [c00b2ea0] journal_get_descriptor_buffer+0x3c/0xa8
 [c00af38c] journal_write_commit_record+0x48/0x190
 [c00af9dc] journal_commit_transaction+0x508/0xea8
 [c00b2608] kjournald+0xc8/0x1bc
 [c0006cc4] kernel_thread+0x44/0x60
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S10sysklogd', page c0430440)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0049fe0] do_anonymous_page+0x74/0x1b8
 [c004a190] do_no_page+0x6c/0x380
 [c004a668] __handle_mm_fault+0xe0/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S10sysklogd', page c0430460)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0049fe0] do_anonymous_page+0x74/0x1b8
 [c004a190] do_no_page+0x6c/0x380
 [c004a668] __handle_mm_fault+0xe0/0x160
 [c000e4b8] do_page_fault+0x140/0x39c
 [c0004780] handle_page_fault+0xc/0x80
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'S10sysklogd', page c0430480)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c000ef48] pte_alloc_one+0x24/0x64
 [c00480b0] pte_alloc_map+0x58/0xb0
 [c00481d4] copy_pte_range+0x44/0x230
 [c004847c] copy_page_range+0xbc/0x118
 [c001590c] copy_mm+0x264/0x388
 [c0016258] copy_process+0x3c4/0xb8c
 [c0016b3c] do_fork+0x6c/0x1cc
 [c0007350] sys_fork+0x4c/0x68
 [c00042a0] ret_from_syscall+0x0/0x44
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'start-stop-daem', page c0430620)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0040c44] __do_page_cache_readahead+0x130/0x168
 [c0040e20] blockable_page_cache_readahead+0x64/0xdc
 [c00410b0] page_cache_readahead+0x140/0x1a4
 [c0039c88] do_generic_mapping_read+0x574/0x57c
 [c0039f84] __generic_file_aio_read+0x1ec/0x220
 [c0039ff4] generic_file_aio_read+0x3c/0x5c
 [c005978c] do_sync_read+0xb8/0x10c
 [c00598a8] vfs_read+0xc8/0x1a0
 [c0065bec] kernel_read+0x40/0x58
 [c0066b1c] do_execve+0xe4/0x220
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'start-stop-daem', page c0430640)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0040c44] __do_page_cache_readahead+0x130/0x168
 [c0040e20] blockable_page_cache_readahead+0x64/0xdc
 [c00410b0] page_cache_readahead+0x140/0x1a4
 [c0039c88] do_generic_mapping_read+0x574/0x57c
 [c0039f84] __generic_file_aio_read+0x1ec/0x220
 [c0039ff4] generic_file_aio_read+0x3c/0x5c
 [c005978c] do_sync_read+0xb8/0x10c
 [c00598a8] vfs_read+0xc8/0x1a0
 [c0065bec] kernel_read+0x40/0x58
 [c0066b1c] do_execve+0xe4/0x220
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'start-stop-daem', page c0430660)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0040c44] __do_page_cache_readahead+0x130/0x168
 [c0040e20] blockable_page_cache_readahead+0x64/0xdc
 [c00410b0] page_cache_readahead+0x140/0x1a4
 [c0039c88] do_generic_mapping_read+0x574/0x57c
 [c0039f84] __generic_file_aio_read+0x1ec/0x220
 [c0039ff4] generic_file_aio_read+0x3c/0x5c
 [c005978c] do_sync_read+0xb8/0x10c
 [c00598a8] vfs_read+0xc8/0x1a0
 [c0065bec] kernel_read+0x40/0x58
 [c0066b1c] do_execve+0xe4/0x220
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'start-stop-daem', page c0430680)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0040c44] __do_page_cache_readahead+0x130/0x168
 [c0040e20] <7>eth0: no IPv6 routers present
blockable_page_cache_readahead+0x64/0xdc
 [c00410b0] page_cache_readahead+0x140/0x1a4
 [c0039c88] do_generic_mapping_read+0x574/0x57c
 [c0039f84] __generic_file_aio_read+0x1ec/0x220
 [c0039ff4] generic_file_aio_read+0x3c/0x5c
 [c005978c] do_sync_read+0xb8/0x10c
 [c00598a8] vfs_read+0xc8/0x1a0
 [c0065bec] kernel_read+0x40/0x58
 [c0066b1c] do_execve+0xe4/0x220
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'start-stop-daem', page c04306a0)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc
 [c003d91c] prep_new_page+0x54/0xa0
 [c003dd90] buffered_rmqueue+0xfc/0x1bc
 [c003e318] __alloc_pages+0x408/0x42c
 [c0040c44] __do_page_cache_readahead+0x130/0x168
 [c0040e20] blockable_page_cache_readahead+0x64/0xdc
 [c00410b0] page_cache_readahead+0x140/0x1a4
 [c0039c88] do_generic_mapping_read+0x574/0x57c
 [c0039f84] __generic_file_aio_read+0x1ec/0x220
 [c0039ff4] generic_file_aio_read+0x3c/0x5c
 [c005978c] do_sync_read+0xb8/0x10c
 [c00598a8] vfs_read+0xc8/0x1a0
 [c0065bec] kernel_read+0x40/0x58
 [c0066b1c] do_execve+0xe4/0x220
Trying to fix it up, but a reboot is needed
Bad page state at prep_new_page (in process 'start-stop-daem', page c04306c0)
flags:0x00000000 mapping:00000000 mapcount:1 count:1
Backtrace:
Call trace:
 [c0007494] dump_stack+0x18/0x28
 [c003d53c] bad_page+0x64/0xbc

[-- Attachment #3: Type: text/plain, Size: 79 bytes --]


-- 
And if you don't know where you're going, any road will take you there...

^ permalink raw reply

* [PATCH][RESEND] powerpc: merge include/asm-ppc*/checksum.h into include/asm-powerpc/checksum.h
From: Kumar Gala @ 2005-10-20 16:44 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, linuxppc64-dev

Signed-off-by: Kumar Gala <kumar.gala@freescale.com>

---
commit 5bb6a54bbcd717339f737eba160b6824ec99cd27
tree b23e814e1546aeceaa58ccfafc714a8cf0a13656
parent 1288b50c0dd4747595c5e73dbff02088d8eeefcc
author Kumar K. Gala <kumar.gala@freescale.com> Wed, 21 Sep 2005 14:10:11 -0500
committer Kumar K. Gala <kumar.gala@freescale.com> Wed, 21 Sep 2005 14:10:11 -0500

 include/asm-powerpc/checksum.h |  132 ++++++++++++++++++++++++++++++++++++++++
 include/asm-ppc/checksum.h     |  107 --------------------------------
 include/asm-ppc64/checksum.h   |  107 --------------------------------
 3 files changed, 132 insertions(+), 214 deletions(-)

diff --git a/include/asm-powerpc/checksum.h b/include/asm-powerpc/checksum.h
new file mode 100644
--- /dev/null
+++ b/include/asm-powerpc/checksum.h
@@ -0,0 +1,132 @@
+#ifndef _ASM_POWERPC_CHECKSUM_H
+#define _ASM_POWERPC_CHECKSUM_H
+
+/*
+ * 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 Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+/*
+ * This is a version of ip_compute_csum() optimized for IP headers,
+ * which always checksum on 4 octet boundaries.  ihl is the number
+ * of 32-bit words and is always >= 5.
+ */
+extern unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl);
+
+/*
+ * computes the checksum of the TCP/UDP pseudo-header
+ * returns a 16-bit checksum, already complemented
+ */
+extern unsigned short csum_tcpudp_magic(unsigned long saddr,
+					unsigned long daddr,
+					unsigned short len,
+					unsigned short proto,
+					unsigned int sum);
+
+/*
+ * computes the checksum of a memory block at buff, length len,
+ * and adds in "sum" (32-bit)
+ *
+ * returns a 32-bit number suitable for feeding into itself
+ * or csum_tcpudp_magic
+ *
+ * this function must be called with even lengths, except
+ * for the last fragment, which may be odd
+ *
+ * it's best to have buff aligned on a 32-bit boundary
+ */
+extern unsigned int csum_partial(const unsigned char * buff, int len,
+				 unsigned int sum);
+
+/*
+ * Computes the checksum of a memory block at src, length len,
+ * and adds in "sum" (32-bit), while copying the block to dst.
+ * If an access exception occurs on src or dst, it stores -EFAULT
+ * to *src_err or *dst_err respectively (if that pointer is not
+ * NULL), and, for an error on src, zeroes the rest of dst.
+ *
+ * Like csum_partial, this must be called with even lengths,
+ * except for the last fragment.
+ */
+extern unsigned int csum_partial_copy_generic(const char *src, char *dst,
+					      int len, unsigned int sum,
+					      int *src_err, int *dst_err);
+/*
+ * the same as csum_partial, but copies from src to dst while it
+ * checksums.
+ */
+unsigned int csum_partial_copy_nocheck(const char *src, 
+				       char *dst, 
+				       int len, 
+				       unsigned int sum);
+
+#define csum_partial_copy_from_user(src, dst, len, sum, errp)   \
+        csum_partial_copy_generic((src), (dst), (len), (sum), (errp), NULL)
+
+#define csum_partial_copy_nocheck(src, dst, len, sum)   \
+        csum_partial_copy_generic((src), (dst), (len), (sum), NULL, NULL)
+
+
+/*
+ * turns a 32-bit partial checksum (e.g. from csum_partial) into a
+ * 1's complement 16-bit checksum.
+ */
+static inline unsigned int csum_fold(unsigned int sum)
+{
+	unsigned int tmp;
+
+	/* swap the two 16-bit halves of sum */
+	__asm__("rlwinm %0,%1,16,0,31" : "=r" (tmp) : "r" (sum));
+	/* if there is a carry from adding the two 16-bit halves,
+	   it will carry from the lower half into the upper half,
+	   giving us the correct sum in the upper half. */
+	sum = ~(sum + tmp) >> 16;
+	return sum;
+}
+
+/*
+ * this routine is used for miscellaneous IP-like checksums, mainly
+ * in icmp.c
+ */
+static inline unsigned short ip_compute_csum(unsigned char * buff, int len)
+{
+	return csum_fold(csum_partial(buff, len, 0));
+}
+
+#ifdef __powerpc64__
+static inline u32 csum_tcpudp_nofold(u32 saddr,
+                                     u32 daddr,
+                                     unsigned short len,
+                                     unsigned short proto,
+                                     unsigned int sum)
+{
+	unsigned long s = sum;
+
+	s += saddr;
+	s += daddr;
+	s += (proto << 16) + len;
+	s += (s >> 32);
+	return (u32) s;
+}
+#else
+static inline unsigned long csum_tcpudp_nofold(unsigned long saddr,
+						   unsigned long daddr,
+						   unsigned short len,
+						   unsigned short proto,
+						   unsigned int sum)
+{
+    __asm__("\n\
+	addc %0,%0,%1 \n\
+	adde %0,%0,%2 \n\
+	adde %0,%0,%3 \n\
+	addze %0,%0 \n\
+	"
+	: "=r" (sum)
+	: "r" (daddr), "r"(saddr), "r"((proto<<16)+len), "0"(sum));
+    return sum;
+}
+
+#endif
+#endif
diff --git a/include/asm-ppc/checksum.h b/include/asm-ppc/checksum.h
deleted file mode 100644
--- a/include/asm-ppc/checksum.h
+++ /dev/null
@@ -1,107 +0,0 @@
-#ifdef __KERNEL__
-#ifndef _PPC_CHECKSUM_H
-#define _PPC_CHECKSUM_H
-
-
-/*
- * computes the checksum of a memory block at buff, length len,
- * and adds in "sum" (32-bit)
- *
- * returns a 32-bit number suitable for feeding into itself
- * or csum_tcpudp_magic
- *
- * this function must be called with even lengths, except
- * for the last fragment, which may be odd
- *
- * it's best to have buff aligned on a 32-bit boundary
- */
-extern unsigned int csum_partial(const unsigned char * buff, int len,
-				 unsigned int sum);
-
-/*
- * Computes the checksum of a memory block at src, length len,
- * and adds in "sum" (32-bit), while copying the block to dst.
- * If an access exception occurs on src or dst, it stores -EFAULT
- * to *src_err or *dst_err respectively (if that pointer is not
- * NULL), and, for an error on src, zeroes the rest of dst.
- *
- * Like csum_partial, this must be called with even lengths,
- * except for the last fragment.
- */
-extern unsigned int csum_partial_copy_generic(const char *src, char *dst,
-					      int len, unsigned int sum,
-					      int *src_err, int *dst_err);
-
-#define csum_partial_copy_from_user(src, dst, len, sum, errp)	\
-	csum_partial_copy_generic((__force void *)(src), (dst), (len), (sum), (errp), NULL)
-
-/* FIXME: this needs to be written to really do no check -- Cort */
-#define csum_partial_copy_nocheck(src, dst, len, sum)	\
-	csum_partial_copy_generic((src), (dst), (len), (sum), NULL, NULL)
-
-/*
- * turns a 32-bit partial checksum (e.g. from csum_partial) into a
- * 1's complement 16-bit checksum.
- */
-static inline unsigned int csum_fold(unsigned int sum)
-{
-	unsigned int tmp;
-
-	/* swap the two 16-bit halves of sum */
-	__asm__("rlwinm %0,%1,16,0,31" : "=r" (tmp) : "r" (sum));
-	/* if there is a carry from adding the two 16-bit halves,
-	   it will carry from the lower half into the upper half,
-	   giving us the correct sum in the upper half. */
-	sum = ~(sum + tmp) >> 16;
-	return sum;
-}
-
-/*
- * this routine is used for miscellaneous IP-like checksums, mainly
- * in icmp.c
- */
-static inline unsigned short ip_compute_csum(unsigned char * buff, int len)
-{
-	return csum_fold(csum_partial(buff, len, 0));
-}
-
-/*
- * FIXME: I swiped this one from the sparc and made minor modifications.
- * It may not be correct.  -- Cort
- */
-static inline unsigned long csum_tcpudp_nofold(unsigned long saddr,
-						   unsigned long daddr,
-						   unsigned short len,
-						   unsigned short proto,
-						   unsigned int sum)
-{
-    __asm__("\n\
-	addc %0,%0,%1 \n\
-	adde %0,%0,%2 \n\
-	adde %0,%0,%3 \n\
-	addze %0,%0 \n\
-	"
-	: "=r" (sum)
-	: "r" (daddr), "r"(saddr), "r"((proto<<16)+len), "0"(sum));
-    return sum;
-}
-
-/*
- * This is a version of ip_compute_csum() optimized for IP headers,
- * which always checksum on 4 octet boundaries.  ihl is the number
- * of 32-bit words and is always >= 5.
- */
-extern unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl);
-
-/*
- * computes the checksum of the TCP/UDP pseudo-header
- * returns a 16-bit checksum, already complemented
- */
-extern unsigned short csum_tcpudp_magic(unsigned long saddr,
-					unsigned long daddr,
-					unsigned short len,
-					unsigned short proto,
-					unsigned int sum);
-
-#endif
-#endif /* __KERNEL__ */
diff --git a/include/asm-ppc64/checksum.h b/include/asm-ppc64/checksum.h
deleted file mode 100644
--- a/include/asm-ppc64/checksum.h
+++ /dev/null
@@ -1,107 +0,0 @@
-#ifndef _PPC64_CHECKSUM_H
-#define _PPC64_CHECKSUM_H
-
-/*
- * 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 Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-
-/*
- * This is a version of ip_compute_csum() optimized for IP headers,
- * which always checksum on 4 octet boundaries.  ihl is the number
- * of 32-bit words and is always >= 5.
- */
-extern unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl);
-
-/*
- * computes the checksum of the TCP/UDP pseudo-header
- * returns a 16-bit checksum, already complemented
- */
-extern unsigned short csum_tcpudp_magic(unsigned long saddr,
-					unsigned long daddr,
-					unsigned short len,
-					unsigned short proto,
-					unsigned int sum);
-
-/*
- * computes the checksum of a memory block at buff, length len,
- * and adds in "sum" (32-bit)
- *
- * returns a 32-bit number suitable for feeding into itself
- * or csum_tcpudp_magic
- *
- * this function must be called with even lengths, except
- * for the last fragment, which may be odd
- *
- * it's best to have buff aligned on a 32-bit boundary
- */
-extern unsigned int csum_partial(const unsigned char * buff, int len,
-				 unsigned int sum);
-
-/*
- * the same as csum_partial, but copies from src to dst while it
- * checksums
- */
-extern unsigned int csum_partial_copy_generic(const char *src, char *dst,
-					      int len, unsigned int sum,
-					      int *src_err, int *dst_err);
-/*
- * the same as csum_partial, but copies from src to dst while it
- * checksums.
- */
-
-unsigned int csum_partial_copy_nocheck(const char *src, 
-				       char *dst, 
-				       int len, 
-				       unsigned int sum);
-
-/*
- * turns a 32-bit partial checksum (e.g. from csum_partial) into a
- * 1's complement 16-bit checksum.
- */
-static inline unsigned int csum_fold(unsigned int sum)
-{
-	unsigned int tmp;
-
-	/* swap the two 16-bit halves of sum */
-	__asm__("rlwinm %0,%1,16,0,31" : "=r" (tmp) : "r" (sum));
-	/* if there is a carry from adding the two 16-bit halves,
-	   it will carry from the lower half into the upper half,
-	   giving us the correct sum in the upper half. */
-	sum = ~(sum + tmp) >> 16;
-	return sum;
-}
-
-/*
- * this routine is used for miscellaneous IP-like checksums, mainly
- * in icmp.c
- */
-static inline unsigned short ip_compute_csum(unsigned char * buff, int len)
-{
-	return csum_fold(csum_partial(buff, len, 0));
-}
-
-#define csum_partial_copy_from_user(src, dst, len, sum, errp)   \
-        csum_partial_copy_generic((src), (dst), (len), (sum), (errp), NULL)
-
-#define csum_partial_copy_nocheck(src, dst, len, sum)   \
-        csum_partial_copy_generic((src), (dst), (len), (sum), NULL, NULL)
-
-static inline u32 csum_tcpudp_nofold(u32 saddr,
-                                     u32 daddr,
-                                     unsigned short len,
-                                     unsigned short proto,
-                                     unsigned int sum)
-{
-	unsigned long s = sum;
-
-	s += saddr;
-	s += daddr;
-	s += (proto << 16) + len;
-	s += (s >> 32);
-	return (u32) s;
-}
-
-#endif

^ permalink raw reply

* [PATCH] powerpc: some prom.c cleanups
From: Kumar Gala @ 2005-10-20 16:44 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, linuxppc64-dev

On !CONFIG_PPC_MULTIPLATFORM _machine is defined as 0.  This is ok, but
we can't assign a value to _machine then.

We may not have CONFIG_PCI available, so only build in support for
find_parent_pci_resource(), request_OF_resource(), release_OF_resource()
if PCI is enabled.  This is probably not the long term fix but works out
for now.

Make reg_property64 contain 64-bit elements on a 32-bit machine.

Mark the deprecated prom.c functions as __deprecated.

Signed-off-by: Kumar K. Gala <kumar.gala@freescale.com>

---
commit 3f11459b85450aa70da16ab1b1c82ef29498ef1a
tree 8b625ab8868872bf5b909d0d55dd704604858048
parent e597837e138d9526562a68ec2f3c77a47ce1045e
author Kumar K. Gala <kumar.gala@freescale.com> Thu, 20 Oct 2005 11:41:18 -0500
committer Kumar K. Gala <kumar.gala@freescale.com> Thu, 20 Oct 2005 11:41:18 -0500

 arch/powerpc/kernel/prom.c |    4 ++++
 include/asm-powerpc/prom.h |   14 +++++++-------
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1133,8 +1133,10 @@ static int __init early_init_dt_scan_cho
 #ifdef CONFIG_PPC64
 	systemcfg->platform = *prop;
 #else
+#ifdef CONFIG_PPC_MULTIPLATFORM
 	_machine = *prop;
 #endif
+#endif
 
 #ifdef CONFIG_PPC64
 	/* check if iommu is forced on or off */
@@ -1971,6 +1973,7 @@ bus_space_to_resource_flags(unsigned int
 	}
 }
 
+#ifdef CONFIG_PCI
 static struct resource *find_parent_pci_resource(struct pci_dev* pdev,
 						 struct address_range *range)
 {
@@ -2123,3 +2126,4 @@ int release_OF_resource(struct device_no
 	return 0;
 }
 EXPORT_SYMBOL(release_OF_resource);
+#endif /* CONFIG_PCI */
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -104,8 +104,8 @@ struct reg_property32 {
 };
 
 struct reg_property64 {
-	unsigned long address;
-	unsigned long size;
+	u64 address;
+	u64 size;
 };
 
 struct property {
@@ -155,12 +155,12 @@ static inline void set_node_proc_entry(s
 
 
 /* OBSOLETE: Old style node lookup */
-extern struct device_node *find_devices(const char *name);
-extern struct device_node *find_type_devices(const char *type);
-extern struct device_node *find_path_device(const char *path);
-extern struct device_node *find_compatible_devices(const char *type,
+extern __deprecated struct device_node *find_devices(const char *name);
+extern __deprecated struct device_node *find_type_devices(const char *type);
+extern __deprecated struct device_node *find_path_device(const char *path);
+extern __deprecated struct device_node *find_compatible_devices(const char *type,
 						   const char *compat);
-extern struct device_node *find_all_nodes(void);
+extern __deprecated struct device_node *find_all_nodes(void);
 
 /* New style node lookup */
 extern struct device_node *of_find_node_by_name(struct device_node *from,

^ permalink raw reply

* [PATCH] powerpc: Make sure we have an RTC before trying to adjust it
From: Kumar Gala @ 2005-10-20 16:43 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, linuxppc64-dev

Its valid for ppc_md.set_rtc_time to be NULL.  We need to check
that its non-NULL before trying to update the RTC.

Signed-off-by: Kumar K. Gala <kumar.gala@freescale.com>

---
commit e597837e138d9526562a68ec2f3c77a47ce1045e
tree d5f982c7881efe43276b85ece4a371cb66f64ae5
parent de6cc780f1ec6143474219697c249d7266f56120
author Kumar K. Gala <kumar.gala@freescale.com> Thu, 20 Oct 2005 11:35:28 -0500
committer Kumar K. Gala <kumar.gala@freescale.com> Thu, 20 Oct 2005 11:35:28 -0500

 arch/powerpc/kernel/time.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -144,7 +144,7 @@ static __inline__ void timer_check_rtc(v
          * We should have an rtc call that only sets the minutes and
          * seconds like on Intel to avoid problems with non UTC clocks.
          */
-        if (ntp_synced() &&
+        if (ppc_md.set_rtc_time && ntp_synced() &&
 	    xtime.tv_sec - last_rtc_update >= 659 &&
 	    abs((xtime.tv_nsec/1000) - (1000000-1000000/HZ)) < 500000/HZ &&
 	    jiffies - wall_jiffies == 1) {

^ permalink raw reply

* Re: MPC7447A based board with MV64462 Marvell Discovery III controller
From: Sven Luther @ 2005-10-20 15:37 UTC (permalink / raw)
  To: Mark A. Greer; +Cc: linuxppc-embedded
In-Reply-To: <20051020152157.GB18972@mag.az.mvista.com>

On Thu, Oct 20, 2005 at 08:21:57AM -0700, Mark A. Greer wrote:
> On Thu, Oct 20, 2005 at 05:04:50PM +0200, Sven Luther wrote:
> > Hey, we have code to boot the Freeserv with chrp/Of, need to clean it up and
> > merge it though. Would this be a good thing to submit for mainline inclusion,
> > it is a couple of lines at most, altough there is some reuse of the interrupt
> > controller code i think, which needs some cleanup.
> 
> I don't know what a "Freeserv" is but, sure, push it on up once you're
> happy with it.  The more code the merrier.  :)

It is also known as HPC1, which is the discovery III based freesscale
reference design, as the HPC2 is the tundra based one.

Friendly,

Sven Luther

^ permalink raw reply

* Re: MPC7447A based board with MV64462 Marvell Discovery III controller
From: Sven Luther @ 2005-10-20 15:04 UTC (permalink / raw)
  To: Mark A. Greer; +Cc: linuxppc-embedded
In-Reply-To: <20051013182654.GA18497@mag.az.mvista.com>

On Thu, Oct 13, 2005 at 11:26:54AM -0700, Mark A. Greer wrote:
> On Thu, Oct 13, 2005 at 01:12:19PM +0530, Ashish Bijlani wrote:
> > Hi,
> > 
> > I'm trying to bring MPC7447A based board with MV64462 Marvell Discovery III
> > controller up. Can you guide me to Linux-2.6 sources with support for
> > MV64462 Marvell Discovery III controller and MPC7447A PowerPC processor.
> > Support for I2c, dual 10/100/1000 ethernet ports, and relevant platform
> > should be there. I cannot access the bit keeper repositories so please guide
> > me to the linux-2.6 kernel source tree if you can.
> 
> Ashish,
> 
> Support for both the 7447A and mv64x6x is in the latest 2.6 mainline
> kernel source at kernel.org.
> 
> If your board is a chrp/openfirmware board, then you probably want to use
> the Pegasos code as an example.  If your board has U-boot or some other

Hey, we have code to boot the Freeserv with chrp/Of, need to clean it up and
merge it though. Would this be a good thing to submit for mainline inclusion,
it is a couple of lines at most, altough there is some reuse of the interrupt
controller code i think, which needs some cleanup.

Friendly,

Sven Luther

^ permalink raw reply

* Re: open firmware
From: Sven Luther @ 2005-10-20 15:17 UTC (permalink / raw)
  To: Hollis Blanchard; +Cc: linuxppc-dev
In-Reply-To: <80e720f67822d61a3dcd52cb906996cf@penguinppc.org>

On Fri, Oct 14, 2005 at 10:54:30AM -0500, Hollis Blanchard wrote:
> On Oct 14, 2005, at 10:34 AM, i2a wrote:
> 
> >On Fri, 14 Oct 2005 15:17:47 +0200, Segher Boessenkool wrote
> >>
> >>See http://playground.sun.com/1275/
> >
> >Thanks, initially I had no luck with this site (I had find it),
> >http://playground.sun.com/1275/home.html#OFDCoreDoc
> >
> >The two links of the core documentation are dead :(, and there has to 
> >be a way
> >to get the documentation without having to buy “the book”.
> 
> openbios.org has a better-organized documentation collection.

BTW, anyone know of where to get the CHRP specs in downloadable html or pdf or
something format. Not the chrp OF bindings, but the real CHRP specs ? 

Friendly,

Sven Luther

^ permalink raw reply

* Re: MPC7447A based board with MV64462 Marvell Discovery III controller
From: Mark A. Greer @ 2005-10-20 15:21 UTC (permalink / raw)
  To: Sven Luther; +Cc: linuxppc-embedded
In-Reply-To: <20051020150450.GA27704@localhost.localdomain>

On Thu, Oct 20, 2005 at 05:04:50PM +0200, Sven Luther wrote:
> Hey, we have code to boot the Freeserv with chrp/Of, need to clean it up and
> merge it though. Would this be a good thing to submit for mainline inclusion,
> it is a couple of lines at most, altough there is some reuse of the interrupt
> controller code i think, which needs some cleanup.

I don't know what a "Freeserv" is but, sure, push it on up once you're
happy with it.  The more code the merrier.  :)

Mark

^ permalink raw reply

* MPC8270 with preemptible kernel stucks in early console write
From: claus @ 2005-10-20 13:52 UTC (permalink / raw)
  To: linuxppc-embedded

Hi there,

I'm porting the 2.6.13.2 kernel to a custom board with a MPC8270.
If I compile the kernel preemptible then it gets stuck at the following
line in the cpm_uart_console_write function:

    while ((bdp->cbd_sc & BD_SC_READY) != 0)
            ;

The early_console output works fine in the beginning of the boot but then
it gets stuck after the line "checking if image is initramfs...it isn't
(no cpio magic); looks like an initrd" is printed. The problem doesn't
seem to have anything to do with the initramfs detection though.

I can see with the debugger that the descriptors are OK and the buffers
are filled with correct data but it seems that the SCC is not sending the
characters and the main core is stuck waiting for a descriptor to be
ready for use.

Everything works fine if the kernel is not configured preemptible.

Has anyone else had similar behavior?
Any ideas?


-Claus-

^ permalink raw reply

* Re: How to make mudules on linux-ppc2.6.12
From: Andy Gospodarek @ 2005-10-20 12:19 UTC (permalink / raw)
  To: JohnsonCheng; +Cc: linux-ppc-embedded
In-Reply-To: <20051020110322.A910E6860C@ozlabs.org>

Johnson,

See:

http://lwn.net/Articles/21817/

I found this article to be helpful in the past.

-andy


On 10/20/05, JohnsonCheng <JohnsonCheng@qnap.com.tw> wrote:
>
>
>
> Dear All,
>
>
>
> I just write a "hello world" module code, but I can't compile it for
> ppc2.6.12.
>
> My Makefile is list as following:
>
>
>
> obj-m :=3D test.o
>
> all:
>
>   make ARCH=3Dppc CROSS_COMPILE=3Dpowerpc-linux- -C /root/linux-2.6.12.3
> SUBDIR=3D. modules
>
>
>
> When I run make, no error message output, but I find no test.ko modules. =
The
> output message is list as following:
>
>
>
> make ARCH=3Dppc CROSS_COMPILE=3Dpowerpc-linux- -C /root/linux-2.6.1
>
> 2.3 SUBDIR=3D. modules
>
> make[1]: Entering directory `/root/linux-2.6.12.3'
>
>   CHK     include/linux/version.h
>
> make[2]: `arch/ppc/kernel/asm-offsets.s' is up to date.
>
>   Building modules, stage 2.
>
>   MODPOST
>
> make[1]: Leaving directory `/root/linux-2.6.12.3'
>
>
>
> Do anyone can give me some help ?
>
>
>
> Thanks,
>
> Johnson Cheng
>
>
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
>

^ permalink raw reply

* How to make mudules on linux-ppc2.6.12
From: JohnsonCheng @ 2005-10-20 10:56 UTC (permalink / raw)
  To: linux-ppc-embedded

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

Dear All,

 

I just write a "hello world" module code, but I can't compile it for
ppc2.6.12.

My Makefile is list as following:

 

obj-m := test.o

all:

  make ARCH=ppc CROSS_COMPILE=powerpc-linux- -C /root/linux-2.6.12.3
SUBDIR=. modules

 

When I run make, no error message output, but I find no test.ko modules. The
output message is list as following:

 

make ARCH=ppc CROSS_COMPILE=powerpc-linux- -C /root/linux-2.6.1

2.3 SUBDIR=. modules

make[1]: Entering directory `/root/linux-2.6.12.3'

  CHK     include/linux/version.h

make[2]: `arch/ppc/kernel/asm-offsets.s' is up to date.

  Building modules, stage 2.

  MODPOST

make[1]: Leaving directory `/root/linux-2.6.12.3'

 

Do anyone can give me some help ?

 

Thanks,

Johnson Cheng

 


[-- Attachment #2: Type: text/html, Size: 6266 bytes --]

^ permalink raw reply

* 8248 SEC
From: Wojciech Kromer @ 2005-10-20 10:58 UTC (permalink / raw)
  To: linuxppc-embedded

Is there any driver for security-engine on mpc8248?
If yes, what can it do? where can I found it?

^ permalink raw reply

* Re: [PATCH] ppc32: ppc_sys fixes for 8xx and 82xx
From: Dan Malek @ 2005-10-20  4:15 UTC (permalink / raw)
  To: Christopher Cordahi; +Cc: Kumar Gala, linuxppc-embedded list
In-Reply-To: <a1a7967e0510191729x520b2aeak@mail.gmail.com>


On Oct 19, 2005, at 8:29 PM, Christopher Cordahi wrote:

> I don't understand in what way Marcelo wants to use it, but
> from my understanding and a quick look of the Freescale product
> summary pages it's the opposite of what you're indicating.

OK.  I can't find an up to date one any more.  From the processor
manuals there are overlapping numbers (unless that was just
an oversight during editing).

> Also just because a feature isn't supposed to be present
> doesn't mean it's not.

Yeah, some people have tried probing peripherals to discover
the type of processor, but that was quickly proven to not work.

Thanks.

	-- Dan

^ permalink raw reply

* Re: [PATCH] ppc32: ppc_sys fixes for 8xx and 82xx
From: Christopher Cordahi @ 2005-10-20  0:29 UTC (permalink / raw)
  To: Dan Malek; +Cc: Kumar Gala, linuxppc-embedded list
In-Reply-To: <4c41159c3c06e288e5d69469f1e3ce7b@embeddededge.com>

On 18/10/05, Dan Malek <dan@embeddededge.com> wrote:
>
> On Oct 18, 2005, at 10:24 AM, Marcelo Tosatti wrote:
>
> > For 8xx, I was wondering if the PARTNUM field of the IMMR
> > (section 10.4.1 of MPC860UM.pdf) does have meaningful
> > information which could be used to identify the CPU.
>
> It has meaningful information, but not the way you want
> to use it :-)  The PARTNUM/MASKNUM is only useful
> once you know the type of processor (like 823, 850, 885, etc)
> The PARTNUM is only useful within the "family."  For
> example, the 860 and 880 are two different families, and
> will contain the similar PARTNUM values through their life.
> I believe it's tied to the fabrication process.

I don't understand in what way Marcelo wants to use it, but
from my understanding and a quick look of the Freescale product
summary pages it's the opposite of what you're indicating.
I believe the PARTNUM identifies the family not the part.
You can't tell an 885 from an 870 (IMMR contains 0x09xx).
Similarly you can't tell an 860EN from an 860T (IMMR
contains 0x00xx or 0x05xx).
But you can tell an 860 from an 880 which are in different
families.  Note that it's not always obvious which parts
are in the same family.

> You may as well stop looking for an easy (or possibly
> any) way to differentiate these parts in software, but
> due to they way they are fabricated, I don't think that's
> ever going to happen. :-)
Also just because a feature isn't supposed to be present
doesn't mean it's not.
We bought 860EN (4 SCCs) parts but Motorola accidentily
shipped us 860DE (2 SCCs) parts.  We installed, tested and
shipped a few of these parts using all 4 SCCs without
problem.  It wasn't until another unrelated problem occurred
that we noticed that we had used a tray of the wrong part.

Chris

^ permalink raw reply

* [PATCH] (modified) Merge types.h
From: Becky Bruce @ 2005-10-19 23:45 UTC (permalink / raw)
  To: linuxppc64-dev, linuxppc-dev

powerpc: Merge types.h

This patch merges types.h into include/asm-powerpc. The only real change is
the removal of the include of linux/config.h from the 32-bit version - it 
doesn't appear to be necessary.

This patch has been built on several different 32 and 64-bit platforms,
and booted on mpc8540_ads.

This patch supersedes the previous patch [PATCH] Merge types.h

Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>

---
commit 995fc5087d7f02d7e570c9a904a16453e1d8d307
tree 8326faf3664a5c2912ab28f822d9ab7e84fc8a1b
parent 4746820969c846263fca3f0b54e0c1af883b67ed
author Becky Bruce <becky.bruce@freescale.com> Wed, 19 Oct 2005 11:12:13 -0500
committer Becky Bruce <becky.bruce@freescale.com> Wed, 19 Oct 2005 11:12:13 -0500

 include/asm-powerpc/types.h |  104 +++++++++++++++++++++++++++++++++++++++++++
 include/asm-ppc/types.h     |   69 ------------------------------
 include/asm-ppc64/types.h   |   79 ----------------------------------
 3 files changed, 100 insertions(+), 148 deletions(-)

diff --git a/include/asm-powerpc/types.h b/include/asm-powerpc/types.h
new file mode 100644
--- /dev/null
+++ b/include/asm-powerpc/types.h
@@ -0,0 +1,104 @@
+#ifndef _ASM_POWERPC_TYPES_H
+#define _ASM_POWERPC_TYPES_H
+
+#ifndef __ASSEMBLY__
+
+/*
+ * This file is never included by application software unless
+ * explicitly requested (e.g., via linux/types.h) in which case the
+ * application is Linux specific so (user-) name space pollution is
+ * not a major issue.  However, for interoperability, libraries still
+ * need to be careful to avoid a name clashes.
+ *
+ * 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 Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifdef __powerpc64__
+typedef unsigned int umode_t;
+#else
+typedef unsigned short umode_t;
+#endif
+
+/*
+ * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
+ * header files exported to user space
+ */
+
+typedef __signed__ char __s8;
+typedef unsigned char __u8;
+
+typedef __signed__ short __s16;
+typedef unsigned short __u16;
+
+typedef __signed__ int __s32;
+typedef unsigned int __u32;
+
+#ifdef __powerpc64__
+typedef __signed__ long __s64;
+typedef unsigned long __u64;
+#else
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+typedef __signed__ long long __s64;
+typedef unsigned long long __u64;
+#endif
+#endif /* __powerpc64__ */
+
+typedef struct {
+	__u32 u[4];
+} __attribute((aligned(16))) __vector128;
+
+#endif /* __ASSEMBLY__ */
+
+#ifdef __KERNEL__
+/*
+ * These aren't exported outside the kernel to avoid name space clashes
+ */
+#ifdef __powerpc64__
+#define BITS_PER_LONG 64
+#else
+#define BITS_PER_LONG 32
+#endif
+
+#ifndef __ASSEMBLY__
+
+typedef signed char s8;
+typedef unsigned char u8;
+
+typedef signed short s16;
+typedef unsigned short u16;
+
+typedef signed int s32;
+typedef unsigned int u32;
+
+#ifdef __powerpc64__
+typedef signed long s64;
+typedef unsigned long u64;
+#else
+typedef signed long long s64;
+typedef unsigned long long u64;
+#endif
+
+typedef __vector128 vector128;
+
+typedef u32 dma_addr_t;
+typedef u64 dma64_addr_t;
+
+typedef struct {
+	unsigned long entry;
+	unsigned long toc;
+	unsigned long env;
+} func_descr_t;
+
+#ifdef CONFIG_LBD
+typedef u64 sector_t;
+#define HAVE_SECTOR_T
+#endif
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* __KERNEL__ */
+
+#endif /* _ASM_POWERPC_TYPES_H */
diff --git a/include/asm-ppc/types.h b/include/asm-ppc/types.h
deleted file mode 100644
--- a/include/asm-ppc/types.h
+++ /dev/null
@@ -1,69 +0,0 @@
-#ifndef _PPC_TYPES_H
-#define _PPC_TYPES_H
-
-#ifndef __ASSEMBLY__
-
-typedef __signed__ char __s8;
-typedef unsigned char __u8;
-
-typedef __signed__ short __s16;
-typedef unsigned short __u16;
-
-typedef __signed__ int __s32;
-typedef unsigned int __u32;
-
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
-#endif
-
-typedef struct {
-	__u32 u[4];
-} __vector128;
-
-/*
- * XXX allowed outside of __KERNEL__ for now, until glibc gets
- * a proper set of asm headers of its own.  -- paulus
- */
-typedef unsigned short umode_t;
-
-#endif /* __ASSEMBLY__ */
-
-#ifdef __KERNEL__
-/*
- * These aren't exported outside the kernel to avoid name space clashes
- */
-#define BITS_PER_LONG 32
-
-#ifndef __ASSEMBLY__
-
-#include <linux/config.h>
-
-typedef signed char s8;
-typedef unsigned char u8;
-
-typedef signed short s16;
-typedef unsigned short u16;
-
-typedef signed int s32;
-typedef unsigned int u32;
-
-typedef signed long long s64;
-typedef unsigned long long u64;
-
-typedef __vector128 vector128;
-
-/* DMA addresses are 32-bits wide */
-typedef u32 dma_addr_t;
-typedef u64 dma64_addr_t;
-
-#ifdef CONFIG_LBD
-typedef u64 sector_t;
-#define HAVE_SECTOR_T
-#endif
-
-#endif /* __ASSEMBLY__ */
-
-#endif /* __KERNEL__ */
-
-#endif
diff --git a/include/asm-ppc64/types.h b/include/asm-ppc64/types.h
deleted file mode 100644
--- a/include/asm-ppc64/types.h
+++ /dev/null
@@ -1,79 +0,0 @@
-#ifndef _PPC64_TYPES_H
-#define _PPC64_TYPES_H
-
-#ifndef __ASSEMBLY__
-
-/*
- * This file is never included by application software unless
- * explicitly requested (e.g., via linux/types.h) in which case the
- * application is Linux specific so (user-) name space pollution is
- * not a major issue.  However, for interoperability, libraries still
- * need to be careful to avoid a name clashes.
- *
- * 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 Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-
-typedef unsigned int umode_t;
-
-/*
- * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
- * header files exported to user space
- */
-
-typedef __signed__ char __s8;
-typedef unsigned char __u8;
-
-typedef __signed__ short __s16;
-typedef unsigned short __u16;
-
-typedef __signed__ int __s32;
-typedef unsigned int __u32;
-
-typedef __signed__ long __s64;
-typedef unsigned long __u64;
-
-typedef struct {
-	__u32 u[4];
-} __attribute((aligned(16))) __vector128;
-
-#endif /* __ASSEMBLY__ */
-
-#ifdef __KERNEL__
-/*
- * These aren't exported outside the kernel to avoid name space clashes
- */
-#define BITS_PER_LONG 64
-
-#ifndef __ASSEMBLY__
-
-typedef signed char s8;
-typedef unsigned char u8;
-
-typedef signed short s16;
-typedef unsigned short u16;
-
-typedef signed int s32;
-typedef unsigned int u32;
-
-typedef signed long s64;
-typedef unsigned long u64;
-
-typedef __vector128 vector128;
-
-typedef u32 dma_addr_t;
-typedef u64 dma64_addr_t;
-
-typedef struct {
-	unsigned long entry;
-	unsigned long toc;
-	unsigned long env;
-} func_descr_t;
-
-#endif /* __ASSEMBLY__ */
-
-#endif /* __KERNEL__ */
-
-#endif /* _PPC64_TYPES_H */

^ permalink raw reply

* Re: [PATCH] powerpc: merge types.h
From: Becky Bruce @ 2005-10-19 23:41 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc64-dev, linuxppc-dev
In-Reply-To: <17238.52279.428407.411558@cargo.ozlabs.ibm.com>

Gack!  While I doubt that should break anything, I can't promise 100% 
that it won't.  I'll resubmit with that wrapped  up in a nice shiny 
ifdef.

Thanks for the catch - I wouldn't want irate users picketing my house :)

Cheers,
B

On Oct 19, 2005, at 5:44 PM, Paul Mackerras wrote:

> Becky Bruce writes:
>
>> This patch merges types.h into include/asm-powerpc.  The only real 
>> changes
>> here are that umode_t has become short instead of int in the 64-bit 
>> case,
>> which appears to match what most other platforms have done.
>
> Ummm, isn't that an ABI change?  We don't want to do that unless
> you're completely absolutely positively sure it couldn't possibly
> cause any userspace breakage.
>
> Regards,
> Paul.

^ permalink raw reply

* Re: [PATCH] powerpc: merge types.h
From: Paul Mackerras @ 2005-10-19 22:44 UTC (permalink / raw)
  To: Becky Bruce; +Cc: linuxppc64-dev, linuxppc-dev
In-Reply-To: <Pine.LNX.4.61.0510191140350.29058@cde-tx32-ldt329.sps.mot.com>

Becky Bruce writes:

> This patch merges types.h into include/asm-powerpc.  The only real changes
> here are that umode_t has become short instead of int in the 64-bit case,
> which appears to match what most other platforms have done.

Ummm, isn't that an ABI change?  We don't want to do that unless
you're completely absolutely positively sure it couldn't possibly
cause any userspace breakage.

Regards,
Paul.

^ permalink raw reply

* [PATCH] ppc32: ppc_sys fixes for 8xx and 82xx (whitespaces fixed)
From: Vitaly Bordug @ 2005-10-19 17:57 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Kumar Gala, linuxppc-embedded list

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

This patch fixes a numbers of issues regarding to that both 8xx and 82xx
began to use ppc_sys model:
	- Platform is now identified by default deviceless SOC, if no
BOARD_CHIP_NAME is specified in the bard-specific header. For the list
of supported names refer to (arch/ppc/syslib/) mpc8xx_sys.c and
mpc82xx_sys.c for 8xx and 82xx respectively.
	- Fixed a bug in identification by name - if the name was not found, it
returned -1 instead of default deviceless ppc_spec.
	- fixed devices amount in the 8xx platform system descriptions


Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
Signed-off-by: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
-- 
Sincerely,
Vitaly


[-- Attachment #2: 2.patch --]
[-- Type: text/x-patch, Size: 3507 bytes --]

diff --git a/arch/ppc/platforms/fads.h b/arch/ppc/platforms/fads.h
--- a/arch/ppc/platforms/fads.h
+++ b/arch/ppc/platforms/fads.h
@@ -25,6 +25,8 @@
 
 #if defined(CONFIG_MPC86XADS)
 
+#define BOARD_CHIP_NAME "MPC86X"
+
 /* U-Boot maps BCSR to 0xff080000 */
 #define BCSR_ADDR		((uint)0xff080000)
 
diff --git a/arch/ppc/platforms/mpc885ads.h b/arch/ppc/platforms/mpc885ads.h
--- a/arch/ppc/platforms/mpc885ads.h
+++ b/arch/ppc/platforms/mpc885ads.h
@@ -88,5 +88,7 @@
 #define SICR_ENET_MASK	((uint)0x00ff0000)
 #define SICR_ENET_CLKRT	((uint)0x002c0000)
 
+#define BOARD_CHIP_NAME "MPC885"
+
 #endif /* __ASM_MPC885ADS_H__ */
 #endif /* __KERNEL__ */
diff --git a/arch/ppc/syslib/m8260_setup.c b/arch/ppc/syslib/m8260_setup.c
--- a/arch/ppc/syslib/m8260_setup.c
+++ b/arch/ppc/syslib/m8260_setup.c
@@ -62,6 +62,10 @@ m8260_setup_arch(void)
 	if (initrd_start)
 		ROOT_DEV = Root_RAM0;
 #endif
+
+	identify_ppc_sys_by_name_and_id(BOARD_CHIP_NAME, 
+				in_be32(CPM_MAP_ADDR + CPM_IMMR_OFFSET));
+
 	m82xx_board_setup();
 }
 
diff --git a/arch/ppc/syslib/m8xx_setup.c b/arch/ppc/syslib/m8xx_setup.c
--- a/arch/ppc/syslib/m8xx_setup.c
+++ b/arch/ppc/syslib/m8xx_setup.c
@@ -404,6 +404,8 @@ platform_init(unsigned long r3, unsigned
 		strcpy(cmd_line, (char *)(r6+KERNELBASE));
 	}
 
+	identify_ppc_sys_by_name(BOARD_CHIP_NAME);
+
 	ppc_md.setup_arch		= m8xx_setup_arch;
 	ppc_md.show_percpuinfo		= m8xx_show_percpuinfo;
 	ppc_md.irq_canonicalize	= NULL;
diff --git a/arch/ppc/syslib/mpc8xx_sys.c b/arch/ppc/syslib/mpc8xx_sys.c
--- a/arch/ppc/syslib/mpc8xx_sys.c
+++ b/arch/ppc/syslib/mpc8xx_sys.c
@@ -24,7 +24,7 @@ struct ppc_sys_spec ppc_sys_specs[] = {
 		.ppc_sys_name	= "MPC86X",
 		.mask 		= 0xFFFFFFFF,
 		.value 		= 0x00000000,
-		.num_devices	= 2,
+		.num_devices	= 7,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC8xx_CPM_FEC1,
@@ -40,7 +40,7 @@ struct ppc_sys_spec ppc_sys_specs[] = {
 		.ppc_sys_name	= "MPC885",
 		.mask 		= 0xFFFFFFFF,
 		.value 		= 0x00000000,
-		.num_devices	= 3,
+		.num_devices	= 8,
 		.device_list	= (enum ppc_sys_devices[])
 		{
 			MPC8xx_CPM_FEC1,
diff --git a/arch/ppc/syslib/ppc_sys.c b/arch/ppc/syslib/ppc_sys.c
--- a/arch/ppc/syslib/ppc_sys.c
+++ b/arch/ppc/syslib/ppc_sys.c
@@ -69,6 +69,9 @@ static int __init find_chip_by_name_and_
 			matched[j++] = i;
 		i++;
 	}
+
+	ret = i;
+
 	if (j != 0) {
 		for (i = 0; i < j; i++) {
 			if ((ppc_sys_specs[matched[i]].mask & id) ==
diff --git a/include/asm-ppc/cpm2.h b/include/asm-ppc/cpm2.h
--- a/include/asm-ppc/cpm2.h
+++ b/include/asm-ppc/cpm2.h
@@ -1087,6 +1087,9 @@ typedef struct im_idma {
 #define SCCR_PCIDF_MSK	0x00000078	/* PCI division factor	*/
 #define SCCR_PCIDF_SHIFT 3
 
+#ifndef CPM_IMMR_OFFSET
+#define CPM_IMMR_OFFSET	0x101a8
+#endif
 
 #endif /* __CPM2__ */
 #endif /* __KERNEL__ */
diff --git a/include/asm-ppc/mpc8260.h b/include/asm-ppc/mpc8260.h
--- a/include/asm-ppc/mpc8260.h
+++ b/include/asm-ppc/mpc8260.h
@@ -92,6 +92,10 @@ enum ppc_sys_devices {
 extern unsigned char __res[];
 #endif
 
+#ifndef BOARD_CHIP_NAME
+#define BOARD_CHIP_NAME ""
+#endif
+
 #endif /* CONFIG_8260 */
 #endif /* !__ASM_PPC_MPC8260_H__ */
 #endif /* __KERNEL__ */
diff --git a/include/asm-ppc/mpc8xx.h b/include/asm-ppc/mpc8xx.h
--- a/include/asm-ppc/mpc8xx.h
+++ b/include/asm-ppc/mpc8xx.h
@@ -113,6 +113,10 @@ enum ppc_sys_devices {
 	MPC8xx_CPM_USB,
 };
 
+#ifndef BOARD_CHIP_NAME
+#define BOARD_CHIP_NAME ""
+#endif
+
 #endif /* !__ASSEMBLY__ */
 #endif /* CONFIG_8xx */
 #endif /* __CONFIG_8xx_DEFS */

^ permalink raw reply

* PPC 440 / JFFS2 checksum question.
From: Andrew McCarthy @ 2005-10-19 17:36 UTC (permalink / raw)
  To: linuxppc-embedded

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

We have some PPC440GX based blade servers that boot
from flash. My boss wants me to add
additional checksums somewhere in the JFFS2 partitions
as an overall check of the JFFS2 filesystem images that
we burn to flash. Once the image is burned, that file
system is never written to again. (That's the theory anyway).
So every time they boot they want to read these checksum
out of the flash and use it to decide if they want to/can boot
with that filesystem or fallback to another one.
 Each copy of the kernel has its own JFFS2 partition.
The root file system has its own JFFS2 partition. I don't
understand why they don't just write everything to one
JFFS2 partition. They say it is because they are
worried about power failure while writing to the flash and want
to isolate any write failures.
( I tried to tell them that the journaling already handles
that case quite well - but they are non-believers)
 Some questions;
 1) Is a filesystem-wide checksum really necessary or
is it kind of silly?
 1.1) Doesn't JFFS2 already do some integrity checking after
it finishes writing a file? Are there checksums or anything that
serves the same function? They want to avoid having to
checksum the entire filesystem at boot time (due to quick
boot time requirements) - is there some field or fields, or technique that
can quickly tell me if the filesystem is ok?
 2) Is there any place within the bounds of a JFFS2
partition that is safe from being overwritten? before and
after checksums could be placed there.
 2.1) Is there any way to create such a place? for example,
by appending the checksums to the end of some filesystem-wide
structure like a super block? Or maybe it can be hidden in
a couple of inodes that are never overwritten.
 What I'm looking for regarding this adding extra checksums into the
JFFS2 image is:
 3.1) How can it be done?
3.2) Why might it be unnecessary or even inadvisable?
3.3) Why can't it be done?
 Once I understand the answers to these questions I can
go back and see what they want to do.
 In the meantime, I am dumping and analyzing the JFFS2
filesystems we have and reading the code trying to find the
answers.
 thanks for your time.

[-- Attachment #2: Type: text/html, Size: 3145 bytes --]

^ permalink raw reply

* [PATCH] powerpc: merge types.h
From: Becky Bruce @ 2005-10-19 16:55 UTC (permalink / raw)
  To: linuxppc64-dev, linuxppc-dev

powerpc: Merge types.h

This patch merges types.h into include/asm-powerpc.  The only real changes
here are that umode_t has become short instead of int in the 64-bit case,
which appears to match what most other platforms have done.  Also, the
32-bit version was #including linux/config.h - I have removed this as it
does not appear necessary.

This patch has been built on several different 32 and 64-bit platforms,
and booted on mpc8540_ads.

Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>

---
commit 995fc5087d7f02d7e570c9a904a16453e1d8d307
tree 8326faf3664a5c2912ab28f822d9ab7e84fc8a1b
parent 4746820969c846263fca3f0b54e0c1af883b67ed
author Becky Bruce <becky.bruce@freescale.com> Wed, 19 Oct 2005 11:12:13 -0500
committer Becky Bruce <becky.bruce@freescale.com> Wed, 19 Oct 2005 11:12:13 -0500

 include/asm-powerpc/types.h |  100 +++++++++++++++++++++++++++++++++++++++++++
 include/asm-ppc/types.h     |   69 ------------------------------
 include/asm-ppc64/types.h   |   79 ----------------------------------
 3 files changed, 100 insertions(+), 148 deletions(-)

diff --git a/include/asm-powerpc/types.h b/include/asm-powerpc/types.h
new file mode 100644
--- /dev/null
+++ b/include/asm-powerpc/types.h
@@ -0,0 +1,100 @@
+#ifndef _ASM_POWERPC_TYPES_H
+#define _ASM_POWERPC_TYPES_H
+
+#ifndef __ASSEMBLY__
+
+/*
+ * This file is never included by application software unless
+ * explicitly requested (e.g., via linux/types.h) in which case the
+ * application is Linux specific so (user-) name space pollution is
+ * not a major issue.  However, for interoperability, libraries still
+ * need to be careful to avoid a name clashes.
+ *
+ * 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 Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+typedef unsigned short umode_t;
+
+/*
+ * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
+ * header files exported to user space
+ */
+
+typedef __signed__ char __s8;
+typedef unsigned char __u8;
+
+typedef __signed__ short __s16;
+typedef unsigned short __u16;
+
+typedef __signed__ int __s32;
+typedef unsigned int __u32;
+
+#ifdef __powerpc64__
+typedef __signed__ long __s64;
+typedef unsigned long __u64;
+#else
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+typedef __signed__ long long __s64;
+typedef unsigned long long __u64;
+#endif
+#endif /* __powerpc64__ */
+
+typedef struct {
+	__u32 u[4];
+} __attribute((aligned(16))) __vector128;
+
+#endif /* __ASSEMBLY__ */
+
+#ifdef __KERNEL__
+/*
+ * These aren't exported outside the kernel to avoid name space clashes
+ */
+#ifdef __powerpc64__
+#define BITS_PER_LONG 64
+#else
+#define BITS_PER_LONG 32
+#endif
+
+#ifndef __ASSEMBLY__
+
+typedef signed char s8;
+typedef unsigned char u8;
+
+typedef signed short s16;
+typedef unsigned short u16;
+
+typedef signed int s32;
+typedef unsigned int u32;
+
+#ifdef __powerpc64__
+typedef signed long s64;
+typedef unsigned long u64;
+#else
+typedef signed long long s64;
+typedef unsigned long long u64;
+#endif
+
+typedef __vector128 vector128;
+
+typedef u32 dma_addr_t;
+typedef u64 dma64_addr_t;
+
+typedef struct {
+	unsigned long entry;
+	unsigned long toc;
+	unsigned long env;
+} func_descr_t;
+
+#ifdef CONFIG_LBD
+typedef u64 sector_t;
+#define HAVE_SECTOR_T
+#endif
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* __KERNEL__ */
+
+#endif /* _ASM_POWERPC_TYPES_H */
diff --git a/include/asm-ppc/types.h b/include/asm-ppc/types.h
deleted file mode 100644
--- a/include/asm-ppc/types.h
+++ /dev/null
@@ -1,69 +0,0 @@
-#ifndef _PPC_TYPES_H
-#define _PPC_TYPES_H
-
-#ifndef __ASSEMBLY__
-
-typedef __signed__ char __s8;
-typedef unsigned char __u8;
-
-typedef __signed__ short __s16;
-typedef unsigned short __u16;
-
-typedef __signed__ int __s32;
-typedef unsigned int __u32;
-
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
-#endif
-
-typedef struct {
-	__u32 u[4];
-} __vector128;
-
-/*
- * XXX allowed outside of __KERNEL__ for now, until glibc gets
- * a proper set of asm headers of its own.  -- paulus
- */
-typedef unsigned short umode_t;
-
-#endif /* __ASSEMBLY__ */
-
-#ifdef __KERNEL__
-/*
- * These aren't exported outside the kernel to avoid name space clashes
- */
-#define BITS_PER_LONG 32
-
-#ifndef __ASSEMBLY__
-
-#include <linux/config.h>
-
-typedef signed char s8;
-typedef unsigned char u8;
-
-typedef signed short s16;
-typedef unsigned short u16;
-
-typedef signed int s32;
-typedef unsigned int u32;
-
-typedef signed long long s64;
-typedef unsigned long long u64;
-
-typedef __vector128 vector128;
-
-/* DMA addresses are 32-bits wide */
-typedef u32 dma_addr_t;
-typedef u64 dma64_addr_t;
-
-#ifdef CONFIG_LBD
-typedef u64 sector_t;
-#define HAVE_SECTOR_T
-#endif
-
-#endif /* __ASSEMBLY__ */
-
-#endif /* __KERNEL__ */
-
-#endif
diff --git a/include/asm-ppc64/types.h b/include/asm-ppc64/types.h
deleted file mode 100644
--- a/include/asm-ppc64/types.h
+++ /dev/null
@@ -1,79 +0,0 @@
-#ifndef _PPC64_TYPES_H
-#define _PPC64_TYPES_H
-
-#ifndef __ASSEMBLY__
-
-/*
- * This file is never included by application software unless
- * explicitly requested (e.g., via linux/types.h) in which case the
- * application is Linux specific so (user-) name space pollution is
- * not a major issue.  However, for interoperability, libraries still
- * need to be careful to avoid a name clashes.
- *
- * 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 Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-
-typedef unsigned int umode_t;
-
-/*
- * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
- * header files exported to user space
- */
-
-typedef __signed__ char __s8;
-typedef unsigned char __u8;
-
-typedef __signed__ short __s16;
-typedef unsigned short __u16;
-
-typedef __signed__ int __s32;
-typedef unsigned int __u32;
-
-typedef __signed__ long __s64;
-typedef unsigned long __u64;
-
-typedef struct {
-	__u32 u[4];
-} __attribute((aligned(16))) __vector128;
-
-#endif /* __ASSEMBLY__ */
-
-#ifdef __KERNEL__
-/*
- * These aren't exported outside the kernel to avoid name space clashes
- */
-#define BITS_PER_LONG 64
-
-#ifndef __ASSEMBLY__
-
-typedef signed char s8;
-typedef unsigned char u8;
-
-typedef signed short s16;
-typedef unsigned short u16;
-
-typedef signed int s32;
-typedef unsigned int u32;
-
-typedef signed long s64;
-typedef unsigned long u64;
-
-typedef __vector128 vector128;
-
-typedef u32 dma_addr_t;
-typedef u64 dma64_addr_t;
-
-typedef struct {
-	unsigned long entry;
-	unsigned long toc;
-	unsigned long env;
-} func_descr_t;
-
-#endif /* __ASSEMBLY__ */
-
-#endif /* __KERNEL__ */
-
-#endif /* _PPC64_TYPES_H */

^ permalink raw reply

* Re: Need help Understanding initial memory conditions.
From: Andrei Konovalov @ 2005-10-19 10:24 UTC (permalink / raw)
  To: Kalle Pokki, David H. Lynch Jr; +Cc: linuxppc-embedded
In-Reply-To: <4355E9B5.30106@iki.fi>

Kalle Pokki wrote:
> David H. Lynch Jr wrote:
> 
>> Alright I have RAM at physical 0x0 now.  I throw a copy of a 
>> compressed linux image into RAM (anywhere special ?) load the assorted 
>> registers with the appropriate values, fill the board info struct., 
>> and just jump to the start of the image and pray that load text starts 
>> coming out my serial port ?
> 
> Basically, but the exact thing to do depends which image you take. The 
> build process results in a few different image files. I usually just 
> take the vmlinux ELF file, and then my own scripts objcopy it to binary, 
> compress, objcopy to an object file, and link the compressed image 
> directly to the boot loader. The boot loader is then, of course, 
> responsible of uncompressing the image to RAM to 0x00000000.
> 
> I think the kernel build can also create some "self-extracting" images, 
> but I have never tried those.

Yes, this is exactly the way ML300 is booted (as regards to the code
currently in www.kernel.org's 2.6 tree).
Use 'make zImage' or 'make zImage.initrd' to get zImage.elf or zImage.initrd.elf.

> Maybe they don't even work anymore, as 
> many (most?)  people just use the U-boot images.

There is U-Boot port for ML300 by Peter Ryser from Xilinx,
but I haven't tried using it (yet). IIRC there is an appnote
on Xilinx web site that describes how to boot the 2.4 kernel
with U-Boot (few modifications need to be done to the kernel).


Best regards,
Andrei

^ permalink raw reply

* RE: ELDK 3.1.1 ramdisk
From: Clement Fabien @ 2005-10-19 11:17 UTC (permalink / raw)
  To: somshekar chandrashekar kadam, linuxppc-embedded

Hi,

Make sure ROOT_DEV is initialized to the correct device, for instance :

In Sandpoint.c (arch\ppc\platforms):	=09

#ifdef	CONFIG_ROOT_NFS
	ROOT_DEV =3D to_kdev_t(0x00FF);	/* /dev/nfs pseudo device */
#endif

There is no default value for it, except if you pass it on command line

Fabien

________________________________________
From: linuxppc-embedded-bounces@ozlabs.org =
[mailto:linuxppc-embedded-bounces@ozlabs.org] On Behalf Of somshekar =
chandrashekar kadam
Sent: lundi 17 octobre 2005 09:52
To: linuxppc-embedded@ozlabs.org
Subject: ELDK 3.1.1 ramdisk

=A0=20
HI ,=20

=A0 I am using MPC862 with 64mb ram , with Denx 3.1.1 eldk=20
with linux-2.4.25 on my custom board.=20
on Uboot i use SMC2 as my serial console , when i load linux i use SCC4 =
as my serisl console , this is becuase i dont have any idea why my SMC2 =
is not working , it works fine on my linux-2.4.18 kernel ,=20
anyways thats not the problem ,

i am using ramdisk_image.gz provided by eldk , and i have configured =
kernel wit intial ramdisk support , i have attachec the config file =
below , and also the booting messages in another file . as i chnages the =
console from smc2 to scc4 from uboot to linux may be intial message is =
not clear ,=20
i always get kernel panic VFS unable to mount root fs , is there =
something else i need to do or i am missing very important configuartion =
, please throw some light=20

thanks in advance=20
Neelu=20

^ permalink raw reply

* Re: openpic/mac-io
From: Benjamin Herrenschmidt @ 2005-10-19 10:35 UTC (permalink / raw)
  To: i2a; +Cc: linuxppc-dev
In-Reply-To: <20051018191029.M22134@quicknet.nl>

On Tue, 2005-10-18 at 21:22 +0200, i2a wrote:
> Hi, 
> 
> I am searching for documentation about the OpenPIC interrupt-controller in mac
> systems. I found this site but most of the links are dead or give no hope on
> real technical documentation :).
> http://www.macbsd.com/openmac/refs.html
> 
> Could someone give any pointers or files?
> 
> I am also searching for any related documentation on the mac-io device (this
> could be a combo document).
> 
> I am trying to do a port as a masters project, and my biggest problem is:
> documentation :(.

Another interesting bit of docs is MacTech.pdf (google for it) which
documents an early version of the mac-io chip that was used on some CHRP
machines.

In general, there is no complete documentation. I would say that the
linux source code is probably the best you can get in this regard.

Feel free to ask me questions about details

Ben.

^ 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