Add support for IDS8247 board
Subsystems (7)
PATCH 1/1 Add support for IDS8247 board
Hello!
Add support for IDS8247 board from IDS GmbH, Germany
Regards
Sergej Stepanov.
---
arch/powerpc/boot/dts/mpc8247ids.dts +146 -0
@@ -0,0 +1,146 @@ +/* + * IDS8247 Device Tree Source + * + * Copyright 2007 IDS GmbH, Germany + * Sergej Steapnov <[email protected]> + * + * 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. + * Compiled: dtc -O dtb -o mpc8247ids.dtb -b 0 mpc8247ids.dts + */ + +/ { + model = "MPC8247IDS"; + compatible = "IDSLinuxFamily"; + #address-cells = <1>; + #size-cells = <1>; + + cpus { + #cpus = <1>; + #address-cells = <1>; + #size-cells = <0>; + + PowerPC,8247@0 { + name="PowerPC,8247"; + device_type = "cpu"; + reg = <0>; + d-cache-line-size = <20>; // 32 bytes + i-cache-line-size = <20>; // 32 bytes + d-cache-size = <4000>; // L1, 16K + i-cache-size = <4000>; // L1, 16K + timebase-frequency = <FBC520>; + bus-frequency = <3EF1480>; + clock-frequency = <FBC5200>; + 32-bit; + }; + }; + + memory { + name="memory"; + device_type = "memory"; + reg = <0 2000000>; + }; + + soc8247@f0000000 { + #address-cells = <1>; + #size-cells = <1>; + #interrupt-cells = <2>; + device_type = "soc"; + reg = <f0000000 21000>; + serial8250@e0008000 { + #address-cells = <1>; + #size-cells = <1>; + #interrupt-cells = <1>; + device_type = "serial"; + compatible = "ns16550"; + reg = <e0008000 0000100>; + interrputs = <19>; + //bus-frequency = <BEBC200>; + clock-frequency = <E10000>; + current-speed = <1C200>; + }; + mdio@0 { + device_type = "mdio"; + compatible = "fs_enet"; + reg = <0 0>; + #address-cells = <1>; + #size-cells = <0>; + #interrupt-cells = <2>; + interrupt-parent = <&cpmpic>; + phy0: ethernet-phy@1 { + #address-cells = <0>; + #interrupt-cells = <2>; + interrupts = <14 2>; + interrupt-parent = <&cpmpic>; + bitbang = [07 07 15 00 00 01]; + bboffsets = <10d70 10d60 10d50>; + reg = <1>; + device_type = "ethernet-phy"; + }; + }; + ethernet@24000 { + #address-cells = <1>; + #size-cells = <0>; + device_type = "network"; + compatible = "fs_enet"; + device-id=<1>; + model = "FCC"; + reg = <f0011300 20 f0008400 100 f0011380 30>; + interrupts = <20 2>; + interrupt-parent = <&cpmpic>; + phy-handle = <&phy0>; + rx-clock = <a>; + tx-clock = <9>; + }; + cpm2: cpm@f0000000 { + #address-cells = <1>; + #size-cells = <1>; + device_type = "cpm"; + model = "CPM2"; + ranges = <00000000 00000000 20000>; + reg = <0 20000>; + command-proc = <119c0>; + brg-frequency = <5E69EC0>; + cpm_clk = <BCD3D80>; + compatible = "8272"; + }; + cpmpic: interrupt-controller@10c00 { + #address-cells = <0>; + #interrupt-cells = <2>; + interrupt-controller; + reg = <10c00 80>; + built-in; + device_type = "cpm-pic"; + compatible = "CPM2"; + }; + }; + + flash@ff800000 { + device_type = "rom"; + compatible = "direct-mapped"; + reg = <ff800000 800000>; /* Default (64MB) */ + probe-type = "CFI"; + bank-width = <1>; + partitions = <00000000 00200000 /* RO */ + 00200000 00700000 /* R0 */ + 00700000 00740000 /* RO */ + 00740000 00780000>; /* RO */ + partition-names = "kernel", "cramfs", "u-boot", "env"; + }; + flash@e1000000 { + device_type = "gen_nand"; + compatible = "direct-mapped"; + reg = <e1000000 1000>; + partitions = <00000000 01000000 /* RW */ + 01000000 01000000>;/* RO */ + partition-names = "IDS8247-NANDBIN", "IDS8247-NANDDATA"; + }; + chosen { + name = "chosen"; + bootargs = "root=/dev/nfs rtc-pcf8563.probe=1,0x51 rw nfsroot=192.168.30.54:/home/opt/eldk-4.1/ppc_6xx ip=192.168.30.131:192.168.30.54:192.168.30.1:255.255.255.0:ids8247:eth0:off netconsole=@/,@192.168.30.54"; + linux,platform = <0>; + linux,stdout-path = "/soc8247@f0000000/serial8250@e0008000"; + }; +};
arch/powerpc/configs/ids8247_defconfig +637 -0
637 lines not on this page · raw message
arch/powerpc/platforms/82xx/ids8247.h +52 -0
52 lines not on this page · raw message
arch/powerpc/platforms/82xx/Kconfig +13 -0
@@ -13,6 +13,19 @@ help This option enables support for the MPC8272 ADS board +config MPC82xx_IDS8247 + bool "IDS8247 based on MPC8247" + select DEFAULT_UIMAGE + select 8272 + select 8260 + select FSL_SOC + select PPC_NATIVE + select PPC_UDBG_16550 if SERIAL_8250 + select WANT_DEVICE_TREE + select MTD_NAND + help + This option enables support for the IDS8247 board + endchoice config PQ2ADS
arch/powerpc/platforms/82xx/Makefile +1 -0
@@ -3,3 +3,4 @@ # obj-$(CONFIG_PPC_82xx) += mpc82xx.o obj-$(CONFIG_MPC82xx_ADS) += mpc82xx_ads.o +obj-$(CONFIG_MPC82xx_IDS8247) += mpc8247_ids.o
arch/powerpc/platforms/82xx/mpc8247_ids.c +390 -0
390 lines not on this page · raw message
arch/powerpc/platforms/82xx/mpc82xx.c +6 -0
@@ -50,7 +50,13 @@#include <sysdev/fsl_soc.h> #include <sysdev/cpm2_pic.h> +#ifdef CONFIG_MPC82xx_ADS#include "pq2ads.h" +#endif + +#ifdef CONFIG_MPC82xx_IDS8247 +#include "ids8247.h" +#endif static int __init get_freq (char *name,unsigned long *val) {
arch/powerpc/sysdev/fsl_soc.c +19 -2
@@ -677,7 +677,7 @@if (strstr (model,"FCC" )) {int fcc_index = *id -1 ;const unsigned char *mdio_bb_prop; - +const unsigned int *bboffsets; fs_enet_data.dpram_offset = (u32 )cpm_dpram_addr (0 ); fs_enet_data.rx_ring =32 ; fs_enet_data.tx_ring =32 ;
@@ -697,6 +697,7 @@if (mdio_bb_prop) {struct platform_device *fs_enet_mdio_bb_dev;struct fs_mii_bb_platform_info fs_enet_mdio_bb_data; +struct resource phyr[1 ]; fs_enet_mdio_bb_dev = platform_device_register_simple("fsl-bb-mdio",
@@ -728,7 +729,23 @@ (u32)&cpm2_immr->im_ioport.iop_pdirc; fs_enet_mdio_bb_data.mdc_dat.offset = (u32)&cpm2_immr->im_ioport.iop_pdatc; - + + bboffsets =of_get_property (phy,"bboffsets" ,NULL ); +if ( bboffsets ) { + fs_enet_mdio_bb_data.mdio_dat.offset = + (u32)((cpm2_map_t *) cpm2_immr) + bboffsets[0 ]; + fs_enet_mdio_bb_data.mdio_dir.offset = + (u32)((cpm2_map_t *) cpm2_immr) + bboffsets[1 ]; + fs_enet_mdio_bb_data.mdc_dat.offset = + (u32)((cpm2_map_t *) cpm2_immr) + bboffsets[2 ]; + fs_enet_mdio_bb_data.irq[0 ] =-1 ; + fs_enet_mdio_bb_data.irq[1 ] = phy_irq[0 ]; + fs_enet_mdio_bb_data.irq[2 ] =-1 ; + fs_enet_mdio_bb_data.irq[3 ] =-1 ; + fs_enet_mdio_bb_data.irq[31 ] =-1 ; +of_irq_to_resource (phy,0 , &phyr[0 ]); + } + ret = platform_device_add_data( fs_enet_mdio_bb_dev, &fs_enet_mdio_bb_data,
drivers/i2c/busses/i2c-ids8247.c +203 -0
203 lines not on this page · raw message
drivers/i2c/busses/Kconfig +10 -0
@@ -267,6 +267,16 @@ This driver is deprecated and will be dropped soon. Use i2c-gpio instead. +config I2C_IDS8247 + tristate "IDS8247 Bitbanged I2C Interface" + depends on I2C && MPC82xx_IDS8247 + select I2C_ALGOBIT + help + Say Y here if you have a IDS8247 board. + + This support is also available as a module. If so, the module + will be called i2c-ids8247. + config I2C_POWERMAC tristate "Powermac I2C interface" depends on PPC_PMAC
drivers/i2c/busses/Makefile +1 -0
@@ -50,6 +50,7 @@ obj-$(CONFIG_I2C_VIA) += i2c-via.o obj-$(CONFIG_I2C_VIAPRO) += i2c-viapro.o obj-$(CONFIG_I2C_VOODOO3) += i2c-voodoo3.o +obj-$(CONFIG_I2C_IDS8247) += i2c-ids8247.o obj-$(CONFIG_SCx200_ACB) += scx200_acb.o obj-$(CONFIG_SCx200_I2C) += scx200_i2c.o
drivers/mtd/nand/plat_nand.c +1 -1
@@ -66,7 +66,7 @@ data->chip.ecc.hwctl = pdata->ctrl.hwcontrol; data->chip.ecc.layout = pdata->chip.ecclayout; data->chip.ecc.mode =NAND_ECC_SOFT ; - + data->chip.cmd_ctrl = pdata->ctrl.cmd_ctrl;platform_set_drvdata (pdev, data);/* Scan to find existance of the device */
drivers/net/fs_enet/mii-bitbang.c +4 -0
@@ -336,7 +336,11 @@ new_bus->reset = &fs_enet_mii_bb_reset, new_bus->id = pdev->id; +#ifndef CONFIG_MPC82xx_IDS8247 new_bus->phy_mask = ~0x9 ; +#else + new_bus->phy_mask = ~0x2 ; +#endif pdata = (struct fs_mii_bb_platform_info *)pdev->dev.platform_data;if (NULL == pdata) {
drivers/net/phy/Kconfig +5 -0
@@ -55,6 +55,11 @@ ---help--- Currently supports the BCM5411, BCM5421 and BCM5461 PHYs. +config MICREL_PHY + tristate "Drivers for MICREL KS8721BL PHYs" + ---help--- + Currently supports on MPC82xx_IDS8247 board. + config FIXED_PHY tristate "Drivers for PHY emulation on fixed speed/link" ---help---
drivers/net/phy/Makefile +1 -0
@@ -11,4 +11,5 @@ obj-$(CONFIG_SMSC_PHY) += smsc.o obj-$(CONFIG_VITESSE_PHY) += vitesse.o obj-$(CONFIG_BROADCOM_PHY) += broadcom.o +obj-$(CONFIG_MICREL_PHY) += micrel.o obj-$(CONFIG_FIXED_PHY) += fixed.o
drivers/net/phy/micrel.c +109 -0
109 lines not on this page · raw message
include/asm-powerpc/mpc8260.h +4 -0
@@ -19,6 +19,10 @@#include <platforms/82xx/m82xx_pci.h> #endif +#ifdef CONFIG_MPC82xx_IDS8247 +#include <platforms/82xx/ids8247.h> +#endif +#endif /* CONFIG_8260 */ #endif /* !__ASM_POWERPC_MPC8260_H__ */ #endif /* __KERNEL__ */
include/linux/i2c-id.h +1 -0
@@ -209,6 +209,7 @@/* --- MPC824x PowerPC adapters */ #define I2C_HW_MPC824X 0x100001/* Motorola 8240 / 8245 */ +#define I2C_HW_BB_MPC8247 0x100002/* */ /* --- MPC8xx PowerPC adapters */ #define I2C_HW_MPC8XX_EPON 0x110000/* Eponymous MPC8xx I2C adapter */
Quoted 1 line · Sergej Stepanov
Add support for IDS8247 board from IDS GmbH, Germany
Hi Sergej,
Please split your patch into separate mails for the actual platform support and for the device drivers.
One problem I see with the platform support is that the code is not multiplatform capable, which is a problem you apparently copy over from mpc82xx_ads. Please make sure you don't hardcode any assumptions in there which will cause problems in a combined kernel. Details follow below.
arch/powerpc/boot/dts/mpc8247ids.dts line 51
Quoted 6 lines
arch/powerpc/boot/dts/mpc8247ids.dts +6
-0+ soc8247@f0000000 { + #address-cells = <1>; + #size-cells = <1>; + #interrupt-cells = <2>; + device_type = "soc"; + reg = <f0000000 21000>;
You have some whitespace damage here, probably also elsewhere. Please use tabs for indentation everywhere.
For the soc node, I'd expect to see a ranges property that maps the local addresses into the global address space, like
ranges = <f0000000 0 10000000>;
arch/powerpc/boot/dts/mpc8247ids.dts line 102
Quoted 6 lines
arch/powerpc/boot/dts/mpc8247ids.dts +6
-0+ cpm2: cpm@f0000000 { + #address-cells = <1>; + #size-cells = <1>; + device_type = "cpm"; + model = "CPM2"; + ranges = <00000000 00000000 20000>;
this doesn't have any children, so why do you have #address-cells, #size-cells and ranges?
Quoted 5 lines
arch/powerpc/boot/dts/mpc8247ids.dts +5
-0+ reg = <0 20000>; + command-proc = <119c0>; + brg-frequency = <5E69EC0>; + cpm_clk = <BCD3D80>; + compatible = "8272";
arch/powerpc/boot/dts/mpc8247ids.dts line 117
Quoted 10 lines
arch/powerpc/boot/dts/mpc8247ids.dts +10
-0+ }; + cpmpic: interrupt-controller@10c00 { + #address-cells = <0>; + #interrupt-cells = <2>; + interrupt-controller; + reg = <10c00 80>; + built-in; + device_type = "cpm-pic"; + compatible = "CPM2"; + };
The reg property looks wrong here, unless you have a ranges property like the one I mentioned above.
Quoted 18 lines
arch/powerpc/boot/dts/mpc8247ids.dts +18
-0+ }; + + flash@ff800000 { + device_type = "rom"; + compatible = "direct-mapped"; + reg = <ff800000 800000>; /* Default (64MB) */ + probe-type = "CFI"; + bank-width = <1>; + partitions = <00000000 00200000 /* RO */ + 00200000 00700000 /* R0 */ + 00700000 00740000 /* RO */ + 00740000 00780000>; /* RO */ + partition-names = "kernel", "cramfs", "u-boot", "env"; + }; + flash@e1000000 { + device_type = "gen_nand"; + compatible = "direct-mapped"; + reg = <e1000000 1000>;
arch/powerpc/boot/dts/mpc8247ids.dts line 145
Quoted 10 lines
arch/powerpc/boot/dts/mpc8247ids.dts +10
-0+ partitions = <00000000 01000000 /* RW */ + 01000000 01000000>;/* RO */ + partition-names = "IDS8247-NANDBIN", "IDS8247-NANDDATA"; + }; + chosen { + name = "chosen"; + bootargs = "root=/dev/nfs rtc-pcf8563.probe=1,0x51 rw nfsroot=192.168.30.54:/home/opt/eldk-4.1/ppc_6xx ip=192.168.30.131:192.168.30.54:192.168.30.1:255.255.255.0:ids8247:eth0:off netconsole=@/,@192.168.30.54"; + linux,platform = <0>; + linux,stdout-path = "/soc8247@f0000000/serial8250@e0008000"; + };
You probably shouldn't encode your home directory into the bootargs if you want anyone else to be able to boot your kernel ;-)
Quoted 39 lines
diff -ruN
linux-2.6.22.1_orig/arch/powerpc/platforms/82xx/ids8247.hlinux-2.6.22.1_ids8247/arch/powerpc/platforms/82xx/ids8247.harch/powerpc/platforms/82xx/ids8247.h +35
-0@@ -0,0 +1,52 @@ +/* +* MPC8247 IDS8274 board platform setup +* +* Author: Sergej Stepanov <[email protected]> +* Copyright (c) 2007, IDS GmbH, Germany +* +* 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 __KERNEL__ +#ifndef __IDS8247_PLATFORM +#define __IDS8247_PLATFORM + + +#include <linux/seq_file.h> +#include <asm/ppcboot.h> +#include <asm/irq.h> + +#define IO_PHYS_ADDR ((uint)0xE0000000) + +#define CPM_MAP_ADDR ((uint)get_immrbase()) +#define CPM_IRQ_OFFSET 0 + +#define PHY_INTERRUPT SIU_INT_IRQ2 + +/* For our show_cpuinfo hooks. */ +#define CPUINFO_VENDOR "Freescale Semiconductor" +#define CPUINFO_MACHINE "IDS8247 PowerPC Port by IDS GmbH" + +/* some info stuff */ +#define BOOTROM_RESTART_ADDR ((uint)0xFFF00104) + +#define I2C_ADDR_RTC 0x51
arch/powerpc/platforms/82xx/ids8247.h line 45
Quoted 10 lines
arch/powerpc/platforms/82xx/ids8247.h +10
-0+#define CFG_NAND_BASE 0xE1000000 +#define IDS8247_UART_BASE 0xE0008000 +#define RS_TABLE_SIZE 1 +#define BASE_BAUD 115200 +#define IDS8247UARTIRQ SIU_INT_IRQ7 +#define SERIAL_PORT_DFNS \ + { 0, 14745600, 0, IDS8247UARTIRQ, \ + ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST, \ + iomem_base: (unsigned char *) 0xE0008000, \ + io_type: SERIAL_IO_MEM},
All these definitions are put into the global name space, which you shouldn't do for board specific stuff. First, remove all those that are not even used. If you have any constants left, give them a IDS8247_ prefix and change the users.
Addresses and interrupt numbers should be read from the device tree, not hardcoded in the source.
arch/powerpc/platforms/82xx/ids8247.h line 48
Quoted 1 line
arch/powerpc/platforms/82xx/ids8247.h +1
-0+void m82xx_calibrate_decr (void );
This should be in a generic header file
arch/powerpc/platforms/82xx/ids8247.h line 49
Quoted 1 line
arch/powerpc/platforms/82xx/ids8247.h +1
-0+void mpc82xx_ads_show_cpuinfo (struct seq_file *);
and this one looks wrong as well. you probably should move that function to a shared file and declare it in a generic header.
Quoted 13 lines
arch/powerpc/platforms/82xx/ids8247.h +2
-0+#endif /* __IDS8274_PLATFORM */ +#endif /* __KERNEL__ */ diff -ruN linux-2.6.22.1_orig/arch/powerpc/platforms/82xx/Kconfig linux-2.6.22.1_ids8247/arch/powerpc/platforms/82xx/Kconfig
arch/powerpc/platforms/82xx/Kconfig +4
-0@@ -13,6 +13,19 @@ help This option enables support for the MPC8272 ADS board +config MPC82xx_IDS8247 + bool "IDS8247 based on MPC8247" + select DEFAULT_UIMAGE + select 8272
arch/powerpc/platforms/82xx/Kconfig line 29
Quoted 10 lines
arch/powerpc/platforms/82xx/Kconfig +9
-0+ select 8260 + select FSL_SOC + select PPC_NATIVE + select PPC_UDBG_16550 if SERIAL_8250 + select WANT_DEVICE_TREE + select MTD_NAND + help + This option enables support for the IDS8247 board + endchoice
Why select 8272 and 8260 here? they are obviously not the CPUs you are using.
MTD_NAND should also not be autoselected, afaics.
arch/powerpc/platforms/82xx/Kconfig
Quoted 3 lines
arch/powerpc/platforms/82xx/Kconfig +3
-0+ +#include <sysdev/fsl_soc.h> +#include <../sysdev/cpm2_pic.h>
the '..' in there is not needed.
arch/powerpc/platforms/82xx/Kconfig
Quoted 6 lines
arch/powerpc/platforms/82xx/Kconfig +6
-0+#include "ids8247.h" + +/* FCC1 Clock Source Configuration. These can be redefined in the board specific file. + Can only choose from CLK9-10 */ +#define F1_RXCLK 10 +#define F1_TXCLK 9
if they are board specific, they should probably be in the device tree.
arch/powerpc/platforms/82xx/Kconfig
Quoted 7 lines
arch/powerpc/platforms/82xx/Kconfig +7
-0+/* + Callback function from fs_enet driver. +*/ +void init_fcc_ioports(struct fs_platform_info *fpi) +{ + int fcc_no = fs_get_fcc_index(fpi->fs_no); + struct io_port *io;
should probably be __iomem.
arch/powerpc/platforms/82xx/Kconfig
Quoted 8 lines
arch/powerpc/platforms/82xx/Kconfig +8
-0+/* + General board setup +*/ +int __init m82xx_board_setup( void) +{ + struct device_node *np; + struct io_port *io; + io = &((cpm2_map_t *) cpm2_immr)->im_ioport;
same here
arch/powerpc/platforms/82xx/Kconfig
Quoted 6 lines
arch/powerpc/platforms/82xx/Kconfig +6
-0+ np = of_find_node_by_type(NULL, "memory"); + if (!np) { + printk(KERN_INFO "No memory node in device tree\n"); + return 1; + } + of_node_put(np);
without a memory node, you probably don't even get here ;-)
arch/powerpc/platforms/82xx/Kconfig
Quoted 5 lines
arch/powerpc/platforms/82xx/Kconfig +5
-0+ +static int __init mpc8247_ids_probe(void) +{ + return 1; +}
needs to check the "compatible" property in the root device, otherwise you misdetect the board in a multiplatform kernel.
Quoted 5 lines
arch/powerpc/platforms/82xx/Kconfig +5
-0+/* Copied from mpc82xx_ads.c */ +#define RMR_CSRE 0x00000001 +static void m82xx_restart(char *cmd) +{ + __volatile__ unsigned char dummy;
arch/powerpc/platforms/82xx/Kconfig
Quoted 10 lines
arch/powerpc/platforms/82xx/Kconfig +10
-0+ + local_irq_disable(); + ((cpm2_map_t *) cpm2_immr)->im_clkrst.car_rmr |= RMR_CSRE; + + /* Clear the ME,EE,IR & DR bits in MSR to cause checkstop */ + mtmsr(mfmsr() & ~(MSR_ME | MSR_EE | MSR_IR | MSR_DR)); + dummy = ((cpm2_map_t *) cpm2_immr)->im_clkrst.res[0]; + printk("Restart failed\n"); + while (1) ; +}
please make this is global function that is shared between all platforms that want it. It's broken in multiple ways, but we should better have to fix it only once.
arch/powerpc/platforms/82xx/Kconfig
Quoted 6 lines
arch/powerpc/platforms/82xx/Kconfig +6
-0+/* Copied from mpc82xx_ads.c */ +static void m82xx_halt(void) +{ + local_irq_disable(); + while (1) ; +}
better put a cpu_relax() or similar in the loop.
Quoted 20 lines
arch/powerpc/platforms/82xx/Kconfig +20
-0+#ifdef CONFIG_MTD_PHYSMAP +/* + TODO: the table has to be build in physmap_of +*/ +static struct mtd_partition ids8247_cramfs_partitions[] = { + { + .name = "kernel", + .size = 0x200000, + .offset = 0, + .mask_flags = 0, + }, + { + .name = "cramfs", + .offset = 0x200000, + .size = 0x500000, + .mask_flags = 0, + }, + { + .name = "u-boot", + .offset = 0x700000,
arch/powerpc/platforms/82xx/Kconfig
Quoted 10 lines
arch/powerpc/platforms/82xx/Kconfig +10
-0+ .size = 0x40000, + .mask_flags = 0, + }, + { + .name = "env", + .offset = 0x740000, + .size = 0x40000, + .mask_flags = 0, + } +};
don't you have the same information in the device tree already? Better read it from there so you only have to change it in one place if the layout changes.
That will also help to consolidate the code with the other platforms that have a physmap in the device tree.
Quoted 10 lines
arch/powerpc/platforms/82xx/Kconfig +10
-0+static void mpc82xx_ids8247_nandhwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl) +{ + struct nand_chip *chip = mtd->priv; + if( ctrl & NAND_CTRL_CHANGE) { + ctrl &= ~NAND_CTRL_CHANGE; + switch( ctrl ) + { + case NAND_CTRL_CLE: + *(((volatile __u8 *) chip->IO_ADDR_W) + 0xa) = 0; + break;
arch/powerpc/platforms/82xx/Kconfig
Quoted 10 lines
arch/powerpc/platforms/82xx/Kconfig +10
-0+ case NAND_CTRL_ALE: + *(((volatile __u8 *) chip->IO_ADDR_W) + 0x9) = 0; + break; + case NAND_NCE: + *(((volatile __u8 *) chip->IO_ADDR_W) + 0x8) = 0; + break; + default: + *(((volatile __u8 *) chip->IO_ADDR_W) + 0xc) = 0; + } + }
Use out_8 here, instead of writing to a volatile pointer.
arch/powerpc/platforms/82xx/Kconfig
Quoted 10 lines
arch/powerpc/platforms/82xx/Kconfig +10
-0+ if (cmd != NAND_CMD_NONE) + out_8(chip->IO_ADDR_W, (char)cmd); +} +error: + of_node_put(np); + kfree(pdata); + platform_device_unregister(nanddevice); + return ret; + +}
whitespace damaged.
Quoted 14 lines
arch/powerpc/platforms/82xx/Kconfig +14
-0+static int __init mpc82xx_ids8247_i2c_setup(void) +{ + int ret = 0; + struct platform_device *i2c_dev; + struct fsl_i2c_platform_data i2c_data; + + i2c_data.device_flags = 0; + i2c_dev = platform_device_register_simple("bb-i2c", 0, NULL, 0); + if (IS_ERR(i2c_dev)) { + ret = PTR_ERR(i2c_dev); + return ret; + } + ret = platform_device_add_data(i2c_dev, + &i2c_data,
arch/powerpc/platforms/82xx/Kconfig
Quoted 10 lines
arch/powerpc/platforms/82xx/Kconfig +10
-0+ sizeof(struct fsl_i2c_platform_data)); + if(ret) + { + platform_device_unregister(i2c_dev); + return ret; + } + + return 0; +} +arch_initcall(mpc82xx_ids8247_i2c_setup);
Why not make this an of_platform_driver? That would avoid having to split the driver to two files, and be cleaner in general.
Quoted 5 lines
diff -ruN
linux-2.6.22.1_orig/arch/powerpc/platforms/82xx/mpc82xx.clinux-2.6.22.1_ids8247/arch/powerpc/platforms/82xx/mpc82xx.carch/powerpc/platforms/82xx/mpc82xx.c +0
-0@@ -50,7 +50,13 @@#include <sysdev/fsl_soc.h>
arch/powerpc/platforms/82xx/mpc82xx.c line 60
Quoted 10 lines
arch/powerpc/platforms/82xx/mpc82xx.c +6
-0#include <sysdev/cpm2_pic.h> +#ifdef CONFIG_MPC82xx_ADS#include "pq2ads.h" +#endif + +#ifdef CONFIG_MPC82xx_IDS8247 +#include "ids8247.h" +#endif
This doesn't fly. You have to define the headers in a way that you can include them concurrently in order to allow multiplatform builds.
Quoted 5 lines
diff -ruN
linux-2.6.22.1_orig/drivers/net/fs_enet/mii-bitbang.clinux-2.6.22.1_ids8247/drivers/net/fs_enet/mii-bitbang.cdrivers/net/fs_enet/mii-bitbang.c +0
-0@@ -336,7 +336,11 @@ new_bus->reset = &fs_enet_mii_bb_reset,
drivers/net/fs_enet/mii-bitbang.c line 346
Quoted 10 lines
drivers/net/fs_enet/mii-bitbang.c +4
-0new_bus->id = pdev->id; +#ifndef CONFIG_MPC82xx_IDS8247 new_bus->phy_mask = ~0x9 ; +#else + new_bus->phy_mask = ~0x2 ; +#endif pdata = (struct fs_mii_bb_platform_info *)pdev->dev.platform_data;if (NULL == pdata) {
Same here, this should be read from the device tree so you don't need to hardcode it based on CONFIG symbols.
Quoted 4 lines
diff -ruN
linux-2.6.22.1_orig/include/asm-powerpc/mpc8260.hlinux-2.6.22.1_ids8247/include/asm-powerpc/mpc8260.h
include/asm-powerpc/mpc8260.h line 28
Quoted 10 lines
include/asm-powerpc/mpc8260.h +4
-0@@ -19,6 +19,10 @@#include <platforms/82xx/m82xx_pci.h> #endif +#ifdef CONFIG_MPC82xx_IDS8247 +#include <platforms/82xx/ids8247.h> +#endif +#endif /* CONFIG_8260 */ #endif /* !__ASM_POWERPC_MPC8260_H__ */ #endif /* __KERNEL__ */
And finally, same problem here.
Arnd <><