Re: [PATCH] i2c: remove casting dma_alloc
From: Vasyl Generated by: alloc_cast.cocci Signed-off-by: Vasyl Acked-by: Jochen Friedrich --- drivers/i2c/busses/i2c-cpm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c index 187900594e3d..1213e1932ccb 100644 --- a/drivers/i2c/busses/i2c-cpm.c +++ b/drivers/i2c/busses/i2c-cpm.c @@ -531,7 +531,9 @@ static int cpm_i2c_setup(struct cpm_i2c *cpm) } out_be32(&rbdf[i].cbd_bufaddr, ((cpm->rxdma[i] + 1) & ~1)); - cpm->txbuf[i] = (unsigned char *)dma_alloc_coherent(&cpm->ofdev->dev, CPM_MAX_READ + 1, &cpm->txdma[i], GFP_KERNEL); + cpm->txbuf[i] = dma_alloc_coherent(&cpm->ofdev->dev, + CPM_MAX_READ + 1, + &cpm->txdma[i], GFP_KERNEL); if (!cpm->txbuf[i]) { ret = -ENOMEM; goto out_muram;
Re: [PATCHv4 2.6.25] i2c: adds support for i2c bus on Freescale CPM1/CPM2 controllers
Hi Olof, > And even if you DO decide to go that route, guess what? You need a > translation table just as with (3) anyway! True. 3. use a glue layer with a translation map. >>> In my opinion this is an OK solution since the same information has to >>> be added somewhere already anyway -- eiither to the drivers or to this >>> translation table. It should of course be an abstacted shared table, >>> preferrably contained under the i2c source directories since several >>> platforms and architectures might share them. >> I could think of a mixture between 2. and 3.: >> >> Using the compatible attribute with the manufacturer stripped off as I2c >> name by default >> and using an exception table. For now, the struct i2c_driver_device would >> currently only >> need one entry ("dallas,ds1374", "rtc-ds1374"). > > You still need the translation table, you're just flattening the > namespace to one string instead of two, the same information still has > to be encoded. I can't see what the benefit of this approach compared to > the other one is. "dallas,ds1374" already only has one translation entry > in the table? As soon as http://lists.lm-sensors.org/pipermail/i2c/2008-January/002752.html has been applied, one could get rid of all entries where the I2c (alias) name can be obtained from the OF name just by stripping the manufacturer. Thanks, Jochen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCHv4 2.6.25] i2c: adds support for i2c bus on Freescale CPM1/CPM2 controllers
Hi Olof, >> 2. record the I2c name in the dts tree, either as seperate tag (like >> linux,i2c-name="") >>or as additional compatible entry (like compatible="...", >> "linux,"). > > I have to say no on this one. The device tree is not supposed to know > about how linux uses devices, there are firmwares out there that don't > use DTS for thier device trees, etc. I still believe this this could be done for embedded devices which are usually booted via wrapper or U-Boot as those devices will most probably use the most exotic I2c devices out there (e.g. home-grown devices used by stbs). However, I'm not an device tree expert. >> 3. use a glue layer with a translation map. > > In my opinion this is an OK solution since the same information has to > be added somewhere already anyway -- eiither to the drivers or to this > translation table. It should of course be an abstacted shared table, > preferrably contained under the i2c source directories since several > platforms and architectures might share them. I could think of a mixture between 2. and 3.: Using the compatible attribute with the manufacturer stripped off as I2c name by default and using an exception table. For now, the struct i2c_driver_device would currently only need one entry ("dallas,ds1374", "rtc-ds1374"). Thanks, Jochen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCHv4 2.6.25] i2c: adds support for i2c bus on Freescale CPM1/CPM2 controllers
Hi Jean, >> +/* >> + * Wait for patch from Jon Smirl >> + * #include "powerpc-common.h" >> + */ > > It doesn't make sense to merge this comment upstream. I know you don't like the patch from Jon Smirl and you also explained your reasons. Fortunately, I2c no longer uses numeric device IDs but names. So what are the alternatives? 1. modify the I2c subsystem to accept OF names additionally to I2c names (proposed by Jon smirl). 2. record the I2c name in the dts tree, either as seperate tag (like linux,i2c-name="") or as additional compatible entry (like compatible="...", "linux,"). 3. use a glue layer with a translation map. What is the preferred way to do this? Thanks, Jochen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCHv4 2.6.25] i2c: adds support for i2c bus on Freescale CPM1/CPM2 controllers
Using the port of 2.4 code from Vitaly Bordug <[EMAIL PROTECTED]> and the actual algorithm used by the i2c driver of the DBox code on cvs.tuxboc.org from Tmbinc, Gillem ([EMAIL PROTECTED]). Renamed i2c-rpx.c and i2c-algo-8xx.c to i2c-cpm.c and converted the driver to an of_platform_driver. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- drivers/i2c/busses/Kconfig | 10 + drivers/i2c/busses/Makefile |1 + drivers/i2c/busses/i2c-cpm.c | 759 ++ 3 files changed, 770 insertions(+), 0 deletions(-) create mode 100644 drivers/i2c/busses/i2c-cpm.c diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index b61f56b..1d18db7 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig @@ -114,6 +114,16 @@ config I2C_BLACKFIN_TWI_CLK_KHZ help The unit of the TWI clock is kHz. +config I2C_CPM + tristate "Freescale CPM1 or CPM2 (MPC8xx/826x)" + depends on (CPM1 || CPM2) && I2C && PPC_OF + help + This supports the use of the I2C interface on Freescale + processors with CPM1 or CPM2. + + This driver can also be built as a module. If so, the module + will be called i2c-cpm. + config I2C_DAVINCI tristate "DaVinci I2C driver" depends on ARCH_DAVINCI diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile index ea7068f..1291e2b 100644 --- a/drivers/i2c/busses/Makefile +++ b/drivers/i2c/busses/Makefile @@ -11,6 +11,7 @@ obj-$(CONFIG_I2C_AMD8111) += i2c-amd8111.o obj-$(CONFIG_I2C_AT91) += i2c-at91.o obj-$(CONFIG_I2C_AU1550) += i2c-au1550.o obj-$(CONFIG_I2C_BLACKFIN_TWI) += i2c-bfin-twi.o +obj-$(CONFIG_I2C_CPM) += i2c-cpm.o obj-$(CONFIG_I2C_DAVINCI) += i2c-davinci.o obj-$(CONFIG_I2C_ELEKTOR) += i2c-elektor.o obj-$(CONFIG_I2C_GPIO) += i2c-gpio.o diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c new file mode 100644 index 000..7191427 --- /dev/null +++ b/drivers/i2c/busses/i2c-cpm.c @@ -0,0 +1,759 @@ +/* + * Freescale CPM1/CPM2 I2C interface. + * Copyright (c) 1999 Dan Malek ([EMAIL PROTECTED]). + * + * moved into proper i2c interface; + * Brad Parker ([EMAIL PROTECTED]) + * + * (C) 2007 Montavista Software, Inc. + * Vitaly Bordug <[EMAIL PROTECTED]> + * + * RPX lite specific parts of the i2c interface + * Update: There actually isn't anything RPXLite-specific about this module. + * This should work for most any CPM board. The console messages have been + * changed to eliminate RPXLite references. + * +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 program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * moved into proper i2c interface; separated out platform specific + * parts into i2c-8xx.c + * Brad Parker ([EMAIL PROTECTED]) + * + * Parts from dbox2_i2c.c (cvs.tuxbox.org) + * (C) 2000-2001 Tmbinc, Gillem ([EMAIL PROTECTED]) + * + * (C) 2007 Montavista Software, Inc. + * Vitaly Bordug <[EMAIL PROTECTED]> + * + * Converted to of_platform_device. Renamed to i2c-cpm.c. + * (C) 2007 Jochen Friedrich <[EMAIL PROTECTED]> + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Wait for patch from Jon Smirl + * #include "powerpc-common.h" + */ + +/* Try to define this if you have an older CPU (earlier than rev D4) */ +/* However, better use a GPIO based bitbang driver in this case :/ */ +#undef I2C_CHIP_ERRATA + +#define CPM_MAX_READ513 +#define CPM_MAXBD 4 + +#define CPM_CR_INIT_TRX(0x00) +#define CPM_CR_CLOSE_RXBD (0x07) + +#define I2C_EB (0x10) /* Big endian mode */ + +/* I2C parameter RAM. */ +struct i2c_ram { + ushort rbase; /* Rx Buffer descriptor base address */ + ushort tbase; /* Tx Buffer descriptor base address */ + u_char rfcr; /* Rx function code */ + u_char tfcr; /* Tx function code */ + ushort mrblr; /* Max receive buffer length */ + uintrstate; /* Internal */ + uintrdp;/* Internal */ + ushort rbptr; /* Rx Buffer descripto
Re: [PATCHv3 2.6.25] i2c: adds support for i2c bus on Freescale CPM1/CPM2 controllers
Hi Bryan, >> + >> + /* register new adapter to i2c module... */ >> + >> + result = i2c_add_adapter(&cpm->adap); > > As I was pointed before, please use the new style i2c driver interface: > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=991dee591a99d035796a8c194eb1796cc020e142 AFAIK, the device tree currently doesn't provide an adapter id. If we're going to add this property, this would be needed on other of_platform i2c drivers, as well. Thanks, Jochen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCHv3 2.6.25] i2c: adds support for i2c bus on Freescale CPM1/CPM2 controllers
Using the port of 2.4 code from Vitaly Bordug <[EMAIL PROTECTED]> and the actual algorithm used by the i2c driver of the DBox code on cvs.tuxboc.org from Tmbinc, Gillem ([EMAIL PROTECTED]). Renamed i2c-rpx.c and i2c-algo-8xx.c to i2c-cpm.c and converted the driver to an of_platform_driver. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/boot/dts/mpc8272ads.dts | 10 + arch/powerpc/boot/dts/mpc866ads.dts | 10 + arch/powerpc/boot/dts/mpc885ads.dts | 10 + arch/powerpc/platforms/8xx/mpc885ads_setup.c |5 + drivers/i2c/busses/Kconfig | 10 + drivers/i2c/busses/Makefile |1 + drivers/i2c/busses/i2c-cpm.c | 759 ++ 7 files changed, 805 insertions(+), 0 deletions(-) create mode 100644 drivers/i2c/busses/i2c-cpm.c diff --git a/arch/powerpc/boot/dts/mpc8272ads.dts b/arch/powerpc/boot/dts/mpc8272ads.dts index 7285ca1..7273996 100644 --- a/arch/powerpc/boot/dts/mpc8272ads.dts +++ b/arch/powerpc/boot/dts/mpc8272ads.dts @@ -215,6 +215,16 @@ linux,network-index = <1>; fsl,cpm-command = <16200300>; }; + + [EMAIL PROTECTED] { + compatible = "fsl,mpc8248-i2c", +"fsl,cpm2-i2c", +"fsl,cpm-i2c"; + reg = <11860 20 8afc 2>; + interrupts = <1 8>; + interrupt-parent = <&PIC>; + fsl,cpm-command = <2960>; + }; }; PIC: [EMAIL PROTECTED] { diff --git a/arch/powerpc/boot/dts/mpc866ads.dts b/arch/powerpc/boot/dts/mpc866ads.dts index daf9433..80c08bf 100644 --- a/arch/powerpc/boot/dts/mpc866ads.dts +++ b/arch/powerpc/boot/dts/mpc866ads.dts @@ -169,6 +169,16 @@ fsl,cpm-command = <>; linux,network-index = <1>; }; + + [EMAIL PROTECTED] { + compatible = "fsl,mpc866-i2c", +"fsl,cpm1-i2c", +"fsl,cpm-i2c"; + reg = <860 20 3c80 30>; + interrupts = <10 3>; + interrupt-parent = <&Cpm_pic>; + fsl,cpm-command = <0010>; + }; }; }; diff --git a/arch/powerpc/boot/dts/mpc885ads.dts b/arch/powerpc/boot/dts/mpc885ads.dts index 8848e63..fd9c9d7 100644 --- a/arch/powerpc/boot/dts/mpc885ads.dts +++ b/arch/powerpc/boot/dts/mpc885ads.dts @@ -213,6 +213,16 @@ fsl,cpm-command = <0080>; linux,network-index = <2>; }; + + [EMAIL PROTECTED] { + compatible = "fsl,mpc885-i2c", +"fsl,cpm1-i2c", +"fsl,cpm-i2c"; + reg = <860 20 3c80 30>; + interrupts = <10>; + interrupt-parent = <&CPM_PIC>; + fsl,cpm-command = <0010>; + }; }; }; diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c index f39447b..1e7d056 100644 --- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c @@ -157,6 +157,11 @@ static struct cpm_pin mpc885ads_pins[] = { {CPM_PORTE, 28, CPM_PIN_OUTPUT}, {CPM_PORTE, 29, CPM_PIN_OUTPUT}, #endif + /* I2C */ +#ifdef CONFIG_I2C_8XX + {CPM_PORTB, 26, CPM_PIN_INPUT | CPM_PIN_OPENDRAIN}, + {CPM_PORTB, 27, CPM_PIN_INPUT | CPM_PIN_OPENDRAIN}, +#endif }; static void __init init_ioports(void) diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index c466c6c..5950172 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig @@ -114,6 +114,16 @@ config I2C_BLACKFIN_TWI_CLK_KHZ help The unit of the TWI clock is kHz. +config I2C_CPM + tristate "Freescale CPM1 or CPM2 (MPC8xx/826x)" + depends on (CPM1 || CPM2) && I2C && PPC_OF + help + This supports the use of the I2C interface on Freescale + processors with CPM1 or CPM2. + + This driver can also be built as a module. If so, the mod
Re: [PATCH] [NET]: Remove PowerPC code from fec.c
Hi Frans, > Jochen Friedrich wrote: >> +++ b/drivers/net/fec.c >> @@ -23,6 +23,9 @@ >> * >> * Bug fixes and cleanup by Philippe De Muyter ([EMAIL PROTECTED]) >> * Copyright (c) 2004-2006 Macq Electronique SA. >> + * >> + * This driver is now only used on ColdFire processors. Remove conditional >> + * Powerpc code. >> */ > > This comment makes sense for a changelog, but IMO it makes no sense at all > to add it to the file. I just added it to clarify this code is now only used on m68knommu (Coldfire). The comments on top are mailny about MPC860T CPUs (PowerPC), however the driver is no longer used for these CPUs. Maybe the wording should be changed to: This driver is now only used on ColdFire (m68knommu) processors. Conditional PowerPC code has been removed. Thanks, Jochen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] [NET]: Remove PowerPC code from fec.c
fec.c is only used on M68k Coldfire CPUs. Remove leftover PowerPC code from this driver. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- drivers/net/fec.c | 136 +--- 1 files changed, 3 insertions(+), 133 deletions(-) diff --git a/drivers/net/fec.c b/drivers/net/fec.c index 0fbf1bb..0499cbb 100644 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c @@ -23,6 +23,9 @@ * * Bug fixes and cleanup by Philippe De Muyter ([EMAIL PROTECTED]) * Copyright (c) 2004-2006 Macq Electronique SA. + * + * This driver is now only used on ColdFire processors. Remove conditional + * Powerpc code. */ #include @@ -49,17 +52,9 @@ #include #include -#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || \ -defined(CONFIG_M5272) || defined(CONFIG_M528x) || \ -defined(CONFIG_M520x) || defined(CONFIG_M532x) #include #include #include "fec.h" -#else -#include -#include -#include "commproc.h" -#endif #if defined(CONFIG_FEC2) #defineFEC_MAX_PORTS 2 @@ -1223,14 +1218,9 @@ static phy_info_t const * const phy_info[] = { /* - */ #if !defined(CONFIG_M532x) -#ifdef CONFIG_RPXCLASSIC -static void -mii_link_interrupt(void *dev_id); -#else static irqreturn_t mii_link_interrupt(int irq, void * dev_id); #endif -#endif #if defined(CONFIG_M5272) /* @@ -1800,121 +1790,6 @@ static void __inline__ fec_uncache(unsigned long addr) /* - */ -#else - -/* - * Code specific to the MPC860T setup. - */ -static void __inline__ fec_request_intrs(struct net_device *dev) -{ - volatile immap_t *immap; - - immap = (immap_t *)IMAP_ADDR; /* pointer to internal registers */ - - if (request_8xxirq(FEC_INTERRUPT, fec_enet_interrupt, 0, "fec", dev) != 0) - panic("Could not allocate FEC IRQ!"); - -#ifdef CONFIG_RPXCLASSIC - /* Make Port C, bit 15 an input that causes interrupts. - */ - immap->im_ioport.iop_pcpar &= ~0x0001; - immap->im_ioport.iop_pcdir &= ~0x0001; - immap->im_ioport.iop_pcso &= ~0x0001; - immap->im_ioport.iop_pcint |= 0x0001; - cpm_install_handler(CPMVEC_PIO_PC15, mii_link_interrupt, dev); - - /* Make LEDS reflect Link status. - */ - *((uint *) RPX_CSR_ADDR) &= ~BCSR2_FETHLEDMODE; -#endif -#ifdef CONFIG_FADS - if (request_8xxirq(SIU_IRQ2, mii_link_interrupt, 0, "mii", dev) != 0) - panic("Could not allocate MII IRQ!"); -#endif -} - -static void __inline__ fec_get_mac(struct net_device *dev) -{ - bd_t *bd; - - bd = (bd_t *)__res; - memcpy(dev->dev_addr, bd->bi_enetaddr, ETH_ALEN); - -#ifdef CONFIG_RPXCLASSIC - /* The Embedded Planet boards have only one MAC address in -* the EEPROM, but can have two Ethernet ports. For the -* FEC port, we create another address by setting one of -* the address bits above something that would have (up to -* now) been allocated. -*/ - dev->dev_adrd[3] |= 0x80; -#endif -} - -static void __inline__ fec_set_mii(struct net_device *dev, struct fec_enet_private *fep) -{ - extern uint _get_IMMR(void); - volatile immap_t *immap; - volatile fec_t *fecp; - - fecp = fep->hwp; - immap = (immap_t *)IMAP_ADDR; /* pointer to internal registers */ - - /* Configure all of port D for MII. - */ - immap->im_ioport.iop_pdpar = 0x1fff; - - /* Bits moved from Rev. D onward. - */ - if ((_get_IMMR() & 0x) < 0x0501) - immap->im_ioport.iop_pddir = 0x1c58;/* Pre rev. D */ - else - immap->im_ioport.iop_pddir = 0x1fff;/* Rev. D and later */ - - /* Set MII speed to 2.5 MHz - */ - fecp->fec_mii_speed = fep->phy_speed = - ((bd->bi_busfreq * 100) / 250) & 0x7e; -} - -static void __inline__ fec_enable_phy_intr(void) -{ - volatile fec_t *fecp; - - fecp = fep->hwp; - - /* Enable MII command finished interrupt - */ - fecp->fec_ivec = (FEC_INTERRUPT/2) << 29; -} - -static void __inline__ fec_disable_phy_intr(void) -{ -} - -static void __inline__ fec_phy_ack_intr(void) -{ -} - -static void __inline__ fec_localhw_setup(void) -{ - volatile fec_t *fecp; - - fecp = fep->hwp; - fecp->fec_r_hash = PKT_MAXBUF_SIZE; - /* Enable big endian and don't care about SDMA FC. - */ - fecp->fec_fun_code = 0x7800; -} - -static void __inline__ fec_uncache(unsigned long addr) -{ - pte_t *pte; - pte = va_to_pte(mem_addr); - pte_val(*pte) |= _PAGE_NO_CACHE; - flush_tlb_page(init_mm.mmap, mem_addr); -} - #endif /* --
[PATCH for-2.6.25] [POWERPC] Rename commproc to cpm1 and cpm2_common.c to cpm2.c
Rename commproc.[ch] to cpm1.[ch] to be more consistent with cpm2. Also rename cpm2_common.c to cpm2.c as suggested by Scott Wood. Adjust the includes accordingly. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/platforms/8xx/ep88xc.c |1 + arch/powerpc/platforms/8xx/mpc86xads_setup.c |2 +- arch/powerpc/platforms/8xx/mpc885ads_setup.c |2 +- arch/powerpc/sysdev/Makefile |4 ++-- arch/powerpc/sysdev/{commproc.c => cpm1.c}|4 ++-- arch/powerpc/sysdev/{cpm2_common.c => cpm2.c} |3 +-- arch/powerpc/sysdev/micropatch.c |2 +- arch/ppc/8260_io/enet.c |2 +- arch/ppc/8xx_io/commproc.c|2 +- arch/ppc/8xx_io/enet.c|6 +++--- arch/ppc/8xx_io/fec.c |2 +- arch/ppc/8xx_io/micropatch.c |2 +- arch/ppc/boot/simple/iic.c|2 +- arch/ppc/boot/simple/m8xx_tty.c |2 +- arch/ppc/kernel/ppc_ksyms.c |2 +- arch/ppc/platforms/mpc866ads_setup.c |2 +- arch/ppc/platforms/mpc885ads_setup.c |2 +- arch/ppc/syslib/mpc8xx_devices.c |2 +- arch/ppc/xmon/start_8xx.c |2 +- drivers/net/fec_8xx/fec_8xx-netta.c |2 +- drivers/net/fec_8xx/fec_main.c|2 +- drivers/net/fec_8xx/fec_mii.c |2 +- drivers/net/fs_enet/fs_enet.h |2 +- drivers/net/fs_enet/mac-fec.c |2 +- drivers/net/fs_enet/mac-scc.c |2 +- drivers/serial/cpm_uart/cpm_uart_cpm1.h |2 +- include/asm-powerpc/{commproc.h => cpm1.h}|8 include/asm-ppc/{commproc.h => cpm1.h}|8 28 files changed, 38 insertions(+), 38 deletions(-) rename arch/powerpc/sysdev/{commproc.c => cpm1.c} (99%) rename arch/powerpc/sysdev/{cpm2_common.c => cpm2.c} (99%) rename include/asm-powerpc/{commproc.h => cpm1.h} (99%) rename include/asm-ppc/{commproc.h => cpm1.h} (99%) diff --git a/arch/powerpc/platforms/8xx/ep88xc.c b/arch/powerpc/platforms/8xx/ep88xc.c index 4897eda..a8dffa0 100644 --- a/arch/powerpc/platforms/8xx/ep88xc.c +++ b/arch/powerpc/platforms/8xx/ep88xc.c @@ -16,6 +16,7 @@ #include #include #include +#include #include "mpc8xx.h" diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c b/arch/powerpc/platforms/8xx/mpc86xads_setup.c index c0dda53..c028a5b 100644 --- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c index 3be115e..6e7ded0 100644 --- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile index f17e7b8..928d75b 100644 --- a/arch/powerpc/sysdev/Makefile +++ b/arch/powerpc/sysdev/Makefile @@ -36,8 +36,8 @@ endif # Temporary hack until we have migrated to asm-powerpc ifeq ($(ARCH),powerpc) obj-$(CONFIG_CPM) += cpm_common.o -obj-$(CONFIG_CPM2) += cpm2_common.o cpm2_pic.o +obj-$(CONFIG_CPM2) += cpm2.o cpm2_pic.o obj-$(CONFIG_PPC_DCR) += dcr.o -obj-$(CONFIG_8xx) += mpc8xx_pic.o commproc.o +obj-$(CONFIG_8xx) += mpc8xx_pic.o cpm1.o obj-$(CONFIG_UCODE_PATCH) += micropatch.o endif diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/cpm1.c similarity index 99% rename from arch/powerpc/sysdev/commproc.c rename to arch/powerpc/sysdev/cpm1.c index ef82587..df8bd2b 100644 --- a/arch/powerpc/sysdev/commproc.c +++ b/arch/powerpc/sysdev/cpm1.c @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include @@ -290,7 +290,7 @@ cpm_setbrg(uint brg, uint rate) out_be32(bp, (((BRG_UART_CLK / rate) - 1) << 1) | CPM_BRG_EN); else out_be32(bp, (((BRG_UART_CLK_DIV16 / rate) - 1) << 1) | -CPM_BRG_EN | CPM_BRG_DIV16); + CPM_BRG_EN | CPM_BRG_DIV16); } #ifndef CONFIG_PPC_CPM_NEW_BINDING diff --git a/arch/powerpc/sysdev/cpm2_common.c b/arch/powerpc/sysdev/cpm2.c similarity index 99% rename from arch/powerpc/sysdev/cpm2_common.c rename to arch/powerpc/sysdev/cpm2.c index f7188e2..7be7112 100644 --- a/arch/powerpc/sysdev/cpm2_common.c +++ b/arch/powerpc/sysdev/cpm2.c @@ -153,8 +153,7 @@ cpm2_fastbrg(uint brg, uint rate, int div16) if (brg < 4) { bp = cpm2_map_size(im_brgc1, 16); - } - else { + }
Re: [PATCHv3 6/7] [POWERPC] Rename commproc to cpm1 and cpm2_common.c to cpm2.c
Hi Kumar, >> drivers/net/fec.c |8 >> drivers/net/fec.h |2 +- > > asm-m68knommu/commproc.h ?? these are only built on coldfire. Yes. Here I just removed dead code (commented out using #ifdef on coldfire). Apparently the driver was used on MPC8xx before or was copied from there but never cleaned up? Maybe this should be a seperate patch? >> drivers/serial/68360serial.c |2 +- > > I think this is using asm-m68knommu/commproc.h Oops, that one slipped through :-/. Thanks, Jochen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCHv3 7/7] [POWERPC] Move definition of buffer descriptor to cpm.h
Buffer descriptors are used by both CPM1 and CPM2. Move the definitions from the cpm dependent include file to common cpm.h Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- include/asm-powerpc/cpm.h | 73 include/asm-powerpc/cpm1.h | 65 --- include/asm-powerpc/cpm2.h | 64 -- 3 files changed, 73 insertions(+), 129 deletions(-) diff --git a/include/asm-powerpc/cpm.h b/include/asm-powerpc/cpm.h index fae83b1..77e39da 100644 --- a/include/asm-powerpc/cpm.h +++ b/include/asm-powerpc/cpm.h @@ -4,6 +4,79 @@ #include #include +/* Buffer descriptors used by many of the CPM protocols. */ +typedef struct cpm_buf_desc { + ushort cbd_sc; /* Status and Control */ + ushort cbd_datlen; /* Data length in buffer */ + uintcbd_bufaddr;/* Buffer address in host memory */ +} cbd_t; + +/* Buffer descriptor control/status used by serial + */ + +#define BD_SC_EMPTY(0x8000)/* Receive is empty */ +#define BD_SC_READY(0x8000)/* Transmit is ready */ +#define BD_SC_WRAP (0x2000)/* Last buffer descriptor */ +#define BD_SC_INTRPT (0x1000)/* Interrupt on change */ +#define BD_SC_LAST (0x0800)/* Last buffer in frame */ +#define BD_SC_TC (0x0400)/* Transmit CRC */ +#define BD_SC_CM (0x0200)/* Continous mode */ +#define BD_SC_ID (0x0100)/* Rec'd too many idles */ +#define BD_SC_P(0x0100)/* xmt preamble */ +#define BD_SC_BR (0x0020)/* Break received */ +#define BD_SC_FR (0x0010)/* Framing error */ +#define BD_SC_PR (0x0008)/* Parity error */ +#define BD_SC_NAK (0x0004)/* NAK - did not respond */ +#define BD_SC_OV (0x0002)/* Overrun */ +#define BD_SC_UN (0x0002)/* Underrun */ +#define BD_SC_CD (0x0001)/* */ +#define BD_SC_CL (0x0001)/* Collision */ + +/* Buffer descriptor control/status used by Ethernet receive. + * Common to SCC and FCC. + */ +#define BD_ENET_RX_EMPTY (0x8000) +#define BD_ENET_RX_WRAP(0x2000) +#define BD_ENET_RX_INTR(0x1000) +#define BD_ENET_RX_LAST(0x0800) +#define BD_ENET_RX_FIRST (0x0400) +#define BD_ENET_RX_MISS(0x0100) +#define BD_ENET_RX_BC (0x0080)/* FCC Only */ +#define BD_ENET_RX_MC (0x0040)/* FCC Only */ +#define BD_ENET_RX_LG (0x0020) +#define BD_ENET_RX_NO (0x0010) +#define BD_ENET_RX_SH (0x0008) +#define BD_ENET_RX_CR (0x0004) +#define BD_ENET_RX_OV (0x0002) +#define BD_ENET_RX_CL (0x0001) +#define BD_ENET_RX_STATS (0x01ff)/* All status bits */ + +/* Buffer descriptor control/status used by Ethernet transmit. + * Common to SCC and FCC. + */ +#define BD_ENET_TX_READY (0x8000) +#define BD_ENET_TX_PAD (0x4000) +#define BD_ENET_TX_WRAP(0x2000) +#define BD_ENET_TX_INTR(0x1000) +#define BD_ENET_TX_LAST(0x0800) +#define BD_ENET_TX_TC (0x0400) +#define BD_ENET_TX_DEF (0x0200) +#define BD_ENET_TX_HB (0x0100) +#define BD_ENET_TX_LC (0x0080) +#define BD_ENET_TX_RL (0x0040) +#define BD_ENET_TX_RCMASK (0x003c) +#define BD_ENET_TX_UN (0x0002) +#define BD_ENET_TX_CSL (0x0001) +#define BD_ENET_TX_STATS (0x03ff)/* All status bits */ + +/* Buffer descriptor control/status used by Transparent mode SCC. + */ +#define BD_SCC_TX_LAST (0x0800) + +/* Buffer descriptor control/status used by I2C. + */ +#define BD_I2C_START (0x0400) + int cpm_muram_init(void); unsigned long cpm_muram_alloc(unsigned long size, unsigned long align); int cpm_muram_free(unsigned long offset); diff --git a/include/asm-powerpc/cpm1.h b/include/asm-powerpc/cpm1.h index 901a00b..b2ebd6a 100644 --- a/include/asm-powerpc/cpm1.h +++ b/include/asm-powerpc/cpm1.h @@ -91,32 +91,6 @@ extern void cpm_load_patch(cpm8xx_t *cp); extern void cpm_reset(void); -/* Buffer descriptors used by many of the CPM protocols. -*/ -typedef struct cpm_buf_desc { - ushort cbd_sc; /* Status and Control */ - ushort cbd_datlen; /* Data length in buffer */ - uintcbd_bufaddr;/* Buffer address in host memory */ -} cbd_t; - -#define BD_SC_EMPTY((ushort)0x8000)/* Receive is empty */ -#define BD_SC_READY((ushort)0x8000)/* Transmit is ready */ -#define BD_SC_WRAP ((ushort)0x2000)/* Last buffer descriptor */ -#define BD_SC_INTRPT ((ushort)0x1000)/* Interrupt on change */ -#define BD_SC_LAST ((ushort)0x0800)/* Last buffer in frame */ -#define BD_SC_TC ((ushort)0x0400)/* Transmit CRC */ -#define BD_SC_CM ((ushort)0x0200)/* Con
[PATCHv3 6/7] [POWERPC] Rename commproc to cpm1 and cpm2_common.c to cpm2.c
Rename commproc.[ch] to cpm1.[ch] to be more consistent with cpm2. Also rename cpm2_common.c to cpm2.c as suggested by Scott Wood. Adjust the includes accordingly. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/platforms/8xx/ep88xc.c |1 + arch/powerpc/platforms/8xx/mpc86xads_setup.c |2 +- arch/powerpc/platforms/8xx/mpc885ads_setup.c |2 +- arch/powerpc/sysdev/Makefile |4 ++-- arch/powerpc/sysdev/{commproc.c => cpm1.c}|4 ++-- arch/powerpc/sysdev/{cpm2_common.c => cpm2.c} |3 +-- arch/powerpc/sysdev/micropatch.c |2 +- arch/ppc/8260_io/enet.c |2 +- arch/ppc/8xx_io/commproc.c|2 +- arch/ppc/8xx_io/enet.c|6 +++--- arch/ppc/8xx_io/fec.c |2 +- arch/ppc/8xx_io/micropatch.c |2 +- arch/ppc/boot/simple/iic.c|2 +- arch/ppc/boot/simple/m8xx_tty.c |2 +- arch/ppc/kernel/ppc_ksyms.c |2 +- arch/ppc/platforms/mpc866ads_setup.c |2 +- arch/ppc/platforms/mpc885ads_setup.c |2 +- arch/ppc/syslib/mpc8xx_devices.c |2 +- arch/ppc/xmon/start_8xx.c |2 +- drivers/net/fec.c |8 drivers/net/fec.h |2 +- drivers/net/fec_8xx/fec_8xx-netta.c |2 +- drivers/net/fec_8xx/fec_main.c|2 +- drivers/net/fec_8xx/fec_mii.c |2 +- drivers/net/fs_enet/fs_enet.h |2 +- drivers/net/fs_enet/mac-fec.c |2 +- drivers/net/fs_enet/mac-scc.c |2 +- drivers/serial/68360serial.c |2 +- drivers/serial/cpm_uart/cpm_uart_cpm1.h |2 +- include/asm-powerpc/{commproc.h => cpm1.h}|8 include/asm-ppc/{commproc.h => cpm1.h}|8 31 files changed, 40 insertions(+), 48 deletions(-) rename arch/powerpc/sysdev/{commproc.c => cpm1.c} (99%) rename arch/powerpc/sysdev/{cpm2_common.c => cpm2.c} (99%) rename include/asm-powerpc/{commproc.h => cpm1.h} (99%) rename include/asm-ppc/{commproc.h => cpm1.h} (99%) diff --git a/arch/powerpc/platforms/8xx/ep88xc.c b/arch/powerpc/platforms/8xx/ep88xc.c index 4897eda..a8dffa0 100644 --- a/arch/powerpc/platforms/8xx/ep88xc.c +++ b/arch/powerpc/platforms/8xx/ep88xc.c @@ -16,6 +16,7 @@ #include #include #include +#include #include "mpc8xx.h" diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c b/arch/powerpc/platforms/8xx/mpc86xads_setup.c index c0dda53..c028a5b 100644 --- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c index 3be115e..6e7ded0 100644 --- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile index f17e7b8..928d75b 100644 --- a/arch/powerpc/sysdev/Makefile +++ b/arch/powerpc/sysdev/Makefile @@ -36,8 +36,8 @@ endif # Temporary hack until we have migrated to asm-powerpc ifeq ($(ARCH),powerpc) obj-$(CONFIG_CPM) += cpm_common.o -obj-$(CONFIG_CPM2) += cpm2_common.o cpm2_pic.o +obj-$(CONFIG_CPM2) += cpm2.o cpm2_pic.o obj-$(CONFIG_PPC_DCR) += dcr.o -obj-$(CONFIG_8xx) += mpc8xx_pic.o commproc.o +obj-$(CONFIG_8xx) += mpc8xx_pic.o cpm1.o obj-$(CONFIG_UCODE_PATCH) += micropatch.o endif diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/cpm1.c similarity index 99% rename from arch/powerpc/sysdev/commproc.c rename to arch/powerpc/sysdev/cpm1.c index ef82587..df8bd2b 100644 --- a/arch/powerpc/sysdev/commproc.c +++ b/arch/powerpc/sysdev/cpm1.c @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include @@ -290,7 +290,7 @@ cpm_setbrg(uint brg, uint rate) out_be32(bp, (((BRG_UART_CLK / rate) - 1) << 1) | CPM_BRG_EN); else out_be32(bp, (((BRG_UART_CLK_DIV16 / rate) - 1) << 1) | -CPM_BRG_EN | CPM_BRG_DIV16); + CPM_BRG_EN | CPM_BRG_DIV16); } #ifndef CONFIG_PPC_CPM_NEW_BINDING diff --git a/arch/powerpc/sysdev/cpm2_common.c b/arch/powerpc/sysdev/cpm2.c similarity index 99% rename from arch/powerpc/sysdev/cpm2_common.c rename to arch/powerpc/sysdev/cpm2.c index f7188e2..7be7112 100644 --- a/arch/powerpc/sysdev/cpm2_common.c +++ b/arch/powerpc/sysdev/cpm2.c @@ -153,8 +153,7 @@ cpm2_fastbrg(uint brg, uint rate, int div16)
[PATCHv3 5/7] [POWERPC] Get rid of conditional includes of board specific setup
Directly include mpc885ads.h from mpc885ads_setup.c. Now we can get rid of the arch dependent includes in mpc8xx.h. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/platforms/8xx/m8xx_setup.c |3 +-- arch/powerpc/platforms/8xx/mpc885ads_setup.c |1 + include/asm-powerpc/mpc8xx.h | 20 3 files changed, 2 insertions(+), 22 deletions(-) diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c b/arch/powerpc/platforms/8xx/m8xx_setup.c index 1867a07..184f998 100644 --- a/arch/powerpc/platforms/8xx/m8xx_setup.c +++ b/arch/powerpc/platforms/8xx/m8xx_setup.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -28,9 +29,7 @@ #include "mpc8xx.h" -#ifdef CONFIG_PCMCIA_M8XX struct mpc8xx_pcmcia_ops m8xx_pcmcia_ops; -#endif extern int cpm_pic_init(void); extern int cpm_get_irq(void); diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c index bdceb57..3be115e 100644 --- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c @@ -40,6 +40,7 @@ #include #include +#include "mpc885ads.h" #include "mpc8xx.h" static u32 __iomem *bcsr, *bcsr5; diff --git a/include/asm-powerpc/mpc8xx.h b/include/asm-powerpc/mpc8xx.h index 2be014b..98f3c4f 100644 --- a/include/asm-powerpc/mpc8xx.h +++ b/include/asm-powerpc/mpc8xx.h @@ -4,29 +4,9 @@ * file that has to include MPC8xx configuration, they all include * this one and the configuration switching is done here. */ -#ifdef __KERNEL__ #ifndef __CONFIG_8xx_DEFS #define __CONFIG_8xx_DEFS - -#ifdef CONFIG_8xx - -#ifdef CONFIG_FADS -#include -#endif - -#if defined(CONFIG_MPC86XADS) -#include -#endif - -#if defined(CONFIG_MPC885ADS) -#include -#endif - -#ifdef CONFIG_PCMCIA_M8XX extern struct mpc8xx_pcmcia_ops m8xx_pcmcia_ops; -#endif -#endif /* CONFIG_8xx */ #endif /* __CONFIG_8xx_DEFS */ -#endif /* __KERNEL__ */ -- 1.5.3.8 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCHv3 4/7] [POWERPC] Remove sysdev/commproc.h
Move cpm1 specific prototypes to asm/commproc.h and mpc8xx specific prototypes to asm/mpc8xx.h. Adjust includes accordingly. Remove now unneeded sysdev/commproc.h. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/platforms/8xx/ep88xc.c |2 +- arch/powerpc/platforms/8xx/m8xx_setup.c |3 ++- arch/powerpc/platforms/8xx/mpc86xads_setup.c |4 +--- arch/powerpc/platforms/8xx/mpc885ads_setup.c |2 +- arch/powerpc/platforms/8xx/mpc8xx.h | 21 + arch/powerpc/sysdev/commproc.c |1 - arch/powerpc/sysdev/commproc.h | 12 arch/powerpc/sysdev/mpc8xx_pic.c |1 - include/asm-powerpc/commproc.h |2 ++ 9 files changed, 28 insertions(+), 20 deletions(-) create mode 100644 arch/powerpc/platforms/8xx/mpc8xx.h delete mode 100644 arch/powerpc/sysdev/commproc.h diff --git a/arch/powerpc/platforms/8xx/ep88xc.c b/arch/powerpc/platforms/8xx/ep88xc.c index 372b1e2..4897eda 100644 --- a/arch/powerpc/platforms/8xx/ep88xc.c +++ b/arch/powerpc/platforms/8xx/ep88xc.c @@ -17,7 +17,7 @@ #include #include -#include +#include "mpc8xx.h" struct cpm_pin { int port, pin, flags; diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c b/arch/powerpc/platforms/8xx/m8xx_setup.c index 85abd61..1867a07 100644 --- a/arch/powerpc/platforms/8xx/m8xx_setup.c +++ b/arch/powerpc/platforms/8xx/m8xx_setup.c @@ -25,7 +25,8 @@ #include #include -#include + +#include "mpc8xx.h" #ifdef CONFIG_PCMCIA_M8XX struct mpc8xx_pcmcia_ops m8xx_pcmcia_ops; diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c b/arch/powerpc/platforms/8xx/mpc86xads_setup.c index 2a4a50f..c0dda53 100644 --- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c @@ -21,15 +21,13 @@ #include #include #include -#include #include #include #include #include -#include - #include "mpc86xads.h" +#include "mpc8xx.h" struct cpm_pin { int port, pin, flags; diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c index 2931bae..bdceb57 100644 --- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c @@ -40,7 +40,7 @@ #include #include -#include +#include "mpc8xx.h" static u32 __iomem *bcsr, *bcsr5; diff --git a/arch/powerpc/platforms/8xx/mpc8xx.h b/arch/powerpc/platforms/8xx/mpc8xx.h new file mode 100644 index 000..17fb528 --- /dev/null +++ b/arch/powerpc/platforms/8xx/mpc8xx.h @@ -0,0 +1,21 @@ +/* + * Prototypes, etc. for the Freescale MPC8xx embedded cpu chips + * May need to be cleaned as the port goes on ... + * + * Copyright (C) 2008 Jochen Friedrich <[EMAIL PROTECTED]> + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ +#ifndef __MPC8xx_H +#define __MPC8xx_H + +extern void mpc8xx_restart(char *cmd); +extern void mpc8xx_calibrate_decr(void); +extern int mpc8xx_set_rtc_time(struct rtc_time *tm); +extern void mpc8xx_get_rtc_time(struct rtc_time *tm); +extern void mpc8xx_pics_init(void); +extern unsigned int mpc8xx_get_irq(void); + +#endif /* __MPC8xx_H */ diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c index 818d4b0..ef82587 100644 --- a/arch/powerpc/sysdev/commproc.c +++ b/arch/powerpc/sysdev/commproc.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/powerpc/sysdev/commproc.h b/arch/powerpc/sysdev/commproc.h deleted file mode 100644 index f481adf..000 --- a/arch/powerpc/sysdev/commproc.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef _POWERPC_SYSDEV_COMMPROC_H -#define _POWERPC_SYSDEV_COMMPROC_H - -extern void cpm_reset(void); -extern void mpc8xx_restart(char *cmd); -extern void mpc8xx_calibrate_decr(void); -extern int mpc8xx_set_rtc_time(struct rtc_time *tm); -extern void mpc8xx_get_rtc_time(struct rtc_time *tm); -extern void mpc8xx_pics_init(void); -extern unsigned int mpc8xx_get_irq(void); - -#endif diff --git a/arch/powerpc/sysdev/mpc8xx_pic.c b/arch/powerpc/sysdev/mpc8xx_pic.c index 7aa4ff5..0e74a4b 100644 --- a/arch/powerpc/sysdev/mpc8xx_pic.c +++ b/arch/powerpc/sysdev/mpc8xx_pic.c @@ -10,7 +10,6 @@ #include #include #include -#include #include "mpc8xx_pic.h" diff --git a/include/asm-powerpc/commproc.h b/include/asm-powerpc/commproc.h index 9757521..ec87b8f 100644 --- a/include/asm-powerpc/commproc.h +++ b/include/asm-powerpc/commproc.h @@ -89,6 +89,8 @@ extern void cpm_setbrg(uint brg, uint rate); extern void cpm_load_patch(cpm8xx_t *cp); +extern void cpm_reset(void); + /* Buffer descriptors used by many of the CPM protocols. */ typedef struct cpm_buf_desc { -- 1.5.3.8 -- To unsubscribe from this list: send the line "unsubsc
[PATCHv3 3/7] [POWERPC] Remove unneeded and misspelled prototype m8xx_calibrate_decr
m8xx_calibrate_decr seems to be a misspelled prototype for mpc8xx_calibrate_decr. As it's not needed anyways, just remove it. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/platforms/8xx/m8xx_setup.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c b/arch/powerpc/platforms/8xx/m8xx_setup.c index 1337457..85abd61 100644 --- a/arch/powerpc/platforms/8xx/m8xx_setup.c +++ b/arch/powerpc/platforms/8xx/m8xx_setup.c @@ -31,7 +31,6 @@ struct mpc8xx_pcmcia_ops m8xx_pcmcia_ops; #endif -void m8xx_calibrate_decr(void); extern int cpm_pic_init(void); extern int cpm_get_irq(void); -- 1.5.3.8 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCHv3 2/7] [POWERPC] Rename m8xx_pic_init to mpc8xx_pics_init
m8xx_pic_init calls both mpc8xx_pic_init and cpm_pic_init. Renaming the function to use the same name space as the rest of the mpc8xx specific funtions and to be more meaningful. m8xx_pic_init is declared in ppc8xx_pic.h but defined nowhere in the ppc tree. Remove it. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/platforms/8xx/ep88xc.c |2 +- arch/powerpc/platforms/8xx/m8xx_setup.c |4 ++-- arch/powerpc/platforms/8xx/mpc86xads_setup.c |2 +- arch/powerpc/platforms/8xx/mpc885ads_setup.c |2 +- arch/powerpc/sysdev/commproc.h |2 +- arch/ppc/syslib/ppc8xx_pic.h |1 - 6 files changed, 6 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/platforms/8xx/ep88xc.c b/arch/powerpc/platforms/8xx/ep88xc.c index 88afa35..372b1e2 100644 --- a/arch/powerpc/platforms/8xx/ep88xc.c +++ b/arch/powerpc/platforms/8xx/ep88xc.c @@ -165,7 +165,7 @@ define_machine(ep88xc) { .name = "Embedded Planet EP88xC", .probe = ep88xc_probe, .setup_arch = ep88xc_setup_arch, - .init_IRQ = m8xx_pic_init, + .init_IRQ = mpc8xx_pics_init, .get_irq= mpc8xx_get_irq, .restart = mpc8xx_restart, .calibrate_decr = mpc8xx_calibrate_decr, diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c b/arch/powerpc/platforms/8xx/m8xx_setup.c index ba645c2..1337457 100644 --- a/arch/powerpc/platforms/8xx/m8xx_setup.c +++ b/arch/powerpc/platforms/8xx/m8xx_setup.c @@ -237,13 +237,13 @@ static void cpm_cascade(unsigned int irq, struct irq_desc *desc) desc->chip->eoi(irq); } -/* Initialize the internal interrupt controller. The number of +/* Initialize the internal interrupt controllers. The number of * interrupts supported can vary with the processor type, and the * 82xx family can have up to 64. * External interrupts can be either edge or level triggered, and * need to be initialized by the appropriate driver. */ -void __init m8xx_pic_init(void) +void __init mpc8xx_pics_init(void) { int irq; diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c b/arch/powerpc/platforms/8xx/mpc86xads_setup.c index d7965f8..2a4a50f 100644 --- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c @@ -138,7 +138,7 @@ define_machine(mpc86x_ads) { .name = "MPC86x ADS", .probe = mpc86xads_probe, .setup_arch = mpc86xads_setup_arch, - .init_IRQ = m8xx_pic_init, + .init_IRQ = mpc8xx_pics_init, .get_irq= mpc8xx_get_irq, .restart= mpc8xx_restart, .calibrate_decr = mpc8xx_calibrate_decr, diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c index 6ef8e9e..2931bae 100644 --- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c @@ -274,7 +274,7 @@ define_machine(mpc885_ads) { .name = "Freescale MPC885 ADS", .probe = mpc885ads_probe, .setup_arch = mpc885ads_setup_arch, - .init_IRQ = m8xx_pic_init, + .init_IRQ = mpc8xx_pics_init, .get_irq= mpc8xx_get_irq, .restart= mpc8xx_restart, .calibrate_decr = mpc8xx_calibrate_decr, diff --git a/arch/powerpc/sysdev/commproc.h b/arch/powerpc/sysdev/commproc.h index 9155ba4..f481adf 100644 --- a/arch/powerpc/sysdev/commproc.h +++ b/arch/powerpc/sysdev/commproc.h @@ -6,7 +6,7 @@ extern void mpc8xx_restart(char *cmd); extern void mpc8xx_calibrate_decr(void); extern int mpc8xx_set_rtc_time(struct rtc_time *tm); extern void mpc8xx_get_rtc_time(struct rtc_time *tm); -extern void m8xx_pic_init(void); +extern void mpc8xx_pics_init(void); extern unsigned int mpc8xx_get_irq(void); #endif diff --git a/arch/ppc/syslib/ppc8xx_pic.h b/arch/ppc/syslib/ppc8xx_pic.h index d7d9f65..53bcd97 100644 --- a/arch/ppc/syslib/ppc8xx_pic.h +++ b/arch/ppc/syslib/ppc8xx_pic.h @@ -6,7 +6,6 @@ extern struct hw_interrupt_type ppc8xx_pic; -void m8xx_pic_init(void); void m8xx_do_IRQ(struct pt_regs *regs, intcpu); int m8xx_get_irq(struct pt_regs *regs); -- 1.5.3.8 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCHv3 0/7] [POWERPC] 8xx cleanups
Hi, this is a series against paulus for-2.6.25 tree to clean up various 8xx related stuff. The series can be pulled from git://git.bocc.de/dbox2.git cleanup. Old patches 2+4 have been merged into Patch 2. Patch 4 has been modified to move the prototypes into a new platforms/8xx/mpc8xx.h. Patch 5 leaves the PCMCIA bits in asm-powerpc/mpc8xx.h as this driver needs to be fixed first (unfortunately, i don't have an 8xx board with PCMCIA). I would suggest removing asm-powerpc/mpc8xx.h after ARCH=ppc is gone to avoid adding #ifdefs to all shared drivers. I also modified an option in Thunderbird so i hope whitespaces are OK now :-/ [POWERPC] Remove unused m8xx_cpm_hostalloc/free/dump() [POWERPC] Rename m8xx_pic_init to mpc8xx_pics_init [POWERPC] Remove unneeded and misspelled prototype m8xx_calibrate_decr [POWERPC] Remove sysdev/commproc.h [POWERPC] Get rid of conditional includes of board specific setup [POWERPC] Rename commproc to cpm1 and cpm2_common.c to cpm2.c [POWERPC] Move definition of buffer descriptor to cpm.h Thanks, Jochen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCHv3 1/7] [POWERPC] Remove unused m8xx_cpm_hostalloc/free/dump()
m8xx_cpm_hostalloc is still defined in commproc.c, but no users are left in the kernel tree. m8xx_cpm_hostfree and m8xx_cpm_hostdump are only defined in the headers. Remove this dead code. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/sysdev/commproc.c | 37 - arch/ppc/8xx_io/commproc.c | 38 -- include/asm-powerpc/commproc.h |4 include/asm-ppc/commproc.h |4 4 files changed, 0 insertions(+), 83 deletions(-) diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c index 621bc6c..818d4b0 100644 --- a/arch/powerpc/sysdev/commproc.c +++ b/arch/powerpc/sysdev/commproc.c @@ -48,8 +48,6 @@ #ifndef CONFIG_PPC_CPM_NEW_BINDING static void m8xx_cpm_dpinit(void); #endif -static uint host_buffer; /* One page of host buffer */ -static uint host_end;/* end + 1 */ cpm8xx_t __iomem *cpmp; /* Pointer to comm processor space */ immap_t __iomem *mpc8xx_immr; static cpic8xx_t __iomem *cpic_reg; @@ -268,41 +266,6 @@ out: } EXPORT_SYMBOL(cpm_command); -/* We used to do this earlier, but have to postpone as long as possible - * to ensure the kernel VM is now running. - */ -static void -alloc_host_memory(void) -{ - dma_addr_t physaddr; - - /* Set the host page for allocation. - */ - host_buffer = (uint)dma_alloc_coherent(NULL, PAGE_SIZE, &physaddr, - GFP_KERNEL); - host_end = host_buffer + PAGE_SIZE; -} - -/* We also own one page of host buffer space for the allocation of - * UART "fifos" and the like. - */ -uint -m8xx_cpm_hostalloc(uint size) -{ - uintretloc; - - if (host_buffer == 0) - alloc_host_memory(); - - if ((host_buffer + size) >= host_end) - return(0); - - retloc = host_buffer; - host_buffer += size; - - return(retloc); -} - /* Set a baud rate generator. This needs lots of work. There are * four BRGs, any of which can be wired to any channel. * The internal baud rate clock is the system clock divided by 16. diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c index 9da880b..3f93af8 100644 --- a/arch/ppc/8xx_io/commproc.c +++ b/arch/ppc/8xx_io/commproc.c @@ -55,8 +55,6 @@ }) static void m8xx_cpm_dpinit(void); -static uinthost_buffer;/* One page of host buffer */ -static uinthost_end; /* end + 1 */ cpm8xx_t*cpmp; /* Pointer to comm processor space */ /* CPM interrupt vector functions. @@ -68,7 +66,6 @@ structcpm_action { static struct cpm_action cpm_vecs[CPMVEC_NR]; static irqreturn_t cpm_interrupt(int irq, void * dev); static irqreturn_t cpm_error_interrupt(int irq, void *dev); -static voidalloc_host_memory(void); /* Define a table of names to identify CPM interrupt handlers in * /proc/interrupts. */ @@ -158,21 +155,6 @@ m8xx_cpm_reset(void) cpmp = (cpm8xx_t *)commproc; } -/* We used to do this earlier, but have to postpone as long as possible - * to ensure the kernel VM is now running. - */ -static void -alloc_host_memory(void) -{ - dma_addr_t physaddr; - - /* Set the host page for allocation. - */ - host_buffer = (uint)dma_alloc_coherent(NULL, PAGE_SIZE, &physaddr, - GFP_KERNEL); - host_end = host_buffer + PAGE_SIZE; -} - /* This is called during init_IRQ. We used to do it above, but this * was too early since init_IRQ was not yet called. */ @@ -319,26 +301,6 @@ cpm_free_handler(int cpm_vec) cpm_vecs[cpm_vec].dev_id = NULL; } -/* We also own one page of host buffer space for the allocation of - * UART "fifos" and the like. - */ -uint -m8xx_cpm_hostalloc(uint size) -{ - uintretloc; - - if (host_buffer == 0) - alloc_host_memory(); - - if ((host_buffer + size) >= host_end) - return(0); - - retloc = host_buffer; - host_buffer += size; - - return(retloc); -} - /* Set a baud rate generator. This needs lots of work. There are * four BRGs, any of which can be wired to any channel. * The internal baud rate clock is the system clock divided by 16. diff --git a/include/asm-powerpc/commproc.h b/include/asm-powerpc/commproc.h index 9e3b864..9757521 100644 --- a/include/asm-powerpc/commproc.h +++ b/include/asm-powerpc/commproc.h @@ -87,10 +87,6 @@ extern uint cpm_dpram_phys(u8* addr); extern void cpm_setbrg(uint brg, uint rate); -extern uint m8xx_cpm_hostalloc(uint size); -extern int m8xx_cpm_hostfree(uint start); -extern void m8xx_cpm_hostdump(void); - extern void cpm_load_patch(cpm8xx_t *cp); /* Buffer descriptors used by many of the CPM protocols. diff --git a/include/asm-ppc/commproc.h b/include/asm-ppc/commproc.h index 462abb1..5418d6d 100644 --- a/include/asm-ppc/commproc.h +++ b/include/asm-ppc/commproc.h @@ -75,10 +75,6 @@ extern void *cpm_dpram_addr(unsigned long offset); extern ui
Re: [PATCHv2 5/8] [POWERPC] Remove sysdev/commproc.h
Hi Kumar, Do we really need the prototypes you moved into asm/mpc8xx.h here? can they just live in platforms/8xx/8xx.h or something like that? At least drivers/pcmcia/m8xx_pcmcia.c uses the symbol m8xx_pcmcia_ops which is conditionally defined in platforms/8xx/m8xx_setup.c. However, this driver currently seems to be broken (doesn't compile neither as built-in nor as module). Other drivers that include asm/mpc8xx.c are: drivers/net/fec.c (the include seems to be obsolete, as according to Kconfig the driver is only built on MPC52xx platforms) drivers/net/fec_8xx (unused, depends on non-existant CONFIG_8XX) drivers/net/fs_enet (i need to check if the include is needed, at all) I'll have a closer look at this. Thanks, Jochen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCHv2 8/8] [POWERPC] Move definition of buffer descriptor to cpm.h
Buffer descriptors are used by both CPM1 and CPM2. Move the definitions from the cpm dependent include file to common cpm.h Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- include/asm-powerpc/cpm.h | 73 include/asm-powerpc/cpm1.h | 65 --- include/asm-powerpc/cpm2.h | 64 -- 3 files changed, 73 insertions(+), 129 deletions(-) diff --git a/include/asm-powerpc/cpm.h b/include/asm-powerpc/cpm.h index fae83b1..77e39da 100644 --- a/include/asm-powerpc/cpm.h +++ b/include/asm-powerpc/cpm.h @@ -4,6 +4,79 @@ #include #include +/* Buffer descriptors used by many of the CPM protocols. */ +typedef struct cpm_buf_desc { + ushort cbd_sc; /* Status and Control */ + ushort cbd_datlen; /* Data length in buffer */ + uintcbd_bufaddr;/* Buffer address in host memory */ +} cbd_t; + +/* Buffer descriptor control/status used by serial + */ + +#define BD_SC_EMPTY(0x8000)/* Receive is empty */ +#define BD_SC_READY(0x8000)/* Transmit is ready */ +#define BD_SC_WRAP (0x2000)/* Last buffer descriptor */ +#define BD_SC_INTRPT (0x1000)/* Interrupt on change */ +#define BD_SC_LAST (0x0800)/* Last buffer in frame */ +#define BD_SC_TC (0x0400)/* Transmit CRC */ +#define BD_SC_CM (0x0200)/* Continous mode */ +#define BD_SC_ID (0x0100)/* Rec'd too many idles */ +#define BD_SC_P(0x0100)/* xmt preamble */ +#define BD_SC_BR (0x0020)/* Break received */ +#define BD_SC_FR (0x0010)/* Framing error */ +#define BD_SC_PR (0x0008)/* Parity error */ +#define BD_SC_NAK (0x0004)/* NAK - did not respond */ +#define BD_SC_OV (0x0002)/* Overrun */ +#define BD_SC_UN (0x0002)/* Underrun */ +#define BD_SC_CD (0x0001)/* */ +#define BD_SC_CL (0x0001)/* Collision */ + +/* Buffer descriptor control/status used by Ethernet receive. + * Common to SCC and FCC. + */ +#define BD_ENET_RX_EMPTY (0x8000) +#define BD_ENET_RX_WRAP(0x2000) +#define BD_ENET_RX_INTR(0x1000) +#define BD_ENET_RX_LAST(0x0800) +#define BD_ENET_RX_FIRST (0x0400) +#define BD_ENET_RX_MISS(0x0100) +#define BD_ENET_RX_BC (0x0080)/* FCC Only */ +#define BD_ENET_RX_MC (0x0040)/* FCC Only */ +#define BD_ENET_RX_LG (0x0020) +#define BD_ENET_RX_NO (0x0010) +#define BD_ENET_RX_SH (0x0008) +#define BD_ENET_RX_CR (0x0004) +#define BD_ENET_RX_OV (0x0002) +#define BD_ENET_RX_CL (0x0001) +#define BD_ENET_RX_STATS (0x01ff)/* All status bits */ + +/* Buffer descriptor control/status used by Ethernet transmit. + * Common to SCC and FCC. + */ +#define BD_ENET_TX_READY (0x8000) +#define BD_ENET_TX_PAD (0x4000) +#define BD_ENET_TX_WRAP(0x2000) +#define BD_ENET_TX_INTR(0x1000) +#define BD_ENET_TX_LAST(0x0800) +#define BD_ENET_TX_TC (0x0400) +#define BD_ENET_TX_DEF (0x0200) +#define BD_ENET_TX_HB (0x0100) +#define BD_ENET_TX_LC (0x0080) +#define BD_ENET_TX_RL (0x0040) +#define BD_ENET_TX_RCMASK (0x003c) +#define BD_ENET_TX_UN (0x0002) +#define BD_ENET_TX_CSL (0x0001) +#define BD_ENET_TX_STATS (0x03ff)/* All status bits */ + +/* Buffer descriptor control/status used by Transparent mode SCC. + */ +#define BD_SCC_TX_LAST (0x0800) + +/* Buffer descriptor control/status used by I2C. + */ +#define BD_I2C_START (0x0400) + int cpm_muram_init(void); unsigned long cpm_muram_alloc(unsigned long size, unsigned long align); int cpm_muram_free(unsigned long offset); diff --git a/include/asm-powerpc/cpm1.h b/include/asm-powerpc/cpm1.h index 901a00b..b2ebd6a 100644 --- a/include/asm-powerpc/cpm1.h +++ b/include/asm-powerpc/cpm1.h @@ -91,32 +91,6 @@ extern void cpm_load_patch(cpm8xx_t *cp); extern void cpm_reset(void); -/* Buffer descriptors used by many of the CPM protocols. -*/ -typedef struct cpm_buf_desc { - ushort cbd_sc; /* Status and Control */ - ushort cbd_datlen; /* Data length in buffer */ - uintcbd_bufaddr;/* Buffer address in host memory */ -} cbd_t; - -#define BD_SC_EMPTY((ushort)0x8000)/* Receive is empty */ -#define BD_SC_READY((ushort)0x8000)/* Transmit is ready */ -#define BD_SC_WRAP ((ushort)0x2000)/* Last buffer descriptor */ -#define BD_SC_INTRPT ((ushort)0x1000)/* Interrupt on change */ -#define BD_SC_LAST ((ushort)0x0800)/* Last buffer in frame */ -#define BD_SC_TC ((ushort)0x0400)/* Transmit CRC */ -#define BD_SC_CM ((us
[PATCHv2 7/8] [POWERPC] Rename commproc to cpm1 and cpm2_common.c to cpm2.c
Rename commproc.[ch] to cpm1.[ch] to be more consistent with cpm2. Also rename cpm2_common.c to cpm2.c as suggested by Scott Wood. Adjust the includes accordingly. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/platforms/8xx/ep88xc.c |2 +- arch/powerpc/platforms/8xx/mpc86xads_setup.c |2 +- arch/powerpc/platforms/8xx/mpc885ads_setup.c |2 +- arch/powerpc/sysdev/Makefile |4 ++-- arch/powerpc/sysdev/{commproc.c => cpm1.c}|4 ++-- arch/powerpc/sysdev/{cpm2_common.c => cpm2.c} |3 +-- arch/powerpc/sysdev/micropatch.c |2 +- arch/ppc/8260_io/enet.c |2 +- arch/ppc/8xx_io/commproc.c|2 +- arch/ppc/8xx_io/enet.c|6 +++--- arch/ppc/8xx_io/fec.c |2 +- arch/ppc/8xx_io/micropatch.c |2 +- arch/ppc/boot/simple/iic.c|2 +- arch/ppc/boot/simple/m8xx_tty.c |2 +- arch/ppc/kernel/ppc_ksyms.c |2 +- arch/ppc/platforms/mpc866ads_setup.c |2 +- arch/ppc/platforms/mpc885ads_setup.c |2 +- arch/ppc/syslib/mpc8xx_devices.c |2 +- arch/ppc/xmon/start_8xx.c |2 +- drivers/net/fec.c |2 +- drivers/net/fec.h |2 +- drivers/net/fec_8xx/fec_8xx-netta.c |2 +- drivers/net/fec_8xx/fec_main.c|2 +- drivers/net/fec_8xx/fec_mii.c |2 +- drivers/net/fs_enet/fs_enet.h |2 +- drivers/net/fs_enet/mac-fec.c |2 +- drivers/net/fs_enet/mac-scc.c |2 +- drivers/serial/68360serial.c |2 +- drivers/serial/cpm_uart/cpm_uart_cpm1.h |2 +- include/asm-powerpc/{commproc.h => cpm1.h}|8 include/asm-ppc/{commproc.h => cpm1.h}|8 31 files changed, 41 insertions(+), 42 deletions(-) rename arch/powerpc/sysdev/{commproc.c => cpm1.c} (99%) rename arch/powerpc/sysdev/{cpm2_common.c => cpm2.c} (99%) rename include/asm-powerpc/{commproc.h => cpm1.h} (99%) rename include/asm-ppc/{commproc.h => cpm1.h} (99%) diff --git a/arch/powerpc/platforms/8xx/ep88xc.c b/arch/powerpc/platforms/8xx/ep88xc.c index 9365f07..d300576 100644 --- a/arch/powerpc/platforms/8xx/ep88xc.c +++ b/arch/powerpc/platforms/8xx/ep88xc.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include struct cpm_pin { diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c b/arch/powerpc/platforms/8xx/mpc86xads_setup.c index 7389590..a68509d 100644 --- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c index 426b897..f39447b 100644 --- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile index 9a20ef4..61f2604 100644 --- a/arch/powerpc/sysdev/Makefile +++ b/arch/powerpc/sysdev/Makefile @@ -35,8 +35,8 @@ endif # Temporary hack until we have migrated to asm-powerpc ifeq ($(ARCH),powerpc) obj-$(CONFIG_CPM) += cpm_common.o -obj-$(CONFIG_CPM2) += cpm2_common.o cpm2_pic.o +obj-$(CONFIG_CPM2) += cpm2.o cpm2_pic.o obj-$(CONFIG_PPC_DCR) += dcr.o -obj-$(CONFIG_8xx) += mpc8xx_pic.o commproc.o +obj-$(CONFIG_8xx) += mpc8xx_pic.o cpm1.o obj-$(CONFIG_UCODE_PATCH) += micropatch.o endif diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/cpm1.c similarity index 99% rename from arch/powerpc/sysdev/commproc.c rename to arch/powerpc/sysdev/cpm1.c index ef82587..df8bd2b 100644 --- a/arch/powerpc/sysdev/commproc.c +++ b/arch/powerpc/sysdev/cpm1.c @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include @@ -290,7 +290,7 @@ cpm_setbrg(uint brg, uint rate) out_be32(bp, (((BRG_UART_CLK / rate) - 1) << 1) | CPM_BRG_EN); else out_be32(bp, (((BRG_UART_CLK_DIV16 / rate) - 1) << 1) | -CPM_BRG_EN | CPM_BRG_DIV16); + CPM_BRG_EN | CPM_BRG_DIV16); } #ifndef CONFIG_PPC_CPM_NEW_BINDING diff --git a/arch/powerpc/sysdev/cpm2_common.c b/arch/powerpc/sysdev/cpm2.c similarity index 99% rename from arch/powerpc/sysdev/cpm2_common.c rename to arch/powerpc/sysdev/cpm2.c index f7188e2..7be7112 100644 --- a/arch/powerpc/sysdev/cpm2_common.c +++ b/arch/powerpc/sysdev/cpm2.c @@ -1
[PATCHv2 5/8] [POWERPC] Remove sysdev/commproc.h
Move cpm1 specific prototypes to asm/commproc.h and mpc8xx specific prototypes to asm/mpc8xx.h. Adjust includes accordingly. Remove now unneeded sysdev/commproc.h. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/platforms/8xx/ep88xc.c |3 +-- arch/powerpc/platforms/8xx/m8xx_setup.c |1 - arch/powerpc/platforms/8xx/mpc86xads_setup.c |2 -- arch/powerpc/platforms/8xx/mpc885ads_setup.c |2 -- arch/powerpc/sysdev/commproc.c |1 - arch/powerpc/sysdev/commproc.h | 12 arch/powerpc/sysdev/mpc8xx_pic.c |1 - drivers/net/fs_enet/mac-scc.c|1 - include/asm-powerpc/commproc.h |2 ++ include/asm-powerpc/mpc8xx.h |7 +++ 10 files changed, 10 insertions(+), 22 deletions(-) delete mode 100644 arch/powerpc/sysdev/commproc.h diff --git a/arch/powerpc/platforms/8xx/ep88xc.c b/arch/powerpc/platforms/8xx/ep88xc.c index c883c31..9365f07 100644 --- a/arch/powerpc/platforms/8xx/ep88xc.c +++ b/arch/powerpc/platforms/8xx/ep88xc.c @@ -16,8 +16,7 @@ #include #include #include - -#include +#include struct cpm_pin { int port, pin, flags; diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c b/arch/powerpc/platforms/8xx/m8xx_setup.c index 85abd61..c6a4663 100644 --- a/arch/powerpc/platforms/8xx/m8xx_setup.c +++ b/arch/powerpc/platforms/8xx/m8xx_setup.c @@ -25,7 +25,6 @@ #include #include -#include #ifdef CONFIG_PCMCIA_M8XX struct mpc8xx_pcmcia_ops m8xx_pcmcia_ops; diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c b/arch/powerpc/platforms/8xx/mpc86xads_setup.c index dea1df1..7389590 100644 --- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c @@ -27,8 +27,6 @@ #include #include -#include - #include "mpc86xads.h" struct cpm_pin { diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c index 8f2aa04..ae69e93 100644 --- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c @@ -40,8 +40,6 @@ #include #include -#include - static u32 __iomem *bcsr, *bcsr5; #ifdef CONFIG_PCMCIA_M8XX diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c index 818d4b0..ef82587 100644 --- a/arch/powerpc/sysdev/commproc.c +++ b/arch/powerpc/sysdev/commproc.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/powerpc/sysdev/commproc.h b/arch/powerpc/sysdev/commproc.h deleted file mode 100644 index f481adf..000 --- a/arch/powerpc/sysdev/commproc.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef _POWERPC_SYSDEV_COMMPROC_H -#define _POWERPC_SYSDEV_COMMPROC_H - -extern void cpm_reset(void); -extern void mpc8xx_restart(char *cmd); -extern void mpc8xx_calibrate_decr(void); -extern int mpc8xx_set_rtc_time(struct rtc_time *tm); -extern void mpc8xx_get_rtc_time(struct rtc_time *tm); -extern void mpc8xx_pics_init(void); -extern unsigned int mpc8xx_get_irq(void); - -#endif diff --git a/arch/powerpc/sysdev/mpc8xx_pic.c b/arch/powerpc/sysdev/mpc8xx_pic.c index 7aa4ff5..0e74a4b 100644 --- a/arch/powerpc/sysdev/mpc8xx_pic.c +++ b/arch/powerpc/sysdev/mpc8xx_pic.c @@ -10,7 +10,6 @@ #include #include #include -#include #include "mpc8xx_pic.h" diff --git a/drivers/net/fs_enet/mac-scc.c b/drivers/net/fs_enet/mac-scc.c index fe3d8a6..1502dbf 100644 --- a/drivers/net/fs_enet/mac-scc.c +++ b/drivers/net/fs_enet/mac-scc.c @@ -39,7 +39,6 @@ #ifdef CONFIG_8xx #include #include -#include #include #endif diff --git a/include/asm-powerpc/commproc.h b/include/asm-powerpc/commproc.h index 9757521..ec87b8f 100644 --- a/include/asm-powerpc/commproc.h +++ b/include/asm-powerpc/commproc.h @@ -89,6 +89,8 @@ extern void cpm_setbrg(uint brg, uint rate); extern void cpm_load_patch(cpm8xx_t *cp); +extern void cpm_reset(void); + /* Buffer descriptors used by many of the CPM protocols. */ typedef struct cpm_buf_desc { diff --git a/include/asm-powerpc/mpc8xx.h b/include/asm-powerpc/mpc8xx.h index 2be014b..2af9fcb 100644 --- a/include/asm-powerpc/mpc8xx.h +++ b/include/asm-powerpc/mpc8xx.h @@ -11,6 +11,13 @@ #ifdef CONFIG_8xx +extern void mpc8xx_restart(char *cmd); +extern void mpc8xx_calibrate_decr(void); +extern int mpc8xx_set_rtc_time(struct rtc_time *tm); +extern void mpc8xx_get_rtc_time(struct rtc_time *tm); +extern void mpc8xx_pics_init(void); +extern unsigned int mpc8xx_get_irq(void); + #ifdef CONFIG_FADS #include #endif -- 1.5.3.8 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCHv2 6/8] [POWERPC] Get rid of conditional includes of board specific setup
Directly include mpc885ads.h from mpc885ads_setup.c. Now we can get rid of the arch dependent includes in mpc8xx.h. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/platforms/8xx/mpc885ads_setup.c |2 + include/asm-powerpc/mpc8xx.h | 34 +++--- 2 files changed, 11 insertions(+), 25 deletions(-) diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c index ae69e93..426b897 100644 --- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c @@ -40,6 +40,8 @@ #include #include +#include "mpc885ads.h" + static u32 __iomem *bcsr, *bcsr5; #ifdef CONFIG_PCMCIA_M8XX diff --git a/include/asm-powerpc/mpc8xx.h b/include/asm-powerpc/mpc8xx.h index 2af9fcb..70fd8a7 100644 --- a/include/asm-powerpc/mpc8xx.h +++ b/include/asm-powerpc/mpc8xx.h @@ -1,16 +1,16 @@ -/* This is the single file included by all MPC8xx build options. - * Since there are many different boards and no standard configuration, - * we have a unique include file for each. Rather than change every - * file that has to include MPC8xx configuration, they all include - * this one and the configuration switching is done here. +/* + * Prototypes, etc. for the Freescale MPC8xx embedded cpu chips + * May need to be cleaned as the port goes on ... + * + * Copyright (C) 2008 Jochen Friedrich <[EMAIL PROTECTED]> + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. */ -#ifdef __KERNEL__ #ifndef __CONFIG_8xx_DEFS #define __CONFIG_8xx_DEFS - -#ifdef CONFIG_8xx - extern void mpc8xx_restart(char *cmd); extern void mpc8xx_calibrate_decr(void); extern int mpc8xx_set_rtc_time(struct rtc_time *tm); @@ -18,22 +18,6 @@ extern void mpc8xx_get_rtc_time(struct rtc_time *tm); extern void mpc8xx_pics_init(void); extern unsigned int mpc8xx_get_irq(void); -#ifdef CONFIG_FADS -#include -#endif - -#if defined(CONFIG_MPC86XADS) -#include -#endif - -#if defined(CONFIG_MPC885ADS) -#include -#endif - -#ifdef CONFIG_PCMCIA_M8XX extern struct mpc8xx_pcmcia_ops m8xx_pcmcia_ops; -#endif -#endif /* CONFIG_8xx */ #endif /* __CONFIG_8xx_DEFS */ -#endif /* __KERNEL__ */ -- 1.5.3.8 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCHv2 2/8] [POWERPC] Rename m8xx_pic_init to mpc8xx_pics_init
m8xx_pic_init calls both mpc8xx_pic_init and cpm_pic_init. Renaming the function to use the same name space as the rest of the mpc8xx specific funtions and to be more meaningful. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/platforms/8xx/ep88xc.c |2 +- arch/powerpc/platforms/8xx/m8xx_setup.c |4 ++-- arch/powerpc/platforms/8xx/mpc86xads_setup.c |2 +- arch/powerpc/platforms/8xx/mpc885ads_setup.c |2 +- arch/powerpc/sysdev/commproc.h |2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/platforms/8xx/ep88xc.c b/arch/powerpc/platforms/8xx/ep88xc.c index c518b6c..c883c31 100644 --- a/arch/powerpc/platforms/8xx/ep88xc.c +++ b/arch/powerpc/platforms/8xx/ep88xc.c @@ -166,7 +166,7 @@ define_machine(ep88xc) { .name = "Embedded Planet EP88xC", .probe = ep88xc_probe, .setup_arch = ep88xc_setup_arch, - .init_IRQ = m8xx_pic_init, + .init_IRQ = mpc8xx_pics_init, .get_irq= mpc8xx_get_irq, .restart = mpc8xx_restart, .calibrate_decr = mpc8xx_calibrate_decr, diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c b/arch/powerpc/platforms/8xx/m8xx_setup.c index ba645c2..1337457 100644 --- a/arch/powerpc/platforms/8xx/m8xx_setup.c +++ b/arch/powerpc/platforms/8xx/m8xx_setup.c @@ -237,13 +237,13 @@ static void cpm_cascade(unsigned int irq, struct irq_desc *desc) desc->chip->eoi(irq); } -/* Initialize the internal interrupt controller. The number of +/* Initialize the internal interrupt controllers. The number of * interrupts supported can vary with the processor type, and the * 82xx family can have up to 64. * External interrupts can be either edge or level triggered, and * need to be initialized by the appropriate driver. */ -void __init m8xx_pic_init(void) +void __init mpc8xx_pics_init(void) { int irq; diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c b/arch/powerpc/platforms/8xx/mpc86xads_setup.c index d2927a4..dea1df1 100644 --- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c @@ -139,7 +139,7 @@ define_machine(mpc86x_ads) { .name = "MPC86x ADS", .probe = mpc86xads_probe, .setup_arch = mpc86xads_setup_arch, - .init_IRQ = m8xx_pic_init, + .init_IRQ = mpc8xx_pics_init, .get_irq= mpc8xx_get_irq, .restart= mpc8xx_restart, .calibrate_decr = mpc8xx_calibrate_decr, diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c index 2cf1b6a..8f2aa04 100644 --- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c @@ -275,7 +275,7 @@ define_machine(mpc885_ads) { .name = "Freescale MPC885 ADS", .probe = mpc885ads_probe, .setup_arch = mpc885ads_setup_arch, - .init_IRQ = m8xx_pic_init, + .init_IRQ = mpc8xx_pics_init, .get_irq= mpc8xx_get_irq, .restart= mpc8xx_restart, .calibrate_decr = mpc8xx_calibrate_decr, diff --git a/arch/powerpc/sysdev/commproc.h b/arch/powerpc/sysdev/commproc.h index 9155ba4..f481adf 100644 --- a/arch/powerpc/sysdev/commproc.h +++ b/arch/powerpc/sysdev/commproc.h @@ -6,7 +6,7 @@ extern void mpc8xx_restart(char *cmd); extern void mpc8xx_calibrate_decr(void); extern int mpc8xx_set_rtc_time(struct rtc_time *tm); extern void mpc8xx_get_rtc_time(struct rtc_time *tm); -extern void m8xx_pic_init(void); +extern void mpc8xx_pics_init(void); extern unsigned int mpc8xx_get_irq(void); #endif -- 1.5.3.8 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCHv2 3/8] [POWERPC] Remove unneeded and misspelled prototype m8xx_calibrate_decr
m8xx_calibrate_decr seems to be a misspelled prototype for mpc8xx_calibrate_decr. As it's not needed anyways, just remove it. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/platforms/8xx/m8xx_setup.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c b/arch/powerpc/platforms/8xx/m8xx_setup.c index 1337457..85abd61 100644 --- a/arch/powerpc/platforms/8xx/m8xx_setup.c +++ b/arch/powerpc/platforms/8xx/m8xx_setup.c @@ -31,7 +31,6 @@ struct mpc8xx_pcmcia_ops m8xx_pcmcia_ops; #endif -void m8xx_calibrate_decr(void); extern int cpm_pic_init(void); extern int cpm_get_irq(void); -- 1.5.3.8 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCHv2 4/8] [POWERPC] Remove declaration of m8xx_pic_init.
m8xx_pic_init is declared in ppc8xx_pic.h but defined nowhere in the ppc tree. Remove it. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/ppc/syslib/ppc8xx_pic.h |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/arch/ppc/syslib/ppc8xx_pic.h b/arch/ppc/syslib/ppc8xx_pic.h index d7d9f65..53bcd97 100644 --- a/arch/ppc/syslib/ppc8xx_pic.h +++ b/arch/ppc/syslib/ppc8xx_pic.h @@ -6,7 +6,6 @@ extern struct hw_interrupt_type ppc8xx_pic; -void m8xx_pic_init(void); void m8xx_do_IRQ(struct pt_regs *regs, intcpu); int m8xx_get_irq(struct pt_regs *regs); -- 1.5.3.8 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCHv2 1/8] [POWERPC] Remove unused m8xx_cpm_hostalloc/free/dump()
m8xx_cpm_hostalloc is still defined in commproc.c, but no users are left in the kernel tree. m8xx_cpm_hostfree and m8xx_cpm_hostdump are only defined in the headers. Remove this dead code. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/sysdev/commproc.c | 37 - arch/ppc/8xx_io/commproc.c | 38 -- include/asm-powerpc/commproc.h |4 include/asm-ppc/commproc.h |4 4 files changed, 0 insertions(+), 83 deletions(-) diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c index 621bc6c..818d4b0 100644 --- a/arch/powerpc/sysdev/commproc.c +++ b/arch/powerpc/sysdev/commproc.c @@ -48,8 +48,6 @@ #ifndef CONFIG_PPC_CPM_NEW_BINDING static void m8xx_cpm_dpinit(void); #endif -static uint host_buffer; /* One page of host buffer */ -static uint host_end;/* end + 1 */ cpm8xx_t __iomem *cpmp; /* Pointer to comm processor space */ immap_t __iomem *mpc8xx_immr; static cpic8xx_t __iomem *cpic_reg; @@ -268,41 +266,6 @@ out: } EXPORT_SYMBOL(cpm_command); -/* We used to do this earlier, but have to postpone as long as possible - * to ensure the kernel VM is now running. - */ -static void -alloc_host_memory(void) -{ - dma_addr_t physaddr; - - /* Set the host page for allocation. - */ - host_buffer = (uint)dma_alloc_coherent(NULL, PAGE_SIZE, &physaddr, - GFP_KERNEL); - host_end = host_buffer + PAGE_SIZE; -} - -/* We also own one page of host buffer space for the allocation of - * UART "fifos" and the like. - */ -uint -m8xx_cpm_hostalloc(uint size) -{ - uintretloc; - - if (host_buffer == 0) - alloc_host_memory(); - - if ((host_buffer + size) >= host_end) - return(0); - - retloc = host_buffer; - host_buffer += size; - - return(retloc); -} - /* Set a baud rate generator. This needs lots of work. There are * four BRGs, any of which can be wired to any channel. * The internal baud rate clock is the system clock divided by 16. diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c index 9da880b..3f93af8 100644 --- a/arch/ppc/8xx_io/commproc.c +++ b/arch/ppc/8xx_io/commproc.c @@ -55,8 +55,6 @@ }) static void m8xx_cpm_dpinit(void); -static uinthost_buffer;/* One page of host buffer */ -static uinthost_end; /* end + 1 */ cpm8xx_t *cpmp; /* Pointer to comm processor space */ /* CPM interrupt vector functions. @@ -68,7 +66,6 @@ structcpm_action { static struct cpm_action cpm_vecs[CPMVEC_NR]; static irqreturn_t cpm_interrupt(int irq, void * dev); static irqreturn_t cpm_error_interrupt(int irq, void *dev); -static voidalloc_host_memory(void); /* Define a table of names to identify CPM interrupt handlers in * /proc/interrupts. */ @@ -158,21 +155,6 @@ m8xx_cpm_reset(void) cpmp = (cpm8xx_t *)commproc; } -/* We used to do this earlier, but have to postpone as long as possible - * to ensure the kernel VM is now running. - */ -static void -alloc_host_memory(void) -{ - dma_addr_t physaddr; - - /* Set the host page for allocation. - */ - host_buffer = (uint)dma_alloc_coherent(NULL, PAGE_SIZE, &physaddr, - GFP_KERNEL); - host_end = host_buffer + PAGE_SIZE; -} - /* This is called during init_IRQ. We used to do it above, but this * was too early since init_IRQ was not yet called. */ @@ -319,26 +301,6 @@ cpm_free_handler(int cpm_vec) cpm_vecs[cpm_vec].dev_id = NULL; } -/* We also own one page of host buffer space for the allocation of - * UART "fifos" and the like. - */ -uint -m8xx_cpm_hostalloc(uint size) -{ - uintretloc; - - if (host_buffer == 0) - alloc_host_memory(); - - if ((host_buffer + size) >= host_end) - return(0); - - retloc = host_buffer; - host_buffer += size; - - return(retloc); -} - /* Set a baud rate generator. This needs lots of work. There are * four BRGs, any of which can be wired to any channel. * The internal baud rate clock is the system clock divided by 16. diff --git a/include/asm-powerpc/commproc.h b/include/asm-powerpc/commproc.h index 9e3b864..9757521 100644 --- a/include/asm-powerpc/commproc.h +++ b/include/asm-powerpc/commproc.h @@ -87,10 +87,6 @@ extern uint cpm_dpram_phys(u8* addr); extern void cpm_setbrg(uint brg, uint rate); -extern uint m8xx_cpm_hostalloc(uint size); -extern int m8xx_cpm_hostfree(uint start); -extern void m8xx_cpm_hostdump(void); - extern void cpm_load_patch(cpm8xx_t *cp); /* Buffer descriptors used by many of the CPM protocols. diff --git a/include/asm-ppc/commproc.h b/include/asm-ppc/commproc.h index 462abb1..5418d6d 100644 --- a/include/asm-ppc/commproc.h +++ b/include/asm-ppc/commproc.h @@ -75,10 +75,6 @@ extern void *cpm_dpram_
[PATCHv2 0/8] [POWERPC] 8xx cleanups
Hi, this is a series against paulus for-2.6.25 tree to clean up various 8xx related stuff. The series can be pulled from git://git.bocc.de/dbox2.git cleanup. Patch 6 has been modified to remove the #ifdefs as suggested by Arndt Bergmann. Patch 8 is a new one. [POWERPC] Remove unused m8xx_cpm_hostalloc/free/dump() [POWERPC] Rename m8xx_pic_init to mpc8xx_pics_init [POWERPC] Remove unneeded and misspelled prototype m8xx_calibrate_decr [POWERPC] Remove declaration of m8xx_pic_init. [POWERPC] Remove sysdev/commproc.h [POWERPC] Get rid of conditional includes of board specific setup [POWERPC] Rename commproc to cpm1 and cpm2_common.c to cpm2.c [POWERPC] Move definition of buffer descriptor to cpm.h Thanks, Jochen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCHv2] i2c: adds support for i2c bus on Frescale CPM1/CPM2 controllers
Hi Jean, Do you have an updated patch addressing Stephen's comment? Note: you'd rather send updates of this patch to the i2c list rather than LKML. I'm currently looking at that last patches from Jon and try to make this driver fit in there (+ the class override stuff). Note: will do. I just subscribed to this list. Thanks, Jochen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH/RFCv3] [POWERPC] Add support for freescale watchdog to CPM serial driver.
If a freescale watchdog device node is present, reset the watchdog while waiting for serial input. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/boot/Makefile |2 +- arch/powerpc/boot/cpm-serial.c |6 +++ arch/powerpc/boot/cuboot-8xx.c |1 + arch/powerpc/boot/ops.h|8 arch/powerpc/boot/watchdog.c | 81 5 files changed, 97 insertions(+), 1 deletions(-) create mode 100644 arch/powerpc/boot/watchdog.c diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index d1e625c..66edf77 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -56,7 +56,7 @@ src-wlib := string.S crt0.S stdio.c main.c \ gunzip_util.c elf_util.c $(zlib) devtree.c oflib.c ofconsole.c \ 4xx.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c bamboo.c \ cpm-serial.c stdlib.c mpc52xx-psc.c planetcore.c uartlite.c \ - fsl-soc.c mpc8xx.c pq2.c + fsl-soc.c mpc8xx.c pq2.c watchdog.c src-plat := of.c cuboot-52xx.c cuboot-83xx.c cuboot-85xx.c holly.c \ cuboot-ebony.c treeboot-ebony.c prpmc2800.c \ ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \ diff --git a/arch/powerpc/boot/cpm-serial.c b/arch/powerpc/boot/cpm-serial.c index 28296fa..56b5fda 100644 --- a/arch/powerpc/boot/cpm-serial.c +++ b/arch/powerpc/boot/cpm-serial.c @@ -6,6 +6,9 @@ * * It is assumed that the firmware (or the platform file) has already set * up the port. + * + * If a watchdog node exists, periodically reset the watchdog while waiting + * for console input. */ #include "types.h" @@ -154,6 +157,9 @@ static void cpm_serial_putc(unsigned char c) static unsigned char cpm_serial_tstc(void) { + + watchdog_poke(); + barrier(); return !(rbdf->sc & 0x8000); } diff --git a/arch/powerpc/boot/cuboot-8xx.c b/arch/powerpc/boot/cuboot-8xx.c index c202c88..767670e 100644 --- a/arch/powerpc/boot/cuboot-8xx.c +++ b/arch/powerpc/boot/cuboot-8xx.c @@ -43,5 +43,6 @@ void platform_init(unsigned long r3, unsigned long r4, unsigned long r5, CUBOOT_INIT(); fdt_init(_dtb_start); serial_console_init(); + watchdog_init(); platform_ops.fixups = platform_fixups; } diff --git a/arch/powerpc/boot/ops.h b/arch/powerpc/boot/ops.h index 6036a98..cc97e2b 100644 --- a/arch/powerpc/boot/ops.h +++ b/arch/powerpc/boot/ops.h @@ -70,6 +70,12 @@ struct serial_console_data { void(*close)(void); }; +/* Watchdog operations */ +struct watchdog_ops { + void(*poke)(void); +}; +extern struct watchdog_ops watchdog_ops; + struct loader_info { void *promptr; unsigned long initrd_addr, initrd_size; @@ -86,6 +92,8 @@ int mpsc_console_init(void *devp, struct serial_console_data *scdp); int cpm_console_init(void *devp, struct serial_console_data *scdp); int mpc5200_psc_console_init(void *devp, struct serial_console_data *scdp); int uartlite_console_init(void *devp, struct serial_console_data *scdp); +void watchdog_poke(void); +void watchdog_init(void); void *simple_alloc_init(char *base, unsigned long heap_size, unsigned long granularity, unsigned long max_allocs); extern void flush_cache(void *, unsigned long); diff --git a/arch/powerpc/boot/watchdog.c b/arch/powerpc/boot/watchdog.c new file mode 100644 index 000..2bdee77 --- /dev/null +++ b/arch/powerpc/boot/watchdog.c @@ -0,0 +1,81 @@ +/* + * PQ Watchdog + * + * Copyright 2008 Jochen Friedrich <[EMAIL PROTECTED]> + * + * Search for PowerQUICC type watchdog devices. Provide a callback to + * periodically reset the watchdog while waiting for console input. + * + * 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; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "types.h" +#include "io.h" +#include "ops.h" + +struct watchdog_ops watchdog_ops; + +/* pq Watchdog */ + +struct pq_wdt { + u32 res0; + u32 swcrr; /* System watchdog control register */ + u32 swcnr; /* System watchdog count register */ + u8 res1[2]; + u16 swsrr; /* System watchdog service register */ +}; + +static struct pq_wdt *pq_wdt; + +static void pq_poke(void) +{ + out_be16(&pq_wdt->swsrr, 0x556c); + out_be16(&pq_wdt->s
Re: [PATCH/RFCv2] [POWERPC] Add support for freescale watchdog to CPM serial driver.
Hi Kumar, Ok now that makes sense, thanks So I'll ask, what serial input are you waiting for from the boot wrapper? It's the editor for the kernel command line. Thanks, Jochen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH/RFCv2] [POWERPC] Add support for freescale watchdog to CPM serial driver.
Hi Alan, If a freescale watchdog device node is present, reset the watchdog while waiting for serial input. Why ? We normally rely on user space for watchdog management as only the fact user space is behaving really proves a box is happy ? This is in the boot wrapper code, not in the linux kernel. Thanks, Jochen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH/RFCv2] [POWERPC] Add support for freescale watchdog to CPM serial driver.
Scott Wood schrieb: +void watchdog_poke(void) +{ +if (wdt) { +out_be16(&wdt->swsrr, 0x556c); +out_be16(&wdt->swsrr, 0xaa39); +} +} This should be a function pointer, to allow for other watchdog types. Thanks for the comments. Stephen Rothwell also asked if the filename watchdog.c is too generic. I think the pq watchdog is easy enough to keep it in the generic watchdog.c file, but the function pointer definitely is the way to go. I'll resubmit. Thanks, Jochen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH/RFCv2] wdt: Add support for PowerQUICC watchdog
Hi Kumar, Why are you commenting on mpc83xx_wdt with respect to pq1_wdt? Also, is this driver just for PQ1 platforms or PQ1 & PQ2? If its just pq1 we should probably call it pq1_wdt* It should be for pq1, pq2 and pq2pro. However, i only have the possibility to test this on pq1. arch/powerpc/platforms/8xx/mpc86xads_setup.c |5 + arch/powerpc/platforms/8xx/mpc885ads_setup.c |5 + arch/powerpc/sysdev/Makefile |3 + arch/powerpc/sysdev/pq_wdt.c | 203 +++ arch/powerpc/sysdev/pq_wdt.h | 28 drivers/watchdog/Kconfig | 13 ++- drivers/watchdog/Makefile|1 + drivers/watchdog/pq_wdt.c| 225 ++ 8 files changed, 482 insertions(+), 1 deletions(-) create mode 100644 arch/powerpc/sysdev/pq_wdt.c create mode 100644 arch/powerpc/sysdev/pq_wdt.h create mode 100644 drivers/watchdog/pq_wdt.c What are the bits in sysdev/pq_wdt.{c,h}. Why aren't these just in drivers/watchdog? These are the parts needed to boot a device with activated watchdog. If a bootloader like u-boot activates the watchdog, it can't be deactivated again and needs to be reset at regular intervals. This is done using a kernel timer. The driver in drivers/watchdog disables the timer as soon as the wdt device is opened. Thanks, Jochen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH/RFCv2] wdt: Add support for PowerQUICC watchdog
The PowerQUICC series has a watchdog which can be activated by the boot loader and then needs to be reset in regular intervals. Once the watchdog is enabled, it can't be disabled anymore. This patch adds support for this kind of watchdog. An early init function is provided to manually reset the watchdog in early board setup. Later, a kernel timer is used to reset the watchdog until the watchdog driver is opened from user space. This replaces mpc8xx_wdt.c (only usable for ARCH=ppc) and mpc83xx_wdt.c (untested on this platform). Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/platforms/8xx/mpc86xads_setup.c |5 + arch/powerpc/platforms/8xx/mpc885ads_setup.c |5 + arch/powerpc/sysdev/Makefile |3 + arch/powerpc/sysdev/pq_wdt.c | 203 +++ arch/powerpc/sysdev/pq_wdt.h | 28 drivers/watchdog/Kconfig | 13 ++- drivers/watchdog/Makefile|1 + drivers/watchdog/pq_wdt.c| 225 ++ 8 files changed, 482 insertions(+), 1 deletions(-) create mode 100644 arch/powerpc/sysdev/pq_wdt.c create mode 100644 arch/powerpc/sysdev/pq_wdt.h create mode 100644 drivers/watchdog/pq_wdt.c diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c b/arch/powerpc/platforms/8xx/mpc86xads_setup.c index d2927a4..b65d28d 100644 --- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c @@ -28,6 +28,7 @@ #include #include +#include #include "mpc86xads.h" @@ -111,6 +112,10 @@ static void __init mpc86xads_setup_arch(void) clrbits32(bcsr_io, BCSR1_RS232EN_1 | BCSR1_RS232EN_2 | BCSR1_ETHEN); iounmap(bcsr_io); + +#if defined(CONFIG_PQ_WDT) || defined(CONFIG_PQ_WDT_MODULE) + pq_wdt_early_init(); +#endif } static int __init mpc86xads_probe(void) diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c index 2cf1b6a..f076b67 100644 --- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c @@ -41,6 +41,7 @@ #include #include +#include static u32 __iomem *bcsr, *bcsr5; @@ -246,6 +247,10 @@ static void __init mpc885ads_setup_arch(void) m8xx_pcmcia_ops.hw_ctrl = pcmcia_hw_setup; m8xx_pcmcia_ops.voltage_set = pcmcia_set_voltage; #endif + +#if defined(CONFIG_PQ_WDT) || defined(CONFIG_PQ_WDT_MODULE) + pq_wdt_early_init(); +#endif } static int __init mpc885ads_probe(void) diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile index 9a20ef4..e5ae1c3 100644 --- a/arch/powerpc/sysdev/Makefile +++ b/arch/powerpc/sysdev/Makefile @@ -38,5 +38,8 @@ obj-$(CONFIG_CPM) += cpm_common.o obj-$(CONFIG_CPM2) += cpm2_common.o cpm2_pic.o obj-$(CONFIG_PPC_DCR) += dcr.o obj-$(CONFIG_8xx) += mpc8xx_pic.o commproc.o +ifneq ($(CONFIG_PQ_WDT),) +obj-y += pq_wdt.o +endif obj-$(CONFIG_UCODE_PATCH) += micropatch.o endif diff --git a/arch/powerpc/sysdev/pq_wdt.c b/arch/powerpc/sysdev/pq_wdt.c new file mode 100644 index 000..d0f5c61 --- /dev/null +++ b/arch/powerpc/sysdev/pq_wdt.c @@ -0,0 +1,203 @@ +/* + * pq_wdt.c - Freescale PowerQUICC watchdog driver + * + * Author: Florian Schirmer <[EMAIL PROTECTED]> + * + * 2002 (c) Florian Schirmer <[EMAIL PROTECTED]> This file is licensed under + * the terms of the GNU General Public License version 2. This program + * is licensed "as is" without any warranty of any kind, whether express + * or implied. + * + * 2007,2008 (c) Jochen Friedrich <[EMAIL PROTECTED]> ported to ARCH=powerpc and + * extended to be useful on any Power QUICC 1/2/2pro which have the same + * style of watchdog. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "pq_wdt.h" + +struct pq_wdt { + __be32 res0; + __be32 swcrr; /* System watchdog control register */ + __be32 swcnr; /* System watchdog count register */ + u8 res1[2]; + __be16 swsrr; /* System watchdog service register */ +}; + +static int wdt_timeout; +static int wdt_freq; +static struct pq_wdt __iomem *wdt_reg; +static int wdt_scale; + +void pq_wdt_reset(void) +{ + if (!wdt_reg) + return; + + out_be16(&wdt_reg->swsrr, 0x556c); /* write magic1 */ + out_be16(&wdt_reg->swsrr, 0xaa39); /* write magic2 */ +} +EXPORT_SYMBOL(pq_wdt_reset); + +static void wdt_timer_func(unsigned long data); + +static struct timer_list wdt_timer = + TIMER_INITIALIZER(wdt_timer_func, 0, 0); + +void pq_wdt_stop_timer(void) +{ + del_timer(&wdt_timer); +} +EXPORT_SYMBOL_GPL(pq_wdt_stop_timer); + +void pq_wdt_install_timer(void) +{ + pq_wdt_reset(); + mod_timer(&wdt_timer, jiffies + (HZ/2)); +} +EXPORT_S
[PATCH/RFCv2] [POWERPC] Add support for freescale watchdog to CPM serial driver.
If a freescale watchdog device node is present, reset the watchdog while waiting for serial input. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/boot/Makefile |2 +- arch/powerpc/boot/cpm-serial.c |6 arch/powerpc/boot/cuboot-8xx.c |1 + arch/powerpc/boot/ops.h|2 + arch/powerpc/boot/watchdog.c | 65 5 files changed, 75 insertions(+), 1 deletions(-) create mode 100644 arch/powerpc/boot/watchdog.c diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index d1e625c..66edf77 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -56,7 +56,7 @@ src-wlib := string.S crt0.S stdio.c main.c \ gunzip_util.c elf_util.c $(zlib) devtree.c oflib.c ofconsole.c \ 4xx.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c bamboo.c \ cpm-serial.c stdlib.c mpc52xx-psc.c planetcore.c uartlite.c \ - fsl-soc.c mpc8xx.c pq2.c + fsl-soc.c mpc8xx.c pq2.c watchdog.c src-plat := of.c cuboot-52xx.c cuboot-83xx.c cuboot-85xx.c holly.c \ cuboot-ebony.c treeboot-ebony.c prpmc2800.c \ ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \ diff --git a/arch/powerpc/boot/cpm-serial.c b/arch/powerpc/boot/cpm-serial.c index 28296fa..56b5fda 100644 --- a/arch/powerpc/boot/cpm-serial.c +++ b/arch/powerpc/boot/cpm-serial.c @@ -6,6 +6,9 @@ * * It is assumed that the firmware (or the platform file) has already set * up the port. + * + * If a watchdog node exists, periodically reset the watchdog while waiting + * for console input. */ #include "types.h" @@ -154,6 +157,9 @@ static void cpm_serial_putc(unsigned char c) static unsigned char cpm_serial_tstc(void) { + + watchdog_poke(); + barrier(); return !(rbdf->sc & 0x8000); } diff --git a/arch/powerpc/boot/cuboot-8xx.c b/arch/powerpc/boot/cuboot-8xx.c index c202c88..767670e 100644 --- a/arch/powerpc/boot/cuboot-8xx.c +++ b/arch/powerpc/boot/cuboot-8xx.c @@ -43,5 +43,6 @@ void platform_init(unsigned long r3, unsigned long r4, unsigned long r5, CUBOOT_INIT(); fdt_init(_dtb_start); serial_console_init(); + watchdog_init(); platform_ops.fixups = platform_fixups; } diff --git a/arch/powerpc/boot/ops.h b/arch/powerpc/boot/ops.h index 6036a98..0701359 100644 --- a/arch/powerpc/boot/ops.h +++ b/arch/powerpc/boot/ops.h @@ -86,6 +86,8 @@ int mpsc_console_init(void *devp, struct serial_console_data *scdp); int cpm_console_init(void *devp, struct serial_console_data *scdp); int mpc5200_psc_console_init(void *devp, struct serial_console_data *scdp); int uartlite_console_init(void *devp, struct serial_console_data *scdp); +void watchdog_poke(void); +void watchdog_init(void); void *simple_alloc_init(char *base, unsigned long heap_size, unsigned long granularity, unsigned long max_allocs); extern void flush_cache(void *, unsigned long); diff --git a/arch/powerpc/boot/watchdog.c b/arch/powerpc/boot/watchdog.c new file mode 100644 index 000..6c50052 --- /dev/null +++ b/arch/powerpc/boot/watchdog.c @@ -0,0 +1,65 @@ +/* + * PQ Watchdog + * + * Copyright 2008 Jochen Friedrich <[EMAIL PROTECTED]> + * + * Search for PowerQUICC type watchdog devices. Provide a callback to + * periodically reset the watchdog while waiting for console input. + * + * 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; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "types.h" +#include "io.h" +#include "ops.h" + +struct pq_wdt { + u32 res0; + u32 swcrr; /* System watchdog control register */ + u32 swcnr; /* System watchdog count register */ + u8 res1[2]; + u16 swsrr; /* System watchdog service register */ +}; + +static struct pq_wdt *wdt; + +void watchdog_poke(void) +{ + if (wdt) { + out_be16(&wdt->swsrr, 0x556c); + out_be16(&wdt->swsrr, 0xaa39); + } +} + +void watchdog_init(void) +{ + void *reg_virt[2]; + int n; + unsigned long reg_phys; + void *watchdog; + + watchdog = finddevice("/soc/wdt"); + if (watchdog && (dt_is_compatible(watchdog, "fsl,pq1-wdt") || +dt_is_compatible(watchdog, "fs
Re: [i2c] [PATCH 0/5] Version 17, series to add device tree naming to i2c
Hi Jon, >>> The following series implements standard linux module aliasing for i2c >>> modules on arch=powerpc. It then converts the mpc i2c driver from being a >>> platform driver to an open firmware one. I2C device names are picked up >>> from the device tree. Module aliasing is used to translate from device tree >>> names into to linux kernel names. Several i2c drivers are updated to use >>> the new aliasing. >> Now that I have read all the previous versions of this patch series >> and, more importantly, all objections that were raised on the way, I >> can start reviewing the latest iteration of your patches. I'll also do >> some testing, although I have no powerpc stuff here, but at least I >> want to make sure that there are no regressions introduced by your >> patches on x86. > Various people were worried about x86. Around version 15 I altered the > patches so that they only impacted PowerPC. If they impact x86 in > current form that is a bug. I can only second this. The latest version of i2c-cpm (http://patchwork.ozlabs.org/linuxppc/patch?person=1023&id=15902) makes use of this patch, as well. On the dbox2, loading and unloading of modules in any order just works fine. Thanks, Jochen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCHv3] powerpc: DBox2 Board Support
Hi David, +/ { + model = "unknown,dbox2"; // boot wrapper fills in correct manufacturer Probably better just to leave model out of the dts and let the bootwrapper add it. Unfortunately, dtc requires a model: $ dtc arch/powerpc/boot/dts/dbox2.dts DTC: dts->dts on file "arch/powerpc/boot/dts/dbox2.dts" ERROR: Missing "model" property in / + [EMAIL PROTECTED],0 { + compatible = "cfi-flash"; + reg = <0 0 80>; + bank-width = <4>; + device-width = <1>; + #address-cells = <1>; + #size-cells = <1>; + [EMAIL PROTECTED] { + label = "BR bootloader"; + reg = <0 2>; + read-only; + }; + [EMAIL PROTECTED] { + label = "FLFS (U-Boot)"; + reg = <2 2>; + }; + [EMAIL PROTECTED] { + label = "rootfs"; + reg = <4 7c>; + }; + [EMAIL PROTECTED] { Uh.. I really don't know what the MTD driver will handle these overlapping partitions. I suspect it will not be pretty... + label = "Flash without bootloader"; + reg = <2 7e>; + }; + [EMAIL PROTECTED] { + label = "Complete Flash"; + reg = <0 80>; + read-only; + }; + }; + }; MTD handles this correctly. dbox2 uses "Flash without bootloader" for flashing image updates and "Complete Flash" for creating a backup of everything. OpenWRT also uses overlapping partitions BTW (and also for flashing updates). Thanks, Jochen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCHv2] i2c: adds support for i2c bus on Frescale CPM1/CPM2 controllers
Using the port of 2.4 code from Vitaly Bordug <[EMAIL PROTECTED]> and the actual algorithm used by the i2c driver of the DBox code on cvs.tuxboc.org from Tmbinc, Gillem ([EMAIL PROTECTED]). Renamed i2c-rpx.c and i2c-algo-8xx.c to i2c-cpm.c and converted the driver to an of_platform_driver. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/boot/dts/mpc8272ads.dts | 10 + arch/powerpc/boot/dts/mpc866ads.dts | 10 + arch/powerpc/boot/dts/mpc885ads.dts | 10 + arch/powerpc/platforms/8xx/mpc885ads_setup.c |5 + drivers/i2c/busses/Kconfig | 10 + drivers/i2c/busses/Makefile |1 + drivers/i2c/busses/i2c-cpm.c | 786 ++ 7 files changed, 832 insertions(+), 0 deletions(-) create mode 100644 drivers/i2c/busses/i2c-cpm.c diff --git a/arch/powerpc/boot/dts/mpc8272ads.dts b/arch/powerpc/boot/dts/mpc8272ads.dts index 7285ca1..7273996 100644 --- a/arch/powerpc/boot/dts/mpc8272ads.dts +++ b/arch/powerpc/boot/dts/mpc8272ads.dts @@ -215,6 +215,16 @@ linux,network-index = <1>; fsl,cpm-command = <16200300>; }; + + [EMAIL PROTECTED] { + compatible = "fsl,mpc8248-i2c", +"fsl,cpm2-i2c", +"fsl,cpm-i2c"; + reg = <11860 20 8afc 2>; + interrupts = <1 8>; + interrupt-parent = <&PIC>; + fsl,cpm-command = <2960>; + }; }; PIC: [EMAIL PROTECTED] { diff --git a/arch/powerpc/boot/dts/mpc866ads.dts b/arch/powerpc/boot/dts/mpc866ads.dts index daf9433..80c08bf 100644 --- a/arch/powerpc/boot/dts/mpc866ads.dts +++ b/arch/powerpc/boot/dts/mpc866ads.dts @@ -169,6 +169,16 @@ fsl,cpm-command = <>; linux,network-index = <1>; }; + + [EMAIL PROTECTED] { + compatible = "fsl,mpc866-i2c", +"fsl,cpm1-i2c", +"fsl,cpm-i2c"; + reg = <860 20 3c80 30>; + interrupts = <10 3>; + interrupt-parent = <&Cpm_pic>; + fsl,cpm-command = <0010>; + }; }; }; diff --git a/arch/powerpc/boot/dts/mpc885ads.dts b/arch/powerpc/boot/dts/mpc885ads.dts index 8848e63..fd9c9d7 100644 --- a/arch/powerpc/boot/dts/mpc885ads.dts +++ b/arch/powerpc/boot/dts/mpc885ads.dts @@ -213,6 +213,16 @@ fsl,cpm-command = <0080>; linux,network-index = <2>; }; + + [EMAIL PROTECTED] { + compatible = "fsl,mpc885-i2c", +"fsl,cpm1-i2c", +"fsl,cpm-i2c"; + reg = <860 20 3c80 30>; + interrupts = <10>; + interrupt-parent = <&CPM_PIC>; + fsl,cpm-command = <0010>; + }; }; }; diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c index 2cf1b6a..4377521 100644 --- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c @@ -157,6 +157,11 @@ static struct cpm_pin mpc885ads_pins[] = { {CPM_PORTE, 28, CPM_PIN_OUTPUT}, {CPM_PORTE, 29, CPM_PIN_OUTPUT}, #endif + /* I2C */ +#ifdef CONFIG_I2C_8XX + {CPM_PORTB, 26, CPM_PIN_INPUT | CPM_PIN_OPENDRAIN}, + {CPM_PORTB, 27, CPM_PIN_INPUT | CPM_PIN_OPENDRAIN}, +#endif }; static void __init init_ioports(void) diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index c466c6c..5950172 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig @@ -114,6 +114,16 @@ config I2C_BLACKFIN_TWI_CLK_KHZ help The unit of the TWI clock is kHz. +config I2C_CPM + tristate "Freescale CPM1 or CPM2 (MPC8xx/826x)" + depends on (CPM1 || CPM2) && I2C && PPC_OF + help + This supports the use of the I2C interface on Freescale + processors with CPM1 or CPM2. + + This driver can also be built as a module. If so, the module + w
[PATCHv3] powerpc: DBox2 Board Support
This patch adds device tree source, default config and setup code for DBox2 devices. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/boot/Makefile |4 +- arch/powerpc/boot/cuboot-dbox2.c | 280 arch/powerpc/boot/dts/dbox2.dts | 251 arch/powerpc/configs/dbox2_defconfig | 1034 ++ arch/powerpc/platforms/8xx/Kconfig |7 + arch/powerpc/platforms/8xx/Makefile |1 + arch/powerpc/platforms/8xx/dbox2_setup.c | 173 + 7 files changed, 1749 insertions(+), 1 deletions(-) create mode 100644 arch/powerpc/boot/cuboot-dbox2.c create mode 100644 arch/powerpc/boot/dts/dbox2.dts create mode 100644 arch/powerpc/configs/dbox2_defconfig create mode 100644 arch/powerpc/platforms/8xx/dbox2_setup.c diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 18e3271..4c9ec63 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -55,7 +55,8 @@ src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \ src-plat := of.c cuboot-52xx.c cuboot-83xx.c cuboot-85xx.c holly.c \ cuboot-ebony.c treeboot-ebony.c prpmc2800.c \ ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \ - cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c cuboot-bamboo.c \ + cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c \ + cuboot-bamboo.c cuboot-dbox2.c \ fixed-head.S ep88xc.c cuboot-hpc2.c src-boot := $(src-wlib) $(src-plat) empty.c @@ -159,6 +160,7 @@ image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony image-$(CONFIG_BAMBOO) += treeImage.bamboo cuImage.bamboo image-$(CONFIG_SEQUOIA) += cuImage.sequoia image-$(CONFIG_WALNUT) += treeImage.walnut +image-$(CONFIG_DBOX2) += cuImage.dbox2 endif # For 32-bit powermacs, build the COFF and miboot images diff --git a/arch/powerpc/boot/cuboot-dbox2.c b/arch/powerpc/boot/cuboot-dbox2.c new file mode 100644 index 000..e54cef2 --- /dev/null +++ b/arch/powerpc/boot/cuboot-dbox2.c @@ -0,0 +1,280 @@ +/* + * Old U-boot compatibility for dbox2 + * + * Copyright (c) 2007 Jochen Friedrich <[EMAIL PROTECTED]> + * + * Based on cuboot-8xx.c. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#include "ops.h" +#include "stdio.h" +#include "cuboot.h" +#include "io.h" + +#define TARGET_8xx +#include "ppcboot.h" + +static bd_t bd; + +#defineMAX_PROP_LEN256 /* What should this be? */ +#define DBOX2_VENDOR_OFFSET(0x1ffe0) + +enum dbox2_mid { + DBOX2_MID_UNKNOWN = 0, + DBOX2_MID_NOKIA = 1, + DBOX2_MID_PHILIPS = 2, + DBOX2_MID_SAGEM = 3, +}; + +struct dbox2_board_info { + enum dbox2_mid mid; + char *model; + char *avs; + char *demux; + char *fp; + u32 cs3start; + u32 cs3size; + u32 cs5start; + u32 cs5size; + u32 cs6start; + u32 cs6size; + u32 cs7start; + u32 cs7size; + u32 demux0cs; + u32 demux0start; + u32 demux0size; + u32 demux1cs; + u32 demux1start; + u32 demux1size; + u32 fp_id; +}; + +static struct dbox2_board_info dbox2_board_info[] = { + { + .mid= DBOX2_MID_NOKIA, + .model = "nokia,dbox2", + .avs= "sony,cxa2092", + .demux = "c-cube,gtx", + .fp = "[EMAIL PROTECTED]", + .cs3start = 0x0c00, + .cs3size= 0x0004, + .cs5start = 0x0800, + .cs5size= 0x0020, + .cs6start = 0x0b00, + .cs6size= 0x8000, + .cs7start = 0x0840, + .cs7size= 0x8000, + .demux0cs = 7, + .demux0start= 0x, + .demux0size = 0x3000, + .demux1cs = 5, + .demux1start= 0x, + .demux1size = 0x0020, + .fp_id = 0x5a, + }, + { + .mid= DBOX2_MID_PHILIPS, + .model = "philips,dbox2", + .avs= "stm,stv6412", + .demux = "c-cube,enx", + .fp = "[EMAIL PROTECTED]", + .cs3start = 0x0c04, + .cs3size= 0x0004, + .cs5start = 0x0800, + .cs5s
[PATCH/RFC] Add support for freescale watchdog to CPM serial driver.
If a freescale watchdog device node is present, reset the watchdog while waiting for serial input. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/boot/cpm-serial.c | 33 - 1 files changed, 32 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/boot/cpm-serial.c b/arch/powerpc/boot/cpm-serial.c index 28296fa..d85f038 100644 --- a/arch/powerpc/boot/cpm-serial.c +++ b/arch/powerpc/boot/cpm-serial.c @@ -6,6 +6,9 @@ * * It is assumed that the firmware (or the platform file) has already set * up the port. + * + * If a watchdog node exists, periodically reset the watchdog while waiting + * for console input. */ #include "types.h" @@ -50,7 +53,16 @@ struct cpm_bd { u8 *addr; /* Buffer address in host memory */ }; +struct pq_wdt { + u32 res0; + u32 swcrr; /* System watchdog control register */ + u32 swcnr; /* System watchdog count register */ + u8 res1[2]; + u16 swsrr; /* System watchdog service register */ +}; + static void *cpcr; +static struct pq_wdt *wdt; static struct cpm_param *param; static struct cpm_smc *smc; static struct cpm_scc *scc; @@ -154,6 +166,11 @@ static void cpm_serial_putc(unsigned char c) static unsigned char cpm_serial_tstc(void) { + if (wdt) { + out_be16(&wdt->swsrr, 0x556c); + out_be16(&wdt->swsrr, 0xaa39); + } + barrier(); return !(rbdf->sc & 0x8000); } @@ -178,7 +195,7 @@ int cpm_console_init(void *devp, struct serial_console_data *scdp) void *reg_virt[2]; int is_smc = 0, is_cpm2 = 0, n; unsigned long reg_phys; - void *parent, *muram; + void *parent, *muram, *watchdog; if (dt_is_compatible(devp, "fsl,cpm1-smc-uart")) { is_smc = 1; @@ -260,6 +277,20 @@ int cpm_console_init(void *devp, struct serial_console_data *scdp) if (n < 4) return -1; + watchdog = finddevice("/soc/wdt"); + if (watchdog && (dt_is_compatible(watchdog, "fsl,pq1-wdt") || +dt_is_compatible(watchdog, "fsl,pq2-wdt") || +dt_is_compatible(watchdog, "fsl,pq2pro-wdt"))) { + n = getprop(watchdog, "virtual-reg", reg_virt, +sizeof(reg_virt)); + if (n < (int)sizeof(reg_virt)) { + if (!dt_xlate_reg(watchdog, 0, ®_phys, NULL)) + return -1; + reg_virt[0] = (void *)reg_phys; + } + wdt = reg_virt[0]; + } + scdp->open = cpm_serial_open; scdp->putc = cpm_serial_putc; scdp->getc = cpm_serial_getc; -- 1.5.3.7 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH/RFC] Add support for PowerQUICC watchdog
The PowerQUICC series has a watchdog which can be activated by the boot loader and then needs to be reset in regular intervals. Once the watchdog is enabled, it can't be disabled anymore. This patch adds support for this kind of watchdog. An early init function is provided to manually reset the watchdog in early board setup. Later, a kernel timer is used to reset the watchdog until the watchdog driver is opened from user space. This replaces mpc8xx_wdt.c (only usable for ARCH=ppc) and mpc83xx_wdt.c (untested on this platform). Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/platforms/8xx/mpc86xads_setup.c |5 + arch/powerpc/platforms/8xx/mpc885ads_setup.c |5 + arch/powerpc/sysdev/Makefile |3 + arch/powerpc/sysdev/pq_wdt.c | 204 +++ arch/powerpc/sysdev/pq_wdt.h | 28 drivers/watchdog/Kconfig | 13 ++- drivers/watchdog/Makefile|1 + drivers/watchdog/pq_wdt.c| 222 ++ 8 files changed, 480 insertions(+), 1 deletions(-) create mode 100644 arch/powerpc/sysdev/pq_wdt.c create mode 100644 arch/powerpc/sysdev/pq_wdt.h create mode 100644 drivers/watchdog/pq_wdt.c diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c b/arch/powerpc/platforms/8xx/mpc86xads_setup.c index 4901283..c468ec2 100644 --- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c @@ -38,6 +38,7 @@ #include #include +#include static void init_smc1_uart_ioports(struct fs_uart_platform_info* fpi); static void init_smc2_uart_ioports(struct fs_uart_platform_info* fpi); @@ -251,6 +252,10 @@ static void __init mpc86xads_setup_arch(void) mpc86xads_board_setup(); ROOT_DEV = Root_NFS; + +#if defined(CONFIG_PQ_WDT) || defined(CONFIG_PQ_WDT_MODULE) + pq_wdt_early_init(); +#endif } static int __init mpc86xads_probe(void) diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c index 2cf1b6a..f076b67 100644 --- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c @@ -41,6 +41,7 @@ #include #include +#include static u32 __iomem *bcsr, *bcsr5; @@ -246,6 +247,10 @@ static void __init mpc885ads_setup_arch(void) m8xx_pcmcia_ops.hw_ctrl = pcmcia_hw_setup; m8xx_pcmcia_ops.voltage_set = pcmcia_set_voltage; #endif + +#if defined(CONFIG_PQ_WDT) || defined(CONFIG_PQ_WDT_MODULE) + pq_wdt_early_init(); +#endif } static int __init mpc885ads_probe(void) diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile index 99a77d7..84f190e 100644 --- a/arch/powerpc/sysdev/Makefile +++ b/arch/powerpc/sysdev/Makefile @@ -35,5 +35,8 @@ obj-$(CONFIG_CPM) += cpm_common.o obj-$(CONFIG_CPM2) += cpm2_common.o cpm2_pic.o obj-$(CONFIG_PPC_DCR) += dcr.o obj-$(CONFIG_8xx) += mpc8xx_pic.o commproc.o +ifneq ($(CONFIG_PQ_WDT),) +obj-y += pq_wdt.o +endif obj-$(CONFIG_UCODE_PATCH) += micropatch.o endif diff --git a/arch/powerpc/sysdev/pq_wdt.c b/arch/powerpc/sysdev/pq_wdt.c new file mode 100644 index 000..0adbe42 --- /dev/null +++ b/arch/powerpc/sysdev/pq_wdt.c @@ -0,0 +1,204 @@ +/* + * pq_wdt.c - Freescale PowerQUICC watchdog driver + * + * Author: Florian Schirmer <[EMAIL PROTECTED]> + * + * 2002 (c) Florian Schirmer <[EMAIL PROTECTED]> This file is licensed under + * the terms of the GNU General Public License version 2. This program + * is licensed "as is" without any warranty of any kind, whether express + * or implied. + * + * 2007 (c) Jochen Friedrich <[EMAIL PROTECTED]> ported to ARCH=powerpc and + * extended to be useful on any Power QUICC 1/2/2pro which have the same + * style of watchdog. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "pq_wdt.h" + +struct pq_wdt { + __be32 res0; + __be32 swcrr; /* System watchdog control register */ + __be32 swcnr; /* System watchdog count register */ + u8 res1[2]; + __be16 swsrr; /* System watchdog service register */ +}; + +static int wdt_timeout; +static int wdt_freq; +static struct pq_wdt __iomem *wdt_reg; +static int wdt_scale; + +void pq_wdt_reset(void) +{ + if (!wdt_reg) + return; + + out_be16(&wdt_reg->swsrr, 0x556c); /* write magic1 */ + out_be16(&wdt_reg->swsrr, 0xaa39); /* write magic2 */ +} +EXPORT_SYMBOL(pq_wdt_reset); + +static void wdt_timer_func(unsigned long data); + +static struct timer_list wdt_timer = + TIMER_INITIALIZER(wdt_timer_func, 0, 0); + +void pq_wdt_stop_timer(void) +{ + del_timer(&wdt_timer); +} +EXPORT_SYMBOL_GPL(pq_wdt_stop_timer); + +void pq_wdt_install_timer(void) +{ + pq_wdt_reset(); + mod_timer(&w
Re: [PATCHv2] powerpc: DBox2 Board Support
Hi Arnd, This patch adds device tree source, default config and setup code for DBox2 devices. ia > Cool stuff. I used to have one of these boxes myself, maybe I should get one again when it's hitting mainline. Is this already a complete port, or do you also need some device drivers or boot wrapper code to go along with it? Currently, it needs the u-boot patches from cvs.tuxbox.org and some external device drivers (however, they can all be loaded as modules). The port is complete enough to get a console on the serial port and a rootfs either on flash or on nfs. + memory { + device_type = "memory"; + reg = <0 200>; + }; I thought there are both models with 32MB and 16MB available. If that's true, shouldn't this be filled out by the boot loader? IIRC, the cuImage wrapper overwrites this with the boot loader parameters. OTOH, the memory is part of the localbus (CS1). Should it be a child of localbus in this case? +# +# Frame buffer hardware drivers +# +# CONFIG_FB_OF is not set +# CONFIG_FB_VGA16 is not set +# CONFIG_FB_S1D13XXX is not set +# CONFIG_FB_IBM_GXT4500 is not set +# CONFIG_FB_VIRTUAL is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set No hardware framebuffer driver? Can't you use the FB_OF driver by default? I'd guess that a set-top box without output is rather pointless ;-) I didn't check FB_OF. On Dbox2, the avia driver creates a framebuffer device. +# DOS/FAT/NT Filesystems +# +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +# CONFIG_NTFS_FS is not set What media can you connect that use the FAT file system? I'd guess that if you can get rid of these, you can also disable the entire block layer, which should free up some kernel memory. There are two mods available using the block layer, although currently i don't support any of them: 1. using the GPIO lines of the modem port, it's possible to connect a SD card. It might be possible to use it using the GPIO SPI driver (but it would need some glue code to create a platform device). 2. using the memory expansion port and CS2, there is an IDE interface available with a CPLD acting as localbus/IDE bridge. There is a device driver for ARCH=ppc. Unfortunately, i don't own any of these modifications. + +/* Vendor information in BR Bootloader + */ + +#define DBOX2_VENDOR_OFFSET(0x1ffe0) + +enum dbox2_mid { + DBOX2_MID_NOKIA = 1, + DBOX2_MID_PHILIPS = 2, + DBOX2_MID_SAGEM = 3, +}; + +enum dbox2_mid dbox2_get_mid(void); Can you move this functionality from the kernel to the boot wrapper? It looks like this is something that really belongs into the device tree. OK. + if (dbox2_manuf_id == DBOX2_MID_NOKIA) + np = of_find_node_by_path("/[EMAIL PROTECTED]/[EMAIL PROTECTED]"); + else + np = of_find_node_by_path("/[EMAIL PROTECTED]/[EMAIL PROTECTED]"); + + if (np) { + of_detach_node(np); + of_node_put(np); + } + + if (dbox2_manuf_id == DBOX2_MID_PHILIPS) + np = of_find_node_by_path("/[EMAIL PROTECTED]/[EMAIL PROTECTED]"); + else + np = of_find_node_by_path("/[EMAIL PROTECTED]/[EMAIL PROTECTED]"); + + if (np) { + of_detach_node(np); + of_node_put(np); + } +} What is this code for? Why do you want to detach nodes from the device tree that have been put in there by the boot loader? There are small differences between the 3 manufacturers. I guess this should go to the boot wrapper, as well. This is even more important if the localbus uses #address-cells = <2>, as the differen manufacturers set up the address mapping for CS3, CS5 and CS7 differently. +static void __init dbox2_setup_arch(void) +{ + struct device_node *np; + static u8 __iomem *config; + + cpm_reset(); + init_ioports(); + + /* Enable external IRQs for AVIA chips */ + clrbits32(&mpc8xx_immr->im_siu_conf.sc_siumcr, 0x0c00); This smells like a hack. What are AVIA chips, and shouldn't their driver enable the IRQs? No. This just configures the Pin as IRQ input. Maybe, the new GPIO functions could be used for this, instead. Then it could be done in the driver (the driver should't directly mess with SIU internals). +static struct of_device_id __initdata of_bus_ids[] = { + { .name = "soc", }, + { .name = "cpm", }, + { .name = "localbus", }, + {}, +}; Shouldn't this check for 'compatible' properties instead of 'name'? I copied this from mpc885ads_setup.c. +static int __init declare_of_platform_devices(void) +{ + /* Publish the QE devices */ + if (machine_is(dbox2)) + of_platform_bus_probe(NULL, of_bus_ids, NULL); + + return 0; +} +device_initcall(declare_of_platform_devices); This is a candidate for the new platform_initcall
[PATCH] i2c: adds support for i2c bus on Frescale CPM1/CPM2 controllers
Using the port of 2.4 code from Vitaly Bordug <[EMAIL PROTECTED]> and the actual algorithm used by the i2c driver of the DBox code on cvs.tuxboc.org from Tmbinc, Gillem ([EMAIL PROTECTED]). Renamed i2c-rpx.c and i2c-algo-8xx.c to i2c-cpm.c and converted the driver to an of_platform_driver. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/boot/dts/mpc8272ads.dts | 10 + arch/powerpc/boot/dts/mpc866ads.dts | 10 + arch/powerpc/boot/dts/mpc885ads.dts | 10 + arch/powerpc/platforms/8xx/mpc885ads_setup.c |5 + drivers/i2c/busses/Kconfig | 10 + drivers/i2c/busses/Makefile |1 + drivers/i2c/busses/i2c-cpm.c | 757 ++ 7 files changed, 803 insertions(+), 0 deletions(-) create mode 100644 drivers/i2c/busses/i2c-cpm.c diff --git a/arch/powerpc/boot/dts/mpc8272ads.dts b/arch/powerpc/boot/dts/mpc8272ads.dts index 7285ca1..7273996 100644 --- a/arch/powerpc/boot/dts/mpc8272ads.dts +++ b/arch/powerpc/boot/dts/mpc8272ads.dts @@ -215,6 +215,16 @@ linux,network-index = <1>; fsl,cpm-command = <16200300>; }; + + [EMAIL PROTECTED] { + compatible = "fsl,mpc8248-i2c", +"fsl,cpm2-i2c", +"fsl,cpm-i2c"; + reg = <11860 20 8afc 2>; + interrupts = <1 8>; + interrupt-parent = <&PIC>; + fsl,cpm-command = <2960>; + }; }; PIC: [EMAIL PROTECTED] { diff --git a/arch/powerpc/boot/dts/mpc866ads.dts b/arch/powerpc/boot/dts/mpc866ads.dts index 90f2293..c79cac1 100644 --- a/arch/powerpc/boot/dts/mpc866ads.dts +++ b/arch/powerpc/boot/dts/mpc866ads.dts @@ -141,6 +141,16 @@ interrupts = <1e 3>; interrupt-parent = <&Cpm_pic>; }; + + [EMAIL PROTECTED] { + compatible = "fsl,mpc866-i2c", +"fsl,cpm1-i2c", +"fsl,cpm-i2c"; + reg = <860 20 3c80 30>; + interrupts = <10 3>; + interrupt-parent = <&Cpm_pic>; + fsl,cpm-command = <0010>; + }; }; }; }; diff --git a/arch/powerpc/boot/dts/mpc885ads.dts b/arch/powerpc/boot/dts/mpc885ads.dts index 8848e63..fd9c9d7 100644 --- a/arch/powerpc/boot/dts/mpc885ads.dts +++ b/arch/powerpc/boot/dts/mpc885ads.dts @@ -213,6 +213,16 @@ fsl,cpm-command = <0080>; linux,network-index = <2>; }; + + [EMAIL PROTECTED] { + compatible = "fsl,mpc885-i2c", +"fsl,cpm1-i2c", +"fsl,cpm-i2c"; + reg = <860 20 3c80 30>; + interrupts = <10>; + interrupt-parent = <&CPM_PIC>; + fsl,cpm-command = <0010>; + }; }; }; diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c index 2cf1b6a..4377521 100644 --- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c @@ -157,6 +157,11 @@ static struct cpm_pin mpc885ads_pins[] = { {CPM_PORTE, 28, CPM_PIN_OUTPUT}, {CPM_PORTE, 29, CPM_PIN_OUTPUT}, #endif + /* I2C */ +#ifdef CONFIG_I2C_8XX + {CPM_PORTB, 26, CPM_PIN_INPUT | CPM_PIN_OPENDRAIN}, + {CPM_PORTB, 27, CPM_PIN_INPUT | CPM_PIN_OPENDRAIN}, +#endif }; static void __init init_ioports(void) diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index c466c6c..5950172 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig @@ -114,6 +114,16 @@ config I2C_BLACKFIN_TWI_CLK_KHZ help The unit of the TWI clock is kHz. +config I2C_CPM + tristate "Freescale CPM1 or CPM2 (MPC8xx/826x)" + depends on (CPM1 || CPM2) && I2C && PPC_OF + help + This supports the use of the I2C interface on Freescale + processors with CPM1 or CPM2. + + This driver can also be built as a module. If so, the module +
[PATCHv2] powerpc: DBox2 Board Support
This patch adds device tree source, default config and setup code for DBox2 devices. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/boot/dts/dbox2.dts | 263 arch/powerpc/configs/dbox2_defconfig | 1042 ++ arch/powerpc/platforms/8xx/Kconfig |7 + arch/powerpc/platforms/8xx/Makefile |1 + arch/powerpc/platforms/8xx/dbox2.h | 30 + arch/powerpc/platforms/8xx/dbox2_setup.c | 226 +++ include/asm-powerpc/mpc8xx.h |4 + 7 files changed, 1573 insertions(+), 0 deletions(-) create mode 100644 arch/powerpc/boot/dts/dbox2.dts create mode 100644 arch/powerpc/configs/dbox2_defconfig create mode 100644 arch/powerpc/platforms/8xx/dbox2.h create mode 100644 arch/powerpc/platforms/8xx/dbox2_setup.c diff --git a/arch/powerpc/boot/dts/dbox2.dts b/arch/powerpc/boot/dts/dbox2.dts new file mode 100644 index 000..8d91510 --- /dev/null +++ b/arch/powerpc/boot/dts/dbox2.dts @@ -0,0 +1,263 @@ +/* + * DBOX2 Device Tree Source + * + * Copyright 2007 Jochen Friedrich <[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. + */ + +/ { + model = "Dbox2"; + compatible = "betaresearch,dbox2"; + #address-cells = <1>; + #size-cells = <1>; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + PowerPC,[EMAIL PROTECTED] { + device_type = "cpu"; + reg = <0>; + d-cache-line-size = ; + i-cache-line-size = ; + d-cache-size = ; + i-cache-size = ; + timebase-frequency = <0>; + bus-frequency = <0>; + clock-frequency = <0>; + interrupts = ; // decrementer interrupt + interrupt-parent = <&PIC>; + }; + }; + + memory { + device_type = "memory"; + reg = <0 200>; + }; + + [EMAIL PROTECTED] { + compatible = "betaresearch,dbox2-localbus"; + #address-cells = <1>; + #size-cells = <1>; + reg = <800 1800>; + + ranges = <0 800 1800>; + + [EMAIL PROTECTED] { + compatible = "c-cube,enx"; + reg = <0 3400 100 20>; + interrupts = <2 2>; + interrupt-parent = <&PIC>; + }; + + [EMAIL PROTECTED] { + compatible = "c-cube,gtx"; + reg = <40 3000 0 20>; + interrupts = <2 2>; + interrupt-parent = <&PIC>; + }; + + [EMAIL PROTECTED] { + compatible = "betaresearch,dbox2-fp"; + interrupts = <4 2>; + interrupt-parent = <&PIC>; + gpios = <0 e>; + gpio-parent = <&CPM1_PIO>; + }; + + [EMAIL PROTECTED] { + compatible = "betaresearch,dbox2-fe"; + interrupts = ; + interrupt-parent = <&PIC>; + }; + + [EMAIL PROTECTED] { + compatible = "c-cube,avia"; + reg = <200 200>; + interrupts = <8 2>; + interrupt-parent = <&PIC>; + }; + [EMAIL PROTECTED] { + compatible = "betaresearch,dbox2-cam"; + reg = <400 2>; + interrupts = <6 2>; + interrupt-parent = <&PIC>; + gpios = <1 1c 1 1d 1 1e 1 1f>; + gpio-parent = <&CPM1_PIO>; + }; + + [EMAIL PROTECTED] { + compatible = "betaresearch,dbox2-cam"; + reg = <404 2>; + interrupts = <6 2>; + interrupt-parent = <&PIC>; + gpios = <1 1c 1 1d 1 1e 1 1f>; + gpio-parent = <&CPM1_PIO>; + }; + + [EMAIL PROTECTED] { +
Re: [PATCH] powerpc: DBox2 Board Support
Jochen Friedrich schrieb: This patch adds device tree source, default config and setup code for DBox2 devices. please ignore this posting. This patch doesn't compile cleanly, i'll repost a fixed patch. Thanks, Jochen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] powerpc: DBox2 Board Support
This patch adds device tree source, default config and setup code for DBox2 devices. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/boot/dts/dbox2.dts | 263 arch/powerpc/configs/dbox2_defconfig | 1042 ++ arch/powerpc/platforms/8xx/Kconfig |7 + arch/powerpc/platforms/8xx/Makefile |1 + arch/powerpc/platforms/8xx/dbox2.h | 30 + arch/powerpc/platforms/8xx/dbox2_setup.c | 226 +++ include/asm-powerpc/mpc8xx.h |4 + 7 files changed, 1573 insertions(+), 0 deletions(-) create mode 100644 arch/powerpc/boot/dts/dbox2.dts create mode 100644 arch/powerpc/configs/dbox2_defconfig create mode 100644 arch/powerpc/platforms/8xx/dbox2.h create mode 100644 arch/powerpc/platforms/8xx/dbox2_setup.c diff --git a/arch/powerpc/boot/dts/dbox2.dts b/arch/powerpc/boot/dts/dbox2.dts new file mode 100644 index 000..8d91510 --- /dev/null +++ b/arch/powerpc/boot/dts/dbox2.dts @@ -0,0 +1,263 @@ +/* + * DBOX2 Device Tree Source + * + * Copyright 2007 Jochen Friedrich <[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. + */ + +/ { + model = "Dbox2"; + compatible = "betaresearch,dbox2"; + #address-cells = <1>; + #size-cells = <1>; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + PowerPC,[EMAIL PROTECTED] { + device_type = "cpu"; + reg = <0>; + d-cache-line-size = ; + i-cache-line-size = ; + d-cache-size = ; + i-cache-size = ; + timebase-frequency = <0>; + bus-frequency = <0>; + clock-frequency = <0>; + interrupts = ; // decrementer interrupt + interrupt-parent = <&PIC>; + }; + }; + + memory { + device_type = "memory"; + reg = <0 200>; + }; + + [EMAIL PROTECTED] { + compatible = "betaresearch,dbox2-localbus"; + #address-cells = <1>; + #size-cells = <1>; + reg = <800 1800>; + + ranges = <0 800 1800>; + + [EMAIL PROTECTED] { + compatible = "c-cube,enx"; + reg = <0 3400 100 20>; + interrupts = <2 2>; + interrupt-parent = <&PIC>; + }; + + [EMAIL PROTECTED] { + compatible = "c-cube,gtx"; + reg = <40 3000 0 20>; + interrupts = <2 2>; + interrupt-parent = <&PIC>; + }; + + [EMAIL PROTECTED] { + compatible = "betaresearch,dbox2-fp"; + interrupts = <4 2>; + interrupt-parent = <&PIC>; + gpios = <0 e>; + gpio-parent = <&CPM1_PIO>; + }; + + [EMAIL PROTECTED] { + compatible = "betaresearch,dbox2-fe"; + interrupts = ; + interrupt-parent = <&PIC>; + }; + + [EMAIL PROTECTED] { + compatible = "c-cube,avia"; + reg = <200 200>; + interrupts = <8 2>; + interrupt-parent = <&PIC>; + }; + [EMAIL PROTECTED] { + compatible = "betaresearch,dbox2-cam"; + reg = <400 2>; + interrupts = <6 2>; + interrupt-parent = <&PIC>; + gpios = <1 1c 1 1d 1 1e 1 1f>; + gpio-parent = <&CPM1_PIO>; + }; + + [EMAIL PROTECTED] { + compatible = "betaresearch,dbox2-cam"; + reg = <404 2>; + interrupts = <6 2>; + interrupt-parent = <&PIC>; + gpios = <1 1c 1 1d 1 1e 1 1f>; + gpio-parent = <&CPM1_PIO>; + }; + + [EMAIL PROTECTED] { +
Re: [PATCH POWERPC] i2c: adds support for i2c bus on Frescale CPM1/CPM2 controllers
Hi Vitaly, I had an attempt a while ago to do this but haven't had enough time to get it completed, so I am glad to see it finally picked up. There was some sort of discussion that time, you seem to have some of those points addressed but something not, please check: http://lkml.org/lkml/2007/5/8/45 (for instance, cpm_i2c_shutdown() and i2c_cpm_del_bus() are void because they cant' fail) I'll resend a fixed patch. Also, why this was directed to Scott? This is lm-sensors stuff and is Jean Delvare <[EMAIL PROTECTED]> material.. Scott reviewed this driver last time and i hope to get some further comments from him. But thanks for adding Jean as well. Thanks, Jochen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH POWERPC] i2c: adds support for i2c bus on Frescale CPM1/CPM2 controllers
Using the port of 2.4 code from Vitaly Bordug <[EMAIL PROTECTED]> and the actual algorithm used by the i2c driver of the DBox code on cvs.tuxboc.org from Tmbinc, Gillem ([EMAIL PROTECTED]). Renamed i2c-rpx.c and i2c-algo-8xx.c to i2c-cpm.c and converted the driver to an of_platform_driver. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/boot/dts/mpc866ads.dts | 10 + arch/powerpc/boot/dts/mpc885ads.dts | 10 + arch/powerpc/platforms/8xx/mpc885ads_setup.c |5 + drivers/i2c/busses/Kconfig | 10 + drivers/i2c/busses/Makefile |1 + drivers/i2c/busses/i2c-cpm.c | 776 ++ 6 files changed, 812 insertions(+), 0 deletions(-) create mode 100644 drivers/i2c/busses/i2c-cpm.c diff --git a/arch/powerpc/boot/dts/mpc866ads.dts b/arch/powerpc/boot/dts/mpc866ads.dts index 90f2293..c79cac1 100644 --- a/arch/powerpc/boot/dts/mpc866ads.dts +++ b/arch/powerpc/boot/dts/mpc866ads.dts @@ -141,6 +141,16 @@ interrupts = <1e 3>; interrupt-parent = <&Cpm_pic>; }; + + [EMAIL PROTECTED] { + compatible = "fsl,mpc866-i2c", +"fsl,cpm1-i2c", +"fsl,cpm-i2c"; + reg = <860 20 3c80 30>; + interrupts = <10 3>; + interrupt-parent = <&Cpm_pic>; + fsl,cpm-command = <0010>; + }; }; }; }; diff --git a/arch/powerpc/boot/dts/mpc885ads.dts b/arch/powerpc/boot/dts/mpc885ads.dts index 8848e63..fd9c9d7 100644 --- a/arch/powerpc/boot/dts/mpc885ads.dts +++ b/arch/powerpc/boot/dts/mpc885ads.dts @@ -213,6 +213,16 @@ fsl,cpm-command = <0080>; linux,network-index = <2>; }; + + [EMAIL PROTECTED] { + compatible = "fsl,mpc885-i2c", +"fsl,cpm1-i2c", +"fsl,cpm-i2c"; + reg = <860 20 3c80 30>; + interrupts = <10>; + interrupt-parent = <&CPM_PIC>; + fsl,cpm-command = <0010>; + }; }; }; diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c index 2cf1b6a..4377521 100644 --- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c @@ -157,6 +157,11 @@ static struct cpm_pin mpc885ads_pins[] = { {CPM_PORTE, 28, CPM_PIN_OUTPUT}, {CPM_PORTE, 29, CPM_PIN_OUTPUT}, #endif + /* I2C */ +#ifdef CONFIG_I2C_8XX + {CPM_PORTB, 26, CPM_PIN_INPUT | CPM_PIN_OPENDRAIN}, + {CPM_PORTB, 27, CPM_PIN_INPUT | CPM_PIN_OPENDRAIN}, +#endif }; static void __init init_ioports(void) diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index c466c6c..5950172 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig @@ -114,6 +114,16 @@ config I2C_BLACKFIN_TWI_CLK_KHZ help The unit of the TWI clock is kHz. +config I2C_CPM + tristate "Freescale CPM1 or CPM2 (MPC8xx/826x)" + depends on (CPM1 || CPM2) && I2C && PPC_OF + help + This supports the use of the I2C interface on Freescale + processors with CPM1 or CPM2. + + This driver can also be built as a module. If so, the module + will be called i2c-cpm. + config I2C_DAVINCI tristate "DaVinci I2C driver" depends on ARCH_DAVINCI diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile index 81d43c2..a39 100644 --- a/drivers/i2c/busses/Makefile +++ b/drivers/i2c/busses/Makefile @@ -11,6 +11,7 @@ obj-$(CONFIG_I2C_AMD8111) += i2c-amd8111.o obj-$(CONFIG_I2C_AT91) += i2c-at91.o obj-$(CONFIG_I2C_AU1550)+= i2c-au1550.o obj-$(CONFIG_I2C_BLACKFIN_TWI) += i2c-bfin-twi.o +obj-$(CONFIG_I2C_CPM) += i2c-cpm.o obj-$(CONFIG_I2C_DAVINCI) += i2c-davinci.o obj-$(CONFIG_I2C_ELEKTOR) += i2c-elektor.o obj-$(CONFIG_I2C_GPIO) += i2c-gpio.o diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c new file mode 100644 index 000..c3714f6 --- /dev/null +++ b/drivers/i2c/busses/i2c-cpm.c @@ -0,0 +1,776 @@ +/* + * Freescale CPM1/CPM2 I2C interface. + * Copyright (c) 1999 Dan Malek ([EMAIL PROTECTED]). + * + * moved into proper i2c interface; + * Brad Parker ([EMAIL PROT
[PATCH] [POWERPC] Add fixed-phy support for fs_enet
This patch adds support to use the fixed-link property of an ethernet node to fs_enet for the CONFIG_PPC_CPM_NEW_BINDING case. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> Acked-by: Jeff Garzik <[EMAIL PROTECTED]> Acked-by: Vitali Bordug <[EMAIL PROTECTED]> --- drivers/net/fs_enet/fs_enet-main.c |9 - 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c index f2a4d39..8220c70 100644 --- a/drivers/net/fs_enet/fs_enet-main.c +++ b/drivers/net/fs_enet/fs_enet-main.c @@ -1174,8 +1174,15 @@ static int __devinit find_phy(struct device_node *np, struct device_node *phynode, *mdionode; struct resource res; int ret = 0, len; + const u32 *data; + + data = of_get_property(np, "fixed-link", NULL); + if (data) { + snprintf(fpi->bus_id, 16, PHY_ID_FMT, 0, *data); + return 0; + } - const u32 *data = of_get_property(np, "phy-handle", &len); + data = of_get_property(np, "phy-handle", &len); if (!data || len != 4) return -EINVAL; -- 1.5.3.7 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH/RFC] [POWERPC] Add fixed-phy support for fs_enet
Hi Jeff, > ACK, pass this through paulus? Yes, that's fine for me. Thanks, Jochen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] dio: fix kernel-doc notation
> From: Randy Dunlap <[EMAIL PROTECTED]> > > Fix kernel-doc in drivers/dio/ so that it is formatted correctly > and the parameter names match the function parameters. > > Signed-off-by: Randy Dunlap <[EMAIL PROTECTED]> Acked-By: Jochen Friedrich <[EMAIL PROTECTED]> -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH/RFC] [POWERPC] Add fixed-phy support for fs_enet
This patch adds support to use the fixed-link property of an ethernet node to fs_enet for the CONFIG_PPC_CPM_NEW_BINDING case. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- drivers/net/fs_enet/fs_enet-main.c |9 - 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c index f2a4d39..8220c70 100644 --- a/drivers/net/fs_enet/fs_enet-main.c +++ b/drivers/net/fs_enet/fs_enet-main.c @@ -1174,8 +1174,15 @@ static int __devinit find_phy(struct device_node *np, struct device_node *phynode, *mdionode; struct resource res; int ret = 0, len; + const u32 *data; + + data = of_get_property(np, "fixed-link", NULL); + if (data) { + snprintf(fpi->bus_id, 16, PHY_ID_FMT, 0, *data); + return 0; + } - const u32 *data = of_get_property(np, "phy-handle", &len); + data = of_get_property(np, "phy-handle", &len); if (!data || len != 4) return -EINVAL; -- 1.5.3.7 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/3] [NET] phy/fixed.c: rework to not duplicate PHY layer functionality
Hi Vitaly, With that patch fixed.c now fully emulates MDIO bus, thus no need to duplicate PHY layer functionality. That, in turn, drastically simplifies the code, and drops down line count. As an additional bonus, now there is no need to register MDIO bus for each PHY, all emulated PHYs placed on the platform fixed MDIO bus. There is also no more need to pre-allocate PHYs via .config option, this is all now handled dynamically. p.s. Don't even try to understand patch content! Better: apply patch and look into resulting drivers/net/phy/fixed.c. If i understand your code correctly, you seem to rely on the fact that fixed_phy_add() is called before the fixed MDIO bus is scanned for devices. How is this supposed to work for modules or for the PPC_CPM_NEW_BINDING mode where the device tree is no longer scanned during fs_soc initialization but during device initialization? I tried to add fixed-phy support to fs_enet, but the fixed phy is not found this way. --- a/drivers/net/fs_enet/fs_enet-main.c +++ b/drivers/net/fs_enet/fs_enet-main.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -1174,8 +1175,24 @@ static int __devinit find_phy(struct device_node *np, struct device_node *phynode, *mdionode; struct resource res; int ret = 0, len; + const u32 *data; + struct fixed_phy_status status = {}; + + data = of_get_property(np, "fixed-link", NULL); + if (data) { + status.link = 1; + status.duplex = data[1]; + status.speed = data[2]; + + ret = fixed_phy_add(PHY_POLL, data[0], &status); + if (ret) + return ret; + + snprintf(fpi->bus_id, 16, PHY_ID_FMT, 0, *data); + return 0; + } - const u32 *data = of_get_property(np, "phy-handle", &len); + data = of_get_property(np, "phy-handle", &len); if (!data || len != 4) return -EINVAL; Thanks, Jochen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] powerpc: Change _tlbie arguments to reflect new API
A new pid argument has been added to _tlbie for 4xx platforms. Add this argument to the 8xx path in mem.c, as well. As 8xx does not need th epid information, this argument can always be 0. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> CC arch/powerpc/mm/mem.o arch/powerpc/mm/mem.c: In function 'update_mmu_cache': arch/powerpc/mm/mem.c:467: error: too few arguments to function '_tlbie' make[1]: *** [arch/powerpc/mm/mem.o] Error 1 make: *** [arch/powerpc/mm] Error 2 --- arch/powerpc/mm/mem.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 81eb96e..e07852e 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c @@ -464,7 +464,7 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, * we invalidate the TLB here, thus avoiding dcbst * misbehaviour. */ - _tlbie(address); + _tlbie(address, 0); #endif if (!PageReserved(page) && !test_bit(PG_arch_1, &page->flags)) { -- 1.5.3.4 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH try2] powerpc: Add support for PORTA and PORTB odr registers
PORTA and PORTB have odr registers, as well. However, the PORTB odr register is only 16bit. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/sysdev/commproc.c | 19 --- 1 files changed, 16 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c index d5a0dcf..c0d00c2 100644 --- a/arch/powerpc/sysdev/commproc.c +++ b/arch/powerpc/sysdev/commproc.c @@ -411,7 +411,7 @@ EXPORT_SYMBOL(cpm_dpram_phys); #endif /* !CONFIG_PPC_CPM_NEW_BINDING */ struct cpm_ioport16 { - __be16 dir, par, sor, dat, intr; + __be16 dir, par, odr_sor, dat, intr; __be16 res[3]; }; @@ -441,6 +441,13 @@ static void cpm1_set_pin32(int port, int pin, int flags) else clrbits32(&iop->par, pin); + if (port == CPM_PORTB) { + if (flags & CPM_PIN_OPENDRAIN) + setbits16(&mpc8xx_immr->im_cpm.cp_pbodr, pin); + else + clrbits16(&mpc8xx_immr->im_cpm.cp_pbodr, pin); + } + if (port == CPM_PORTE) { if (flags & CPM_PIN_SECONDARY) setbits32(&iop->sor, pin); @@ -474,11 +481,17 @@ static void cpm1_set_pin16(int port, int pin, int flags) else clrbits16(&iop->par, pin); + if (port == CPM_PORTA) { + if (flags & CPM_PIN_OPENDRAIN) + setbits16(&iop->odr_sor, pin); + else + clrbits16(&iop->odr_sor, pin); + } if (port == CPM_PORTC) { if (flags & CPM_PIN_SECONDARY) - setbits16(&iop->sor, pin); + setbits16(&iop->odr_sor, pin); else - clrbits16(&iop->sor, pin); + clrbits16(&iop->odr_sor, pin); } } -- 1.5.3.4 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] powerpc: Fix fs_enet module build
Hi David, > This is truly ugly and creates an unnecessarily hard to > maintain and complex driver. > > Please find a way to fix this for real, so that the > PPC_CPM_NEW_BINDING ifdef is not necessary at all and > things get built modular or not naturally as we handle > things for other cases like this. I know it's ugly, however, module building is completely broken right now and I just want to provide a quick and ugly fix until both that ppc->powerpc transition and the new binding transition are over. Noone wants to touch the old stuff any more as it's a pita and it's already scheduled for removal in a couple of months. Thanks, Jochen - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] powerpc: Fix fs_enet module build
If fs_enet is build as module, on PPC_CPM_NEW_BINDING platforms mii-fec/mii-bitbang should be build as module, as well. On other platforms, mii-fec/mii-bitbang must be included into the main module. Otherwise some symbols remain undefined. Additionally, fs_enet uses libphy, so add a select PHYLIB. Building modules, stage 2. MODPOST 5 modules ERROR: "fs_scc_ops" [drivers/net/fs_enet/fs_enet.ko] undefined! make[1]: *** [__modpost] Error 1 make: *** [modules] Error 2 Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- This patch replaces powerpc-fs_enet-select-phylib-as-the-driver-needs-it.patch from -mm. drivers/net/fs_enet/Kconfig | 11 ++- drivers/net/fs_enet/Makefile | 15 --- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/drivers/net/fs_enet/Kconfig b/drivers/net/fs_enet/Kconfig index 2765e49..562ea68 100644 --- a/drivers/net/fs_enet/Kconfig +++ b/drivers/net/fs_enet/Kconfig @@ -2,6 +2,7 @@ config FS_ENET tristate "Freescale Ethernet Driver" depends on CPM1 || CPM2 select MII + select PHYLIB config FS_ENET_HAS_SCC bool "Chip has an SCC usable for ethernet" @@ -11,11 +12,19 @@ config FS_ENET_HAS_SCC config FS_ENET_HAS_FCC bool "Chip has an FCC usable for ethernet" depends on FS_ENET && CPM2 - select MDIO_BITBANG default y config FS_ENET_HAS_FEC bool "Chip has an FEC usable for ethernet" depends on FS_ENET && CPM1 + select FS_ENET_MDIO_FEC default y +config FS_ENET_MDIO_FEC + tristate "MDIO driver for FEC" + depends on FS_ENET && CPM1 + +config FS_ENET_MDIO_FCC + tristate "MDIO driver for FCC" + depends on FS_ENET && CPM2 + select MDIO_BITBANG diff --git a/drivers/net/fs_enet/Makefile b/drivers/net/fs_enet/Makefile index 02d4dc1..1ffbe07 100644 --- a/drivers/net/fs_enet/Makefile +++ b/drivers/net/fs_enet/Makefile @@ -4,7 +4,16 @@ obj-$(CONFIG_FS_ENET) += fs_enet.o -obj-$(CONFIG_8xx) += mac-fec.o mac-scc.o mii-fec.o -obj-$(CONFIG_CPM2) += mac-fcc.o mii-bitbang.o +fs_enet-$(CONFIG_FS_ENET_HAS_SCC) += mac-scc.o +fs_enet-$(CONFIG_FS_ENET_HAS_FEC) += mac-fec.o +fs_enet-$(CONFIG_FS_ENET_HAS_FCC) += mac-fcc.o -fs_enet-objs := fs_enet-main.o +ifeq ($(CONFIG_PPC_CPM_NEW_BINDING),y) +obj-$(CONFIG_FS_ENET_MDIO_FEC) += mii-fec.o +obj-$(CONFIG_FS_ENET_MDIO_FCC) += mii-bitbang.o +else +fs_enet-$(CONFIG_FS_ENET_MDIO_FEC) += mii-fec.o +fs_enet-$(CONFIG_FS_ENET_MDIO_FCC) += mii-bitbang.o +endif + +fs_enet-objs := fs_enet-main.o $(fs_enet-m) -- 1.5.3.5 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] powerpc: Add support for PORTA and PORTB odr registers
PORTA and PORTB have odr registers, as well. However, the PORTB odr register is only 16bit. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/sysdev/commproc.c | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c index d5a0dcf..3694a69 100644 --- a/arch/powerpc/sysdev/commproc.c +++ b/arch/powerpc/sysdev/commproc.c @@ -441,6 +441,13 @@ static void cpm1_set_pin32(int port, int pin, int flags) else clrbits32(&iop->par, pin); + if (port == CPM_PORTB) { + if (flags & CPM_PIN_OPENDRAIN) + setbits16(&mpc8xx_immr->im_cpm.cp_pbodr, pin); + else + clrbits16(&mpc8xx_immr->im_cpm.cp_pbodr, pin); + } + if (port == CPM_PORTE) { if (flags & CPM_PIN_SECONDARY) setbits32(&iop->sor, pin); @@ -474,6 +481,12 @@ static void cpm1_set_pin16(int port, int pin, int flags) else clrbits16(&iop->par, pin); + if (port == CPM_PORTA) { + if (flags & CPM_PIN_OPENDRAIN) + setbits16(&iop->odr, pin); + else + clrbits16(&iop->odr, pin); + } if (port == CPM_PORTC) { if (flags & CPM_PIN_SECONDARY) setbits16(&iop->sor, pin); -- 1.5.3.5 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] powerpc: Add support for PORTA sor and PORTB odr registers
PORTA has an so register and PORTB had an odr register, as well. However, the PORTB odr register is only 16bit. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/sysdev/commproc.c |9 - 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c index f6a6378..a9f5fcf 100644 --- a/arch/powerpc/sysdev/commproc.c +++ b/arch/powerpc/sysdev/commproc.c @@ -438,6 +438,13 @@ static void cpm1_set_pin32(int port, int pin, int flags) else clrbits32(&iop->par, pin); + if (port == CPM_PORTB) { + if (flags & CPM_PIN_OPENDRAIN) + setbits16(&mpc8xx_immr->im_cpm.cp_pbodr, pin); + else + clrbits16(&mpc8xx_immr->im_cpm.cp_pbodr, pin); + } + if (port == CPM_PORTE) { if (flags & CPM_PIN_SECONDARY) setbits32(&iop->sor, pin); @@ -471,7 +478,7 @@ static void cpm1_set_pin16(int port, int pin, int flags) else clrbits16(&iop->par, pin); - if (port == CPM_PORTC) { + if ((port == CPM_PORTA) || (port == CPM_PORTC)) { if (flags & CPM_PIN_SECONDARY) setbits16(&iop->sor, pin); else -- 1.5.3.5 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] powerpc: Add EXPORT_SYMBOL for symbols required by fs_enet and cpm_uart
fs_enet and cpm_uart need symbols from commproc.c (for CPM1) or cpm2_common.c. Add EXPORT_SYMBOL for cpmp, cpm_setbrg and cpm2_immr, so the drivers can be compiled as modules. Building modules, stage 2. MODPOST 5 modules ERROR: "cpm2_immr" [drivers/net/fs_enet/fs_enet.ko] undefined! ERROR: "cpmp" [drivers/net/fs_enet/fs_enet.ko] undefined! make[1]: *** [__modpost] Error 1 make: *** [modules] Error 2 Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/sysdev/commproc.c|3 +++ arch/powerpc/sysdev/cpm2_common.c |3 +++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c index f6a6378..d5a0dcf 100644 --- a/arch/powerpc/sysdev/commproc.c +++ b/arch/powerpc/sysdev/commproc.c @@ -51,6 +51,8 @@ static void m8xx_cpm_dpinit(void); static uint host_buffer; /* One page of host buffer */ static uint host_end;/* end + 1 */ cpm8xx_t __iomem *cpmp; /* Pointer to comm processor space */ +EXPORT_SYMBOL(cpmp); + immap_t __iomem *mpc8xx_immr; static cpic8xx_t __iomem *cpic_reg; @@ -302,6 +304,7 @@ cpm_setbrg(uint brg, uint rate) out_be32(bp, (((BRG_UART_CLK_DIV16 / rate) - 1) << 1) | CPM_BRG_EN | CPM_BRG_DIV16); } +EXPORT_SYMBOL(cpm_setbrg); #ifndef CONFIG_PPC_CPM_NEW_BINDING /* diff --git a/arch/powerpc/sysdev/cpm2_common.c b/arch/powerpc/sysdev/cpm2_common.c index 859362f..4ed5df6 100644 --- a/arch/powerpc/sysdev/cpm2_common.c +++ b/arch/powerpc/sysdev/cpm2_common.c @@ -51,11 +51,13 @@ static void cpm2_dpinit(void); #endif cpm_cpm2_t __iomem *cpmp; /* Pointer to comm processor space */ +EXPORT_SYMBOL(cpmp); /* We allocate this here because it is used almost exclusively for * the communication processor devices. */ cpm2_map_t __iomem *cpm2_immr; +EXPORT_SYMBOL(cpm2_immr); #define CPM_MAP_SIZE(0x4) /* 256k - the PQ3 reserve this amount of space for CPM as it is larger @@ -117,6 +119,7 @@ cpm_setbrg(uint brg, uint rate) cpm2_unmap(bp); } +EXPORT_SYMBOL(cpm_setbrg); /* This function is used to set high speed synchronous baud rate * clocks. -- 1.5.3.5 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] [POWERPC] Fix fs_enet module build
If fs_enet is build as module, mii-fec/mii-bitbang should be build as module, as well. Otherwise some symbols remain undefined. Building modules, stage 2. MODPOST 5 modules ERROR: "fs_scc_ops" [drivers/net/fs_enet/fs_enet.ko] undefined! make[1]: *** [__modpost] Error 1 make: *** [modules] Error 2 Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- This can be pulled from git://git.bocc.de/dbox2.git for-2.6.24 drivers/net/fs_enet/Makefile | 12 ++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/net/fs_enet/Makefile b/drivers/net/fs_enet/Makefile index 02d4dc1..2f7563a 100644 --- a/drivers/net/fs_enet/Makefile +++ b/drivers/net/fs_enet/Makefile @@ -4,7 +4,15 @@ obj-$(CONFIG_FS_ENET) += fs_enet.o -obj-$(CONFIG_8xx) += mac-fec.o mac-scc.o mii-fec.o -obj-$(CONFIG_CPM2) += mac-fcc.o mii-bitbang.o +fs_enet-$(CONFIG_8xx) += mac-fec.o mac-scc.o +fs_enet-$(CONFIG_CPM2) += mac-fcc.o + +ifeq ($(CONFIG_8xx),y) +obj-$(CONFIG_FS_ENET) += mii-fec.o +endif + +ifeq ($(CONFIG_CPM2),y) +obj-$(CONFIG_FS_ENET) += mii-bitbang.o +endif fs_enet-objs := fs_enet-main.o -- 1.5.3.4 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] [POWERPC] Fix typo #ifdef -> #ifndef
fpi->cp_command should be overwritten only if CONFIG_PPC_CPM_NEW_BINDING is NOT set. Otherwise it is already set from the device tree. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- This can be pulled from git://git.bocc.de/dbox2.git for-2.6.24 drivers/net/fs_enet/mac-scc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/net/fs_enet/mac-scc.c b/drivers/net/fs_enet/mac-scc.c index 03134f4..48f2f30 100644 --- a/drivers/net/fs_enet/mac-scc.c +++ b/drivers/net/fs_enet/mac-scc.c @@ -158,7 +158,7 @@ static int setup_data(struct net_device *dev) { struct fs_enet_private *fep = netdev_priv(dev); -#ifdef CONFIG_PPC_CPM_NEW_BINDING +#ifndef CONFIG_PPC_CPM_NEW_BINDING struct fs_platform_info *fpi = fep->fpi; fep->scc.idx = fs_get_scc_index(fpi->fs_no); -- 1.5.3.4 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH2/2] [POWERPC] fs_enet: select PHYLIB as the driver needs it.
Add a select PHYLIB to config FS_ENET as the driver uses functions of libphy. LD .tmp_vmlinux1 drivers/built-in.o: In function `fs_ioctl': drivers/net/fs_enet/fs_enet-main.c:952: undefined reference to `phy_mii_ioctl' [...] make: *** [.tmp_vmlinux1] Error 1 Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- drivers/net/fs_enet/Kconfig |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/net/fs_enet/Kconfig b/drivers/net/fs_enet/Kconfig index 2765e49..24502d2 100644 --- a/drivers/net/fs_enet/Kconfig +++ b/drivers/net/fs_enet/Kconfig @@ -2,6 +2,7 @@ config FS_ENET tristate "Freescale Ethernet Driver" depends on CPM1 || CPM2 select MII + select PHYLIB config FS_ENET_HAS_SCC bool "Chip has an SCC usable for ethernet" -- 1.5.3.4 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH0/2] [POWERPC] Two bug fixes for 2.6.24
Here is a series fixing some bugs for 8xx powerpc CPUs. 1. [POWERPC] Kill non-existant symbols from ksyms and commproc.h 2. [POWERPC] fs_enet: select PHYLIB as the driver needs it This series can be pulled from git://git.bocc.de/dbox2.git for-2.6.24 Thanks, Jochen - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH1/2] [POWERPC] Kill non-existant symbols from ksyms and commproc.h
Remove exports of __res and cpm_install_handler/cpm_free_handler. Remove cpm_install_handler/cpm_free_handler from the commproc.h as well. Both were used for ARCH=ppc and aren't defined for ARCH=powerpc. CC arch/powerpc/kernel/ppc_ksyms.o arch/powerpc/kernel/ppc_ksyms.c:180: error: '__res' undeclared here (not in a function) arch/powerpc/kernel/ppc_ksyms.c:180: warning: type defaults to 'int' in declaration of '__res' make[1]: *** [arch/powerpc/kernel/ppc_ksyms.o] Error 1 make: *** [arch/powerpc/kernel] Error 2 LD .tmp_vmlinux1 arch/powerpc/kernel/built-in.o:(__ksymtab+0x198): undefined reference to `cpm_free_handler' arch/powerpc/kernel/built-in.o:(__ksymtab+0x1a0): undefined reference to `cpm_install_handler' make: *** [.tmp_vmlinux1] Error 1 Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/kernel/ppc_ksyms.c | 12 include/asm-powerpc/commproc.h |3 --- 2 files changed, 0 insertions(+), 15 deletions(-) diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c index c6b1aa3..13ebeb2 100644 --- a/arch/powerpc/kernel/ppc_ksyms.c +++ b/arch/powerpc/kernel/ppc_ksyms.c @@ -45,10 +45,6 @@ #include #include -#ifdef CONFIG_8xx -#include -#endif - #ifdef CONFIG_PPC64 EXPORT_SYMBOL(local_irq_restore); #endif @@ -172,14 +168,6 @@ EXPORT_SYMBOL(console_drivers); EXPORT_SYMBOL(cacheable_memcpy); #endif -#ifdef CONFIG_8xx -EXPORT_SYMBOL(cpm_install_handler); -EXPORT_SYMBOL(cpm_free_handler); -#endif /* CONFIG_8xx */ -#if defined(CONFIG_8xx) -EXPORT_SYMBOL(__res); -#endif - #ifdef CONFIG_PPC32 EXPORT_SYMBOL(next_mmu_context); EXPORT_SYMBOL(set_context); diff --git a/include/asm-powerpc/commproc.h b/include/asm-powerpc/commproc.h index 0307c84..5dff922 100644 --- a/include/asm-powerpc/commproc.h +++ b/include/asm-powerpc/commproc.h @@ -698,9 +698,6 @@ typedef struct risc_timer_pram { #define CICR_IEN((uint)0x0080) /* Int. enable */ #define CICR_SPS((uint)0x0001) /* SCC Spread */ -extern void cpm_install_handler(int vec, void (*handler)(void *), void *dev_id); -extern void cpm_free_handler(int vec); - #define IMAP_ADDR (get_immrbase()) #define CPM_PIN_INPUT 0 -- 1.5.3.4 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [i2c] [PATCH take2] [POWERPC] i2c: adds support for i2c bus on 8xx
Hi Jean, > On Wed, 17 Oct 2007 21:20:37 +0200, Jochen Friedrich wrote: >>>> + /* Select an arbitrary address. Just make sure it is unique. >>>> + */ >>>> + out_8(&i2c->i2c_i2add, 0xfe); >>>> >>> It's a 7-bit address... and are you sure that 0x7e is unique? Does this >>> driver even support slave operation? >>> >> It's in fact 0x7F << 1. The same value is used in the 2.4 driver and >> in u-boot, as well. Slave operation is not supported. > > I'm not sure what exactly you are doing here, but 0x7f isn't a valid > 7-bit I2C address. That's most probably the reason why it is used everywhere in the CPM world (old driver, u-boot) ;-) According to the documentation, the CPM enters a loopback mode as soon as a write access to the I2C address written to i2c_i2add takes place. This even happens if the CPM is set to master mode. So the only way to make sure there are no limitations to the I2C addresses which can be used is to use this invalid address. 0x00 can't be used either or no I2C broadcasts would be possible. >From the MPC-823 documentation: 16.13.3.1.3 I2C Loopback Configuration. Loopback on the I2C controller is a special part of master mode operation with a device that does not contain internal addresses. Refer to Figure 16-127 for more information. To begin a loopback transmission, you must prepare a TX buffer descriptor with a data buffer N+1 bytes long, where N is the number of data bytes to be written back to the I2C controller. You must also prepare one or more RX buffer descriptors to receive the N bytes of data. The first byte of the TX buffer descriptor must contain the address of the MPC823 I2C device’s own address, which is in the I2CADD register, followed by the write bit asserted (R/W = 0). The remaining N bytes of the TX buffer descriptor contain the data to be sent and received by the I2C controller. Next, set the R bit in the TX buffer descriptor and the E bit in the RX buffer descriptor. Then set the W and L bits in the TX buffer descriptor. Setting the L bit causes a stop condition to be issued after this buffer is transmitted to conclude the operation. Set the I bit in the TX and RX buffer descriptors to enable the transmission and reception status to be updated in the I2CE register and to enable I2C transmit and receive interrupts to the core. You must then set the STR bit in the I2COM register to initiate the loopback operation. Thanks, Jochen - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH take2] [POWERPC] i2c: adds support for i2c bus on 8xx
Hi Scott, Do we really need to be adding features for arch/ppc at this point? It'll be going away in June. arch/ppc-specific things outside of arch/ppc itself will also be more likely to be missed in the removal. Also, please post inline rather than as an attachment; attachments are harder to quote in a reply. OK. I'll remove the ARC=ppc parts. diff --git a/arch/powerpc/boot/dts/mpc885ads.dts b/arch/powerpc/boot/dts/mpc885ads.dts index 8848e63..a526c02 100644 --- a/arch/powerpc/boot/dts/mpc885ads.dts +++ b/arch/powerpc/boot/dts/mpc885ads.dts @@ -213,6 +213,15 @@ fsl,cpm-command = <0080>; linux,network-index = <2>; }; + + [EMAIL PROTECTED] { + device_type = "i2c"; No device_type. Why? Documentation/powerpc/booting-without-of.txt says for I2C interfaces device_type is required and should be "i2c". Is this no longer true? Should be fsl,cpm-i2c. Is cpm2 i2c the same? If not, it should be fsl,cpm1-i2c. It's probably best to specify it anyway, along with fsl,mpc885-i2c. CPM2 i2c seems to be the same. However, i have no way to test this. +#ifdef CONFIG_I2C_8XX + setbits32(&mpc8xx_immr->im_cpm.cp_pbpar, 0x0030); + setbits32(&mpc8xx_immr->im_cpm.cp_pbdir, 0x0030); + setbits16(&mpc8xx_immr->im_cpm.cp_pbodr, 0x0030); +#endif Please add this to mpc885ads_pins, rather than poking the registers directly. The relevant lines are: {CPM_PORTB, 26, CPM_PIN_OUTPUT}, {CPM_PORTB, 27, CPM_PIN_OUTPUT}, I noticed cpm1_set_pin32, but this function don't seem to set the odr register. Will this be added? Then it would be: {CPM_PORTB, 26, CPM_PIN_OUTPUT | CPM_PIN_OPENDRAIN}, {CPM_PORTB, 27, CPM_PIN_OUTPUT | CPM_PIN_OPENDRAIN}, + /* Select an arbitrary address. Just make sure it is unique. +*/ + out_8(&i2c->i2c_i2add, 0xfe); It's a 7-bit address... and are you sure that 0x7e is unique? Does this driver even support slave operation? It's in fact 0x7F << 1. The same value is used in the 2.4 driver and in u-boot, as well. Slave operation is not supported. Why is an 8xx driver matching all i2c cpm (i.e. what about cpm2)? With the suggested change to use fsl,cpm-command, the driver should be able to use both cpm1 and cpm2. The operation and structs for i2c are identical. The only difference might be the hack^wsupport for relocation. Thanks, Jochen - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH take2] [POWERPC] i2c: adds support for i2c bus on 8xx
Using the port of 2.4 code from Vitaly Bordug <[EMAIL PROTECTED]> and the actual algorithm used by the i2c driver of the DBox code on cvs.tuxboc.org from Tmbinc, Gillem ([EMAIL PROTECTED]). Renamed i2c-algo-8xx.c to i2c-algo-cpm.c and i2c-rpx.c to i2c-8xx.c. Added original i2c-rpx.c as i2c-8xx-ppc.c for pre-OF (arch ppc) devices. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- This can be pulled from git://git.bocc.de/dbox2.git i2c arch/powerpc/boot/dts/mpc885ads.dts |9 + arch/powerpc/platforms/8xx/mpc885ads_setup.c |6 + arch/powerpc/sysdev/fsl_soc.c| 61 +++- drivers/i2c/algos/Kconfig| 12 + drivers/i2c/algos/Makefile |1 + drivers/i2c/algos/i2c-algo-cpm.c | 563 ++ drivers/i2c/busses/Kconfig | 22 + drivers/i2c/busses/Makefile |2 + drivers/i2c/busses/i2c-8xx-ppc.c | 105 + drivers/i2c/busses/i2c-8xx.c | 170 include/linux/i2c-algo-cpm.h | 34 ++ 11 files changed, 984 insertions(+), 1 deletions(-) create mode 100644 drivers/i2c/algos/i2c-algo-cpm.c create mode 100644 drivers/i2c/busses/i2c-8xx-ppc.c create mode 100644 drivers/i2c/busses/i2c-8xx.c create mode 100644 include/linux/i2c-algo-cpm.h diff --git a/arch/powerpc/boot/dts/mpc885ads.dts b/arch/powerpc/boot/dts/mpc885ads.dts index 8848e63..a526c02 100644 --- a/arch/powerpc/boot/dts/mpc885ads.dts +++ b/arch/powerpc/boot/dts/mpc885ads.dts @@ -213,6 +213,15 @@ fsl,cpm-command = <0080>; linux,network-index = <2>; }; + + [EMAIL PROTECTED] { +device_type = "i2c"; +compatible = "fsl-i2c-cpm"; +reg = <860 20 3c80 30>; +interrupts = <10>; +interrupt-parent = <&CPM_PIC>; +fsl,cpm-command = <0010>; + }; }; }; diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c index 2cf1b6a..350018b 100644 --- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c @@ -175,6 +175,12 @@ static void __init init_ioports(void) /* Set FEC1 and FEC2 to MII mode */ clrbits32(&mpc8xx_immr->im_cpm.cp_cptr, 0x0180); + +#ifdef CONFIG_I2C_8XX + setbits32(&mpc8xx_immr->im_cpm.cp_pbpar, 0x0030); + setbits32(&mpc8xx_immr->im_cpm.cp_pbdir, 0x0030); + setbits16(&mpc8xx_immr->im_cpm.cp_pbodr, 0x0030); +#endif } static void __init mpc885ads_setup_arch(void) diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c index 3ace747..e2c8bf8 100644 --- a/arch/powerpc/sysdev/fsl_soc.c +++ b/arch/powerpc/sysdev/fsl_soc.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -397,7 +398,7 @@ static int __init fsl_i2c_of_init(void) for (np = NULL, i = 0; (np = of_find_compatible_node(np, "i2c", "fsl-i2c")) != NULL; i++) { - struct resource r[2]; + struct resource r[3]; struct fsl_i2c_platform_data i2c_data; const unsigned char *flags = NULL; @@ -1210,6 +1211,64 @@ err: arch_initcall(cpm_smc_uart_of_init); +static const char *i2c_regs = "regs"; +static const char *i2c_pram = "pram"; +static const char *i2c_irq = "interrupt"; + +static int __init fsl_i2c_cpm_of_init(void) +{ + struct device_node *np; + unsigned int i; + struct platform_device *i2c_dev; + int ret; + + for (np = NULL, i = 0; + (np = of_find_compatible_node(np, "i2c", "fsl-i2c-cpm")) != NULL; + i++) { + struct resource r[3]; + struct fsl_i2c_platform_data i2c_data; + + memset(&r, 0, sizeof(r)); + memset(&i2c_data, 0, sizeof(i2c_data)); + + ret = of_address_to_resource(np, 0, &r[0]); + if (ret) + goto err; + r[0].name = i2c_regs; + + ret = of_address_to_resource(np, 1, &r[1]); + if (ret) + goto err; + r[1].name = i2c_pram; + + r[2].start = r[2].end = irq_of_parse_and_map(np, 0); + r[2].flags = IORESOURCE_IRQ; + r[2].name = i2c_irq; + + i2c_dev = platform_device_register_simple("fsl-i2c-cpm", i, &r[0], 3); + if (IS_ERR(i2c_dev)) { + ret = PTR_ERR(i2c_dev); + goto err; + } + + ret = + platform_device_add_data(i2c_dev, &i2c_data, + sizeof(struct + fsl_i2c_platform_data)); + if (ret) + goto unreg; + } + + return 0; + +unreg: + platform_device_unregister(i2c_dev); +err: + return ret; +} + +arch_initcall(fsl_i2c_cpm_of_init); + #endif /* CONFIG_8xx */ #endif /* CONFIG_PPC_CPM_NEW_BINDING */ diff --git a/drivers/i2c/algos/Kconfig b/drivers/i2c/algos/Kconfig index 014dfa5..7a8200e 100644 --- a/drivers/i2c/algos/Kconfig +++ b/drivers/i2c/algos/Kconfig @@ -14,6 +14,18 @@ config I2C_ALGOBIT This support is also available as a module. If so, the module will be called i2c-algo-bit. +config I2C_ALGOCPM + tristate &
Re: [PATCH4/4] [POWERPC] Fix cpm_uart driver
Hi Scott, Yikes. Please don't change cpm_uart_cpm1.h, as it's correct for arch/powerpc, and there are numerous other places that assume cpmp is virtual (including in the very same function that assigns it a physical address). I'm still not convinced cpm_uart_cpm1.h is correct: pinfo->rx_bd_base and pinfo->tx_bd_base are both initialized with an address obtained by cpm_dpram_addr(). In both ppc and powerpc, this is an address relative to dpram_vbase in commproc.c In cpm_uart_core.c, the operation "pinfo->rx_bd_base - DPRAM_BASE" is used to calculate the DPRAM offset. So DPRAM_BASE must be relative to dpram_vbase in commproc.c as well. However, cpm_uart_cpm1.h uses cpmp in commproc.c to initialize DPRAM_BASE. On ARCH=ppc, cpmp is a physical address with 1:1 virtual mapping ("well known address"). On ARC=powerpc, this is an address obtained by ioremap(), however it's a different ioremap() call than dpram_vbase is obtained from, so noone can guarantee cpmp is always the same as dpram_vbase even on ARCH=powerpc. To me, it looks like setting DPRAM_BASE to cpm_dpram_addr(0) is the fix as it makes the DPRAM offset a defined result. Thanks, Jochen - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH#2 3/4] [PPC] Compile fix for 8xx CPM Ehernet driver
Add #include for flush_dcache_range to make the driver compile again. CC arch/ppc/8xx_io/enet.o arch/ppc/8xx_io/enet.c: In function 'scc_enet_start_xmit': arch/ppc/8xx_io/enet.c:240: error: implicit declaration of function 'flush_dcache_range' make[1]: *** [arch/ppc/8xx_io/enet.o] Error 1 make: *** [arch/ppc/8xx_io] Error 2 Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/ppc/8xx_io/enet.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/ppc/8xx_io/enet.c b/arch/ppc/8xx_io/enet.c index 703d47e..eace3bc 100644 --- a/arch/ppc/8xx_io/enet.c +++ b/arch/ppc/8xx_io/enet.c @@ -44,6 +44,7 @@ #include #include #include +#include /* *Theory of Operation
[PATCH#2 4/4] [POWERPC] Fix cpm_uart driver
in cpm_uart_cpm1.h, DPRAM_BASE is assigned an address derived from cpmp. On ARC=ppc, this is a physical address with 1:1 DMA mapping which can't be used for arithmetric compare operations with virtual addresses returned by cpm_dpram_addr. This patch changes the assignment to use cpm_dpram_addr as well, like in cpm_uart_cpm2.h. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- drivers/serial/cpm_uart/cpm_uart_cpm1.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.h b/drivers/serial/cpm_uart/cpm_uart_cpm1.h index a99e45e..2a64778 100644 --- a/drivers/serial/cpm_uart/cpm_uart_cpm1.h +++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.h @@ -37,6 +37,6 @@ static inline void cpm_set_smc_fcr(volatile smc_uart_t * up) up->smc_tfcr = SMC_EB; } -#define DPRAM_BASE ((unsigned char *)&cpmp->cp_dpmem[0]) +#define DPRAM_BASE ((unsigned char *)cpm_dpram_addr(0)) #endif
[PATCH#2 2/4] [PPC] Fix cpm_dpram_addr returning phys mem instead of virt mem
cpm_dpram_addr returns physical memory of the DP RAM instead of iomapped virtual memory. As there usually is a 1:1 MMU map of the IMMR area, this is often not noticed. However, cpm_dpram_phys assumes this iomapped virtual memory and returns garbage on the 1:1 mapped memory causing CPM1 uart console to fail. This patch fixes the problem (copied from the powerpc tree). Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/ppc/8xx_io/commproc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c index 7088428..9da880b 100644 --- a/arch/ppc/8xx_io/commproc.c +++ b/arch/ppc/8xx_io/commproc.c @@ -459,7 +459,7 @@ EXPORT_SYMBOL(cpm_dpdump); void *cpm_dpram_addr(unsigned long offset) { - return ((immap_t *)IMAP_ADDR)->im_cpm.cp_dpmem + offset; + return (void *)(dpram_vbase + offset); } EXPORT_SYMBOL(cpm_dpram_addr);
[PATCH#2 1/4] [POWERPC] Fix copy'n'paste typo in commproc.c
The powerpc version of commproc.c exports cpm_dpram_addr twice and cpm_dpram_phys not at all due to a typo. This patch fixes this problem. CC arch/powerpc/sysdev/commproc.o arch/powerpc/sysdev/commproc.c:398: error: redefinition of '__kcrctab_cpm_dpram_addr' arch/powerpc/sysdev/commproc.c:392: error: previous definition of '__kcrctab_cpm_dpram_addr' was here arch/powerpc/sysdev/commproc.c:398: error: redefinition of '__kstrtab_cpm_dpram_addr' arch/powerpc/sysdev/commproc.c:392: error: previous definition of '__kstrtab_cpm_dpram_addr' was here arch/powerpc/sysdev/commproc.c:398: error: redefinition of '__ksymtab_cpm_dpram_addr' arch/powerpc/sysdev/commproc.c:392: error: previous definition of '__ksymtab_cpm_dpram_addr' was here make[1]: *** [arch/powerpc/sysdev/commproc.o] Error 1 make: *** [arch/powerpc/sysdev] Error 2 Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/sysdev/commproc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c index 4f67b89..dd5417a 100644 --- a/arch/powerpc/sysdev/commproc.c +++ b/arch/powerpc/sysdev/commproc.c @@ -395,4 +395,4 @@ uint cpm_dpram_phys(u8* addr) { return (dpram_pbase + (uint)(addr - dpram_vbase)); } -EXPORT_SYMBOL(cpm_dpram_addr); +EXPORT_SYMBOL(cpm_dpram_phys);
[PATCH#2 0/4] Various bug fixes
Here is a series fixing some bugs for 8xx powerpc CPUs. 1. [POWERPC] Fix copy'n'paste typo in commproc.c 2. [PPC] Fix cpm_dpram_addr returning phys mem instead of virt mem 3. [PPC] Compile fix for 8xx CPM Ehernet driver 4. [POWERPC] Fix cpm_uart driver (updated) This series can be pulled from git://git.bocc.de/dbox2.git ppc-fixes Thanks, Jochen - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH4/4] [POWERPC] Fix cpm_uart driver
Scott Wood schrieb: Jochen Friedrich wrote: In cpm_uart_core, functions cpm_uart_init_bd and cpm_uart_init_scc an offset into DP RAM is calculated by substracting a physical memory constant from an virtual address. This patch fixes the problem by converting the virtual address into a physical first. Huh? DPRAM_BASE is a virtual address. With this patch, you'd be subtracting a virtual address from a physical address. Thanks for pointing me to it. So the bug is in cpm_uart_cpm1.h assigning a physical memory to DPRAM_BASE (at least on ARC=ppc). cpm_uart_cpm2.h seems to be correct though. I'll submit a new patch for this. Thanks, Jochen - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH3/4] [PPC] Compile fix for 8xx CPM Ehernet driver
Add #include for flush_dcache_range to make the driver compile again. CC arch/ppc/8xx_io/enet.o arch/ppc/8xx_io/enet.c: In function 'scc_enet_start_xmit': arch/ppc/8xx_io/enet.c:240: error: implicit declaration of function 'flush_dcache_range' make[1]: *** [arch/ppc/8xx_io/enet.o] Error 1 make: *** [arch/ppc/8xx_io] Error 2 Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/ppc/8xx_io/enet.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/ppc/8xx_io/enet.c b/arch/ppc/8xx_io/enet.c index 703d47e..eace3bc 100644 --- a/arch/ppc/8xx_io/enet.c +++ b/arch/ppc/8xx_io/enet.c @@ -44,6 +44,7 @@ #include #include #include +#include /* *Theory of Operation
[PATCH4/4] [POWERPC] Fix cpm_uart driver
In cpm_uart_core, functions cpm_uart_init_bd and cpm_uart_init_scc an offset into DP RAM is calculated by substracting a physical memory constant from an virtual address. This patch fixes the problem by converting the virtual address into a physical first. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- drivers/serial/cpm_uart/cpm_uart_core.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c index cefde58..7f5db7c 100644 --- a/drivers/serial/cpm_uart/cpm_uart_core.c +++ b/drivers/serial/cpm_uart/cpm_uart_core.c @@ -752,8 +752,10 @@ static void cpm_uart_init_scc(struct uart_cpm_port *pinfo) sup = pinfo->sccup; /* Store address */ - pinfo->sccup->scc_genscc.scc_rbase = (unsigned char *)pinfo->rx_bd_base - DPRAM_BASE; - pinfo->sccup->scc_genscc.scc_tbase = (unsigned char *)pinfo->tx_bd_base - DPRAM_BASE; + pinfo->sccup->scc_genscc.scc_rbase = + (u_char *)cpm_dpram_phys((u8 *)pinfo->rx_bd_base) - DPRAM_BASE; + pinfo->sccup->scc_genscc.scc_tbase = + (u_char *)cpm_dpram_phys((u8 *)pinfo->tx_bd_base) - DPRAM_BASE; /* Set up the uart parameters in the * parameter ram. @@ -813,8 +815,10 @@ static void cpm_uart_init_smc(struct uart_cpm_port *pinfo) up = pinfo->smcup; /* Store address */ - pinfo->smcup->smc_rbase = (u_char *)pinfo->rx_bd_base - DPRAM_BASE; - pinfo->smcup->smc_tbase = (u_char *)pinfo->tx_bd_base - DPRAM_BASE; + pinfo->smcup->smc_rbase = + (u_char *)cpm_dpram_phys((u8 *)pinfo->rx_bd_base) - DPRAM_BASE; + pinfo->smcup->smc_tbase = + (u_char *)cpm_dpram_phys((u8 *)pinfo->tx_bd_base) - DPRAM_BASE; /* * In case SMC1 is being relocated...
[PATCH2/4] [PPC] Fix cpm_dpram_addr returning phys mem instead of virt mem
cpm_dpram_addr returns physical memory of the DP RAM instead of iomapped virtual memory. As there usually is a 1:1 MMU map of the IMMR area, this is often not noticed. However, cpm_dpram_phys assumes this iomapped virtual memory and returns garbage on the 1:1 mapped memory causing CPM1 uart console to fail. This patch fixes the problem (copied from the powerpc tree). Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/ppc/8xx_io/commproc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c index 7088428..9da880b 100644 --- a/arch/ppc/8xx_io/commproc.c +++ b/arch/ppc/8xx_io/commproc.c @@ -459,7 +459,7 @@ EXPORT_SYMBOL(cpm_dpdump); void *cpm_dpram_addr(unsigned long offset) { - return ((immap_t *)IMAP_ADDR)->im_cpm.cp_dpmem + offset; + return (void *)(dpram_vbase + offset); } EXPORT_SYMBOL(cpm_dpram_addr);
[PATCH1/4] [POWERPC] Fix copy'n'paste typo in commproc.c
The powerpc version of commproc.c doesn't export cpm_dpram_addr twice and cpm_dpram_phys not at all due to a typo. This patch fixes this problem. CC arch/powerpc/sysdev/commproc.o arch/powerpc/sysdev/commproc.c:398: error: redefinition of '__kcrctab_cpm_dpram_addr' arch/powerpc/sysdev/commproc.c:392: error: previous definition of '__kcrctab_cpm_dpram_addr' was here arch/powerpc/sysdev/commproc.c:398: error: redefinition of '__kstrtab_cpm_dpram_addr' arch/powerpc/sysdev/commproc.c:392: error: previous definition of '__kstrtab_cpm_dpram_addr' was here arch/powerpc/sysdev/commproc.c:398: error: redefinition of '__ksymtab_cpm_dpram_addr' arch/powerpc/sysdev/commproc.c:392: error: previous definition of '__ksymtab_cpm_dpram_addr' was here make[1]: *** [arch/powerpc/sysdev/commproc.o] Error 1 make: *** [arch/powerpc/sysdev] Error 2 Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/powerpc/sysdev/commproc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c index 4f67b89..dd5417a 100644 --- a/arch/powerpc/sysdev/commproc.c +++ b/arch/powerpc/sysdev/commproc.c @@ -395,4 +395,4 @@ uint cpm_dpram_phys(u8* addr) { return (dpram_pbase + (uint)(addr - dpram_vbase)); } -EXPORT_SYMBOL(cpm_dpram_addr); +EXPORT_SYMBOL(cpm_dpram_phys);
[PATCH0/4] Various bug fixes
Here is a series fixing some bugs for 8xx powerpc CPUs. 1. [POWERPC] Fix copy'n'paste typo in commproc.c 2. [PPC] Fix cpm_dpram_addr returning phys mem instead of virt mem 3. [PPC] Compile fix for 8xx CPM Ehernet driver 4. [POWERPC] Fix cpm_uart driver This series can be pulled from git://git.bocc.de/dbox2.git ppc-fixes Thanks, Jochen - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] ppc32/8xx: Fix r3 trashing due to 8MB TLB page instantiation
Hi Kumar, > do we need this in arch/powerpc as well? No. At least not until these patches are applied to powerpc, as well: 8f069b1a90bd97bf6d59a02ecabf0173d9175609 [PATCH] powerpc/8xx: Use 8MB D-TLB's for kernel static mapping faults 3ea4807de7b2c5c903380ba2c2e7150bee942f42 [PATCH] powerpc/8xx: last two 8MB D-TLB entries are incorrectly set c51e078f82096a7d35ac8ec2416272e843a0e1c4 [PATCH] ppc32/8xx: Fix r3 trashing due to 8MB TLB page instantiation Thanks, Jochen - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] ppc32/8xx: Fix r3 trashing due to 8MB TLB page instantiation
Instantiation of 8MB pages on the TLB cache for the kernel static mapping trashes r3 register on !CONFIG_8xx_CPU6 configurations. This ensures r3 gets saved and restored. This has been posted to linuxppc-embedded by Marcelo Tosatti <[EMAIL PROTECTED]>, but only an incomplete version of the patch has been applied in c51e078f82096a7d35ac8ec2416272e843a0e1c4. This patch adds the rest of the fix. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> --- arch/ppc/kernel/head_8xx.S |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) This can be pulled from git://git.bocc.de/dbox2.git ppc-fixes diff --git a/arch/ppc/kernel/head_8xx.S b/arch/ppc/kernel/head_8xx.S index 944c35c..eb8d26f 100644 --- a/arch/ppc/kernel/head_8xx.S +++ b/arch/ppc/kernel/head_8xx.S @@ -495,9 +495,7 @@ LoadLargeDTLB: lwz r11, 4(r0) lwz r12, 16(r0) -#ifdef CONFIG_8xx_CPU6 lwz r3, 8(r0) -#endif rfi /* This is the data TLB error on the MPC8xx. This could be due to
Re: ANNOUNCE: SFLC helps developers assess ar5k (enabling free Atheros HAL)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Michael, >> I don't think anyone likes the HAL-based architecture. I don't think >> we will accept a HAL-based driver into the upstream kernel. > > Yeah, wanted to hear that. ;) +1 At least, this way we have a chance to get USB working as well (See http://madwifi.org/ticket/33). OpenBSD seems to have a working driver (if_uath.c) for these USB WLAN sticks. Jochen -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQEVAwUBRVxzGsP9a9GOLSE6AQIeRgf/ZyvmzdhP1+wjVshy2kK0BX+I+lx7y6RO mMmaVXPnXnHhHE4OLcf9Yrnn6d6i6rS+0CUbw60KgQouuvTFSXEFtSpIYRlXGAyj krMCj8bEfHhDEN8iYjbjdhP9Nx1wQ//JGyoBVpZZ5+sro6ik7wv70igFeDZ2IWg6 38ycxDzINaV13ZscpwoHzO3NhvcSs9k99Syrh/nR6/pp+3g2vXmrsYR+hy7DMrE/ bSI9y50h8rz6ZCire1ppDwADyBW5B1OondoRkjFYd3L8zNUu8s8xUHZ0Znz6B/cc yc7jyfQMsBRTUU7VsX3cWuMfA0UGlPn/0MR0+RHRJYHW5bRlStc5Kw== =Ajsn -END PGP SIGNATURE- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Wireless support
Rafael J. Wysocki wrote: >On Tuesday, 9 of August 2005 15:52, Kyle Moffett wrote: > > >>On Aug 9, 2005, at 05:09:55, Jochen Friedrich wrote: >> >> >>>Third, both ndiswrapper and binary-only drivers only work on one >>>platform. >>> >>>E.g. broadcom has a binary-only driver for their WLAN card on >>>Linux, but >>>only for mipsel (wrt54g). >>> >>>On Alpha or PowerPC, most WLAN equipment doesn't work under Linux, >>>at all. >>> >>> >>Definitely. I want my Airport Extreme to work! Many users of the >>BCM4301 chip can get it to work (kinda) with Linux via ndiswrapper, >>but that means they are much less likely to participate in any kind of >>reverse engineering effort, >> >> > >Do you know of anyone actually doing it? > >Rafael > > > See http://linux-bcom4301.sourceforge.net/ Jochen - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Wireless support
Adrian Bunk wrote: >I see at least two disadvantages: > >First, it doesn't encourage hardware manufacturers to support open >source development. > >Linux has only a small market share, but it's slowly growing. > >Linux driver support does sometimes influence the decision which >hardware to buy. > >With NdisWrapper, the hardware manufacturer can say: > "Our hardware is supported through the open source NdisWrapper." > >Without NdisWrapper, they will sometimes hear that people did choose to >buy hardware from a different hardware manufacturer that has a Linux >driver. This can make the hardware manufacturer more friendly towards >open source development (e.g. by providing hardware specs). > >Secondly, binary-only drivers have an impact on the stability of the >Linux kernel. > >E.g. during the last years the nvidia has produced relatively many >kernel crashes - and I doubt that binary-only drivers for Windows are >much better in this respect. > >The users only see their kernel crashing blaming the Linux kernel and >harming the reputation of the stability of Linux. > > Third, both ndiswrapper and binary-only drivers only work on one platform. E.g. broadcom has a binary-only driver for their WLAN card on Linux, but only for mipsel (wrt54g). On Alpha or PowerPC, most WLAN equipment doesn't work under Linux, at all. Jochen - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2.6-mm] tms380tr: new MCA API for madgemc.
Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> Convert madgemc to new MCA API. Now that all tms380 devices have a valid struct device with dma_mask, remove dmalimit from tmsdev_init(). Kconfig: depend tms380tr and madgemc on MCA. abyss.c, proteon.c, skisa.c, tmspci.c, tms380tr.h: remove dmalimit parameter from tmsdev_init(). tms380tr.c: use device->dma_mask instead of dmalimit. madgemc.c: move to new MCA API using struct device. --- commit 1f4dc1d28361058afd86f95c6e38ff97fac0037e tree 034adb66d17b76b171c9aeff62a5b87574cb0560 parent 12dd61e649920ddc5164971e36ed2a6aeb300708 author Jochen Friedrich <[EMAIL PROTECTED]> Sat, 30 Jul 2005 10:32:52 +0200 committer Jochen Friedrich <[EMAIL PROTECTED]> Sat, 30 Jul 2005 10:32:52 +0200 drivers/net/tokenring/Kconfig|4 drivers/net/tokenring/abyss.c|2 drivers/net/tokenring/madgemc.c | 515 +++--- drivers/net/tokenring/proteon.c |2 drivers/net/tokenring/skisa.c|2 drivers/net/tokenring/tms380tr.c | 11 + drivers/net/tokenring/tms380tr.h |3 drivers/net/tokenring/tmspci.c |2 8 files changed, 270 insertions(+), 271 deletions(-) diff --git a/drivers/net/tokenring/Kconfig b/drivers/net/tokenring/Kconfig --- a/drivers/net/tokenring/Kconfig +++ b/drivers/net/tokenring/Kconfig @@ -84,7 +84,7 @@ config 3C359 config TMS380TR tristate "Generic TMS380 Token Ring ISA/PCI adapter support" - depends on TR && (PCI || ISA) + depends on TR && (PCI || ISA || MCA) select FW_LOADER ---help--- This driver provides generic support for token ring adapters @@ -158,7 +158,7 @@ config ABYSS config MADGEMC tristate "Madge Smart 16/4 Ringnode MicroChannel" - depends on TR && TMS380TR && MCA_LEGACY + depends on TR && TMS380TR && MCA help This tms380 module supports the Madge Smart 16/4 MC16 and MC32 MicroChannel adapters. diff --git a/drivers/net/tokenring/abyss.c b/drivers/net/tokenring/abyss.c --- a/drivers/net/tokenring/abyss.c +++ b/drivers/net/tokenring/abyss.c @@ -139,7 +139,7 @@ static int __devinit abyss_attach(struct */ dev->base_addr += 0x10; - ret = tmsdev_init(dev, PCI_MAX_ADDRESS, &pdev->dev); + ret = tmsdev_init(dev, &pdev->dev); if (ret) { printk("%s: unable to get memory for dev->priv.\n", dev->name); diff --git a/drivers/net/tokenring/madgemc.c b/drivers/net/tokenring/madgemc.c --- a/drivers/net/tokenring/madgemc.c +++ b/drivers/net/tokenring/madgemc.c @@ -20,7 +20,7 @@ static const char version[] = "madgemc.c: v0.91 23/01/2000 by Adam Fritzler\n"; #include -#include +#include #include #include #include @@ -38,9 +38,7 @@ static const char version[] = "madgemc.c #define MADGEMC_IO_EXTENT 32 #define MADGEMC_SIF_OFFSET 0x08 -struct madgemc_card { - struct net_device *dev; - +struct card_info { /* * These are read from the BIA ROM. */ @@ -57,16 +55,12 @@ struct madgemc_card { unsigned int arblevel:4; unsigned int ringspeed:2; /* 0 = 4mb, 1 = 16, 2 = Auto/none */ unsigned int cabletype:1; /* 0 = RJ45, 1 = DB9 */ - - struct madgemc_card *next; }; -static struct madgemc_card *madgemc_card_list; - static int madgemc_open(struct net_device *dev); static int madgemc_close(struct net_device *dev); static int madgemc_chipset_init(struct net_device *dev); -static void madgemc_read_rom(struct madgemc_card *card); +static void madgemc_read_rom(struct net_device *dev, struct card_info *card); static unsigned short madgemc_setnselout_pins(struct net_device *dev); static void madgemc_setcabletype(struct net_device *dev, int type); @@ -151,261 +145,237 @@ static void madgemc_sifwritew(struct net -static int __init madgemc_probe(void) +static int __devinit madgemc_probe(struct device *device) { static int versionprinted; struct net_device *dev; struct net_local *tp; - struct madgemc_card *card; - int i,slot = 0; - __u8 posreg[4]; - - if (!MCA_bus) - return -1; - - while (slot != MCA_NOTFOUND) { - /* -* Currently we only support the MC16/32 (MCA ID 002d) -*/ - slot = mca_find_unused_adapter(0x002d, slot); - if (slot == MCA_NOTFOUND) - break; - - /* -* If we get here, we have an adapter. -*/ - if (versionprinted++ == 0) - printk("%s", version); - - dev = alloc_trdev(sizeof(struct net_local)); - if (dev == NULL) { - printk("madgemc: unable to allocate dev space\n"); - if (madgemc_card_l
[PATCH 2.6-mm] tms380tr: remove prototypes in Space.c
Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> Cleanup: remove two prototypes. --- commit 12dd61e649920ddc5164971e36ed2a6aeb300708 tree 2558f9767b0fa94b31bd6fe8de67cb17cab7e8df parent 6407300cd8c7368f6bfcaa476e4dd50ce7421ab2 author Jochen Friedrich <[EMAIL PROTECTED]> Fri, 29 Jul 2005 20:39:49 +0200 committer Jochen Friedrich <[EMAIL PROTECTED]> Fri, 29 Jul 2005 20:39:49 +0200 drivers/net/Space.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c +++ b/drivers/net/Space.c @@ -318,8 +318,6 @@ static void __init ethif_probe2(int unit #ifdef CONFIG_TR /* Token-ring device probe */ extern int ibmtr_probe_card(struct net_device *); -extern struct net_device *sk_isa_probe(int unit); -extern struct net_device *proteon_probe(int unit); extern struct net_device *smctr_probe(int unit); static struct devprobe2 tr_probes2[] __initdata = { -- Bug, n.: An aspect of a computer program which exists because the programmer was thinking about girls or stock options when he wrote the program. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
PATCH 2.6: tms380tr update: move to DMA API
Hi Jeff, this patch makes tms380tr use the new DMA API. Now that on Alpha, this API also supports bus master DMA for ISA (platform) devices, i changed the driver to use this new API. This also works around a bug in the firmware loader: The example provided in Documentation/firmware_class no longer works, as the firmware loader now calls get_kobj_path_length() and the kernel promptly oopses, as the home-grown device doesn't have a parent. Of course, this doesn't happen with a "real" device which has its bus (or pseudo bus in the case of platform) as parent. Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]> Converted tms380tr to use new DMA API: - proteon.c, skisa.c: use platform pseudo bus to create a struct device - Space.c: delete init hooks - abyss.c, tmspci.c: pass struct device to tms380tr.c - tms380tr.c, tms380tr.h: new DMA API, use real device fo firmware loader --- commit 776158cf2f3ce514c6001869dfdcf0bd3911760d tree 6194d993401e8afb990f23568dc23e314d150832 parent f60f700876cd51de9de69f3a3c865d95e287a24d author Jochen Friedrich <[EMAIL PROTECTED]> Sat, 23 Jul 2005 11:48:50 +0200 committer Jochen Friedrich <[EMAIL PROTECTED]> Sat, 23 Jul 2005 11:48:50 +0200 drivers/net/Space.c |6 -- drivers/net/tokenring/abyss.c|2 - drivers/net/tokenring/proteon.c | 104 ++ drivers/net/tokenring/skisa.c| 104 ++ drivers/net/tokenring/tms380tr.c | 37 ++ drivers/net/tokenring/tms380tr.h |8 +-- drivers/net/tokenring/tmspci.c |4 + 7 files changed, 122 insertions(+), 143 deletions(-) diff --git a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c +++ b/drivers/net/Space.c @@ -323,12 +323,6 @@ extern struct net_device *proteon_probe( extern struct net_device *smctr_probe(int unit); static struct devprobe2 tr_probes2[] __initdata = { -#ifdef CONFIG_SKISA - {sk_isa_probe, 0}, -#endif -#ifdef CONFIG_PROTEON - {proteon_probe, 0}, -#endif #ifdef CONFIG_SMCTR {smctr_probe, 0}, #endif diff --git a/drivers/net/tokenring/abyss.c b/drivers/net/tokenring/abyss.c --- a/drivers/net/tokenring/abyss.c +++ b/drivers/net/tokenring/abyss.c @@ -139,7 +139,7 @@ static int __devinit abyss_attach(struct */ dev->base_addr += 0x10; - ret = tmsdev_init(dev, PCI_MAX_ADDRESS, pdev); + ret = tmsdev_init(dev, PCI_MAX_ADDRESS, &pdev->dev); if (ret) { printk("%s: unable to get memory for dev->priv.\n", dev->name); diff --git a/drivers/net/tokenring/proteon.c b/drivers/net/tokenring/proteon.c --- a/drivers/net/tokenring/proteon.c +++ b/drivers/net/tokenring/proteon.c @@ -62,8 +62,7 @@ static int dmalist[] __initdata = { }; static char cardname[] = "Proteon 1392\0"; - -struct net_device *proteon_probe(int unit); +static u64 dma_mask = ISA_MAX_ADDRESS; static int proteon_open(struct net_device *dev); static void proteon_read_eeprom(struct net_device *dev); static unsigned short proteon_setnselout_pins(struct net_device *dev); @@ -116,7 +115,7 @@ nodev: return -ENODEV; } -static int __init setup_card(struct net_device *dev) +static int __init setup_card(struct net_device *dev, struct device *pdev) { struct net_local *tp; static int versionprinted; @@ -137,7 +136,7 @@ static int __init setup_card(struct net_ } } if (err) - goto out4; + goto out5; /* At this point we have found a valid card. */ @@ -145,14 +144,15 @@ static int __init setup_card(struct net_ printk(KERN_DEBUG "%s", version); err = -EIO; - if (tmsdev_init(dev, ISA_MAX_ADDRESS, NULL)) + pdev->dma_mask = &dma_mask; + if (tmsdev_init(dev, ISA_MAX_ADDRESS, pdev)) goto out4; dev->base_addr &= ~3; proteon_read_eeprom(dev); - printk(KERN_DEBUG "%s:Ring Station Address: ", dev->name); + printk(KERN_DEBUG "proteon.c:Ring Station Address: "); printk("%2.2x", dev->dev_addr[0]); for (j = 1; j < 6; j++) printk(":%2.2x", dev->dev_addr[j]); @@ -185,7 +185,7 @@ static int __init setup_card(struct net_ if(irqlist[j] == 0) { -printk(KERN_INFO "%s: AutoSelect no IRQ available\n", dev->name); +printk(KERN_INFO "proteon.c: AutoSelect no IRQ available\n"); goto out3; } } @@ -196,15 +196,15 @@ static int __init setup_card(struct net_ break; if (irqlist[j] == 0) { - printk(KERN_INFO "%s: Illegal IRQ %d specified\n&q
[PATCH] Re: List of recent (2.4.0 to 2.4.2-ac18) CONFIG optionsneeding Configure.help text.
Hi Steven, On Sat, 10 Mar 2001, Steven Cole wrote: > If you see any of _your_ options in the list below, please consider making > a patch for Configure.help for your CONFIG option. > CONFIG_TMSISA --- Configure.help.old Fri Feb 16 21:15:52 2001 +++ Configure.help Mon Apr 16 17:03:39 2001 @@ -9730,6 +9730,18 @@ The module will be called tmspci.o. If you want to compile it as a module, say M here and read Documentation/modules.txt. +Generic TMS380 ISA support +CONFIG_TMSISA + This tms380 module supports generic TMS380-based ISA cards. + + These cards are known to work: + - SysKonnect TR4/16 ISA (SK-4190) + + This driver is available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + The module will be called tmsisa.o. If you want to compile it + as a module, say M here and read Documentation/modules.txt. + Madge Smart 16/4 PCI Mk2 support CONFIG_ABYSS This tms380 module supports the Madge Smart 16/4 PCI Mk2 Cheers, Jochen - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Linux Patch 2.4.2 for AVM A1 PCMCIA
Hello, this patch includes the ISDN driver for AVM A1 PCMCIA from Carsten Paeth into the linux kernel sources. Without the patch, it might be confusing for a user to be able to select AVM A1 PCMCIA support for the kernel, but it still doesn't work (because the PCMCIA part is missing). Cheers, Jochen diff -u -r -N linux/drivers/isdn/Makefile linux-2.4.2/drivers/isdn/Makefile --- linux/drivers/isdn/Makefile Fri Dec 29 23:40:54 2000 +++ linux-2.4.2/drivers/isdn/Makefile Sat Mar 10 15:55:59 2001 @@ -45,6 +45,15 @@ subdir-$(CONFIG_ISDN_DRV_EICON)+= eicon subdir-$(CONFIG_HYSDN) += hysdn +ifeq ($(CONFIG_PCMCIA),y) + subdir-y += pcmcia + subdir-m += pcmcia +else + ifeq ($(CONFIG_PCMCIA),m) +subdir-m += pcmcia + endif +endif + obj-y += $(addsuffix /vmlinux-obj.o, $(subdir-y)) # The global Rules.make. diff -u -r -N linux/drivers/isdn/pcmcia/Makefile linux-2.4.2/drivers/isdn/pcmcia/Makefile --- linux/drivers/isdn/pcmcia/Makefile Thu Jan 1 01:00:00 1970 +++ linux-2.4.2/drivers/isdn/pcmcia/MakefileSat Mar 10 15:55:30 2001 @@ -0,0 +1,20 @@ +# +# Makefile for drivers/isdn/pcmcia +# +# Note! Dependencies are done automagically by 'make dep', which also +# removes any old dependencies. DON'T put your own dependencies here +# unless it's something special (ie not a .c file). +# + +obj-y := +obj-n := +obj-m := +obj-:= + +ifeq ($(CONFIG_ISDN_DRV_HISAX),m) + ifeq ($(CONFIG_HISAX_AVM_A1_PCMCIA),y) +obj-m += avma1_cs.o + endif +endif + +include $(TOPDIR)/Rules.make diff -u -r -N linux/drivers/isdn/pcmcia/avma1_cs.c linux-2.4.2/drivers/isdn/pcmcia/avma1_cs.c --- linux/drivers/isdn/pcmcia/avma1_cs.cThu Jan 1 01:00:00 1970 +++ linux-2.4.2/drivers/isdn/pcmcia/avma1_cs.c Sat Mar 10 15:55:30 2001 @@ -0,0 +1,541 @@ +/*== + +A PCMCIA client driver for AVM B1/M1/M2 + +Written by Carsten Paeth, [EMAIL PROTECTED] + +==*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +int avm_a1_init_pcmcia(void *pcm_iob, int pcm_irq, int *busy_flag, int prot); +void HiSax_closecard(int cardnr); + + +/* + All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If + you do not define PCMCIA_DEBUG at all, all the debug code will be + left out. If you compile with PCMCIA_DEBUG=0, the debug code will + be present but disabled -- but it can then be enabled for specific + modules at load time with a 'pc_debug=#' option to insmod. +*/ +#ifdef PCMCIA_DEBUG +static int pc_debug = PCMCIA_DEBUG; +MODULE_PARM(pc_debug, "i"); +#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args); +static char *version = +"avma1_cs.c 1.00 1998/01/23 10:00:00 (Carsten Paeth)"; +#else +#define DEBUG(n, args...) +#endif + +/**/ + +/* Parameters that can be set with 'insmod' */ + +static int default_irq_list[11] = { 15, 13, 12, 11, 10, 9, 7, 5, 4, 3, -1 }; +static int irq_list[11] = { -1 }; +static int isdnprot = 2; + +MODULE_PARM(irq_list, "1-11i"); +MODULE_PARM(isdnprot, "1-4"); + +/**/ + +/* + The event() function is this driver's Card Services event handler. + It will be called by Card Services when an appropriate card status + event is received. The config() and release() entry points are + used to configure or release a socket, in response to card insertion + and ejection events. They are invoked from the skeleton event + handler. +*/ + +static void avma1cs_config(dev_link_t *link); +static void avma1cs_release(u_long arg); +static int avma1cs_event(event_t event, int priority, + event_callback_args_t *args); + +/* + The attach() and detach() entry points are used to create and destroy + "instances" of the driver, where each instance represents everything + needed to manage one actual PCMCIA card. +*/ + +static dev_link_t *avma1cs_attach(void); +static void avma1cs_detach(dev_link_t *); + +/* + The dev_info variable is the "key" that is used to match up this + device driver with appropriate cards, through the card configuration + database. +*/ + +static dev_info_t dev_info = "avma1_cs"; + +/* + A linked list of "instances" of the skeleton device. Each actual + PCMCIA card corresponds to one device instance, and is described + by one dev_link_t structure (defined in ds.h). + + You may not want to use a linked list for this -- for example, the + memory card driver uses an array of dev_link_t pointers, where minor + device numbers are used to derive the corresponding array ind
2.4.0 link error with modular PCMCIA
Hi, problem is that CONFIG_PCMCIA_NETCARD=y, although all drivers are compiled as modules, so there's no drivers/net/pcmcia/pcmcia_net.o... Cheers, Jochen make[1]: Leaving directory `/usr/src/linux/arch/i386/lib' ld -m elf_i386 -T /usr/src/linux/arch/i386/vmlinux.lds -e stext arch/i386/kernel/head.o arch/i386/kernel/init_task.o init/main.o init/version.o \ --start-group \ arch/i386/kernel/kernel.o arch/i386/mm/mm.o kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o \ drivers/block/block.o drivers/char/char.o drivers/misc/misc.o drivers/net/net.o drivers/media/media.o drivers/char/drm/drm.o drivers/net/tokenring/tr.a drivers/atm/atm.o drivers/ide/idedriver.o drivers/cdrom/driver.o drivers/sound/sounddrivers.o drivers/pci/driver.o drivers/net/pcmcia/pcmcia_net.o drivers/video/video.o drivers/acpi/acpi.o drivers/md/mddev.o \ net/network.o \ /usr/src/linux/arch/i386/lib/lib.a /usr/src/linux/lib/lib.a /usr/src/linux/arch/i386/lib/lib.a \ --end-group \ -o vmlinux ld: cannot open drivers/net/pcmcia/pcmcia_net.o: No such file or directory make: *** [vmlinux] Error 1 # # Automatically generated by make menuconfig: don't edit # CONFIG_X86=y CONFIG_ISA=y # CONFIG_SBUS is not set CONFIG_UID16=y # # Code maturity level options # CONFIG_EXPERIMENTAL=y # # Loadable module support # CONFIG_MODULES=y CONFIG_MODVERSIONS=y CONFIG_KMOD=y # # Processor type and features # # CONFIG_M386 is not set # CONFIG_M486 is not set CONFIG_M586=y # CONFIG_M586TSC is not set # CONFIG_M586MMX is not set # CONFIG_M686 is not set # CONFIG_M686FXSR is not set # CONFIG_MPENTIUM4 is not set # CONFIG_MK6 is not set # CONFIG_MK7 is not set # CONFIG_MCRUSOE is not set # CONFIG_MWINCHIPC6 is not set # CONFIG_MWINCHIP2 is not set # CONFIG_MWINCHIP3D is not set CONFIG_X86_WP_WORKS_OK=y CONFIG_X86_INVLPG=y CONFIG_X86_CMPXCHG=y CONFIG_X86_BSWAP=y CONFIG_X86_POPAD_OK=y CONFIG_X86_L1_CACHE_SHIFT=5 CONFIG_X86_USE_STRING_486=y CONFIG_X86_ALIGNMENT_16=y # CONFIG_TOSHIBA is not set # CONFIG_MICROCODE is not set CONFIG_X86_MSR=m # CONFIG_X86_CPUID is not set CONFIG_NOHIGHMEM=y # CONFIG_HIGHMEM4G is not set # CONFIG_HIGHMEM64G is not set # CONFIG_MATH_EMULATION is not set # CONFIG_MTRR is not set # CONFIG_SMP is not set CONFIG_X86_UP_IOAPIC=y CONFIG_X86_IO_APIC=y CONFIG_X86_LOCAL_APIC=y # # General setup # CONFIG_NET=y # CONFIG_VISWS is not set CONFIG_PCI=y # CONFIG_PCI_GOBIOS is not set # CONFIG_PCI_GODIRECT is not set CONFIG_PCI_GOANY=y CONFIG_PCI_BIOS=y CONFIG_PCI_DIRECT=y CONFIG_PCI_NAMES=y # CONFIG_EISA is not set # CONFIG_MCA is not set CONFIG_HOTPLUG=y # # PCMCIA/CardBus support # CONFIG_PCMCIA=m CONFIG_CARDBUS=y CONFIG_I82365=y # CONFIG_TCIC is not set CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y CONFIG_KCORE_ELF=y # CONFIG_KCORE_AOUT is not set CONFIG_BINFMT_AOUT=m CONFIG_BINFMT_ELF=y CONFIG_BINFMT_MISC=m CONFIG_PM=y CONFIG_ACPI=y CONFIG_APM=m # CONFIG_APM_IGNORE_USER_SUSPEND is not set CONFIG_APM_DO_ENABLE=y CONFIG_APM_CPU_IDLE=y CONFIG_APM_DISPLAY_BLANK=y CONFIG_APM_RTC_IS_GMT=y CONFIG_APM_ALLOW_INTS=y CONFIG_APM_REAL_MODE_POWER_OFF=y # # Memory Technology Devices (MTD) # # CONFIG_MTD is not set # # Parallel port support # CONFIG_PARPORT=m CONFIG_PARPORT_PC=m CONFIG_PARPORT_PC_FIFO=y CONFIG_PARPORT_PC_SUPERIO=y # CONFIG_PARPORT_AMIGA is not set # CONFIG_PARPORT_MFC3 is not set # CONFIG_PARPORT_ATARI is not set # CONFIG_PARPORT_SUNBPP is not set # CONFIG_PARPORT_OTHER is not set # CONFIG_PARPORT_1284 is not set # # Plug and Play configuration # CONFIG_PNP=m CONFIG_ISAPNP=m # # Block devices # CONFIG_BLK_DEV_FD=m # CONFIG_BLK_DEV_XD is not set # CONFIG_PARIDE is not set # CONFIG_BLK_CPQ_DA is not set # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set CONFIG_BLK_DEV_LOOP=m CONFIG_BLK_DEV_NBD=m CONFIG_BLK_DEV_RAM=m CONFIG_BLK_DEV_RAM_SIZE=4096 # CONFIG_BLK_DEV_INITRD is not set # # Multi-device support (RAID and LVM) # CONFIG_MD=y CONFIG_BLK_DEV_MD=m CONFIG_MD_LINEAR=m CONFIG_MD_RAID0=m CONFIG_MD_RAID1=m CONFIG_MD_RAID5=m CONFIG_BLK_DEV_LVM=m CONFIG_LVM_PROC_FS=y # # Networking options # CONFIG_PACKET=m CONFIG_PACKET_MMAP=y CONFIG_NETLINK=y CONFIG_RTNETLINK=y CONFIG_NETLINK_DEV=m CONFIG_NETFILTER=y CONFIG_NETFILTER_DEBUG=y CONFIG_FILTER=y CONFIG_UNIX=y CONFIG_INET=y CONFIG_IP_MULTICAST=y CONFIG_IP_ADVANCED_ROUTER=y CONFIG_RTNETLINK=y CONFIG_NETLINK=y CONFIG_IP_MULTIPLE_TABLES=y CONFIG_IP_ROUTE_FWMARK=y CONFIG_IP_ROUTE_NAT=y CONFIG_IP_ROUTE_MULTIPATH=y CONFIG_IP_ROUTE_TOS=y CONFIG_IP_ROUTE_VERBOSE=y CONFIG_IP_ROUTE_LARGE_TABLES=y # CONFIG_IP_PNP is not set CONFIG_NET_IPIP=m CONFIG_NET_IPGRE=m CONFIG_NET_IPGRE_BROADCAST=y CONFIG_IP_MROUTE=y CONFIG_IP_PIMSM_V1=y CONFIG_IP_PIMSM_V2=y CONFIG_ARPD=y CONFIG_INET_ECN=y CONFIG_SYN_COOKIES=y # # IP: Netfilter Configuration # # CONFIG_IP_NF_CONNTRACK is not set # CONFIG_IP_NF_QUEUE is not set # CONFIG_IP_NF_IPTABLES is not set # CONFIG_IP_NF_COMPAT_IPCHAINS is not set # CONFIG_IP_NF_COMPAT_IPFWADM is not