* Re: RFC: cpm2_devices.c
From: Allen Curtis @ 2005-06-15 3:57 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-embedded
In-Reply-To: <Pine.LNX.4.61.0506142231040.2447@nylon.am.freescale.net>
> I've also included our version of this patch for commentary. Did you
> see a
> need for the following to actually be devices? (DMA, CPM, SI1, SIC2).
>
The good thing about them actually being devices is that you can find
them and the IO resources had already been remapped. You don't need a
device driver for them but they are resources used by other device
drivers.
> I can provide feedback on all the issues I had with you patch, but
> would
> prefer to start with ours (let me know).
>
Comments:
1. You removed the other PRAM definition from this FCC definition, this
is good.
2. I am torn about using numeric IMMR offsets vs. the structure member
approach. The good thing is that you can create all the devices in a
single table even if they overlay depending on processor. The question
is, will the IMMAP structure become obsolete? If not, then you will
still need the conditional compiles in immap_cpm2.h.
3. Naming convention, are all these devices just in the MPC82xx family?
If the CPM is a general FSL co-processor, used across many processor
families, then I like the CPM2 naming convention.
4. What about PCI?
5. This patch does not address the platform specific device structures.
How do you want to handle these?
Thanks for the patch, this helps.
> - kumar
>
>
> diff --git a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile
> --- a/arch/ppc/syslib/Makefile
> +++ b/arch/ppc/syslib/Makefile
> @@ -80,7 +80,8 @@ obj-$(CONFIG_SANDPOINT) += i8259.o pci_
> obj-$(CONFIG_SBC82xx) += todc_time.o
> obj-$(CONFIG_SPRUCE) += cpc700_pic.o indirect_pci.o pci_auto.o \
> todc_time.o
> -obj-$(CONFIG_8260) += m8260_setup.o
> +obj-$(CONFIG_8260) += m8260_setup.o mpc82xx_devices.o mpc82xx_sys.o \
> + ppc_sys.o
> obj-$(CONFIG_PCI_8260) += m82xx_pci.o indirect_pci.o pci_auto.o
> obj-$(CONFIG_8260_PCI9) += m8260_pci_erratum9.o
> obj-$(CONFIG_CPM2) += cpm2_common.o cpm2_pic.o
> diff --git a/arch/ppc/syslib/mpc82xx_devices.c
> b/arch/ppc/syslib/mpc82xx_devices.c
> new file mode 100644
> --- /dev/null
> +++ b/arch/ppc/syslib/mpc82xx_devices.c
> @@ -0,0 +1,389 @@
> +/*
> + * arch/ppc/syslib/mpc82xx_devices.c
> + *
> + * MPC82xx Device descriptions
> + *
> + * Maintainer: Kumar Gala <kumar.gala@freescale.com>
> + *
> + * This file is licensed under the terms of the GNU General Public
> License
> + * version 2. This program is licensed "as is" without any warranty
> of any
> + * kind, whether express or implied.
> + */
> +
> +
> +#include <linux/init.h>
> +#include <linux/module.h>
> +#include <linux/device.h>
> +#include <linux/ioport.h>
> +#include <asm/cpm2.h>
> +#include <asm/irq.h>
> +#include <asm/ppc_sys.h>
> +
> +struct platform_device ppc_sys_platform_devices[] = {
> + [MPC82xx_CPM_FCC1] = {
> + .name = "fsl-cpm-fcc",
> + .id = 1,
> + .num_resources = 3,
> + .resource = (struct resource[]) {
> + {
> + .name = "fcc_regs",
> + .start = 0x11300,
> + .end = 0x1131f,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .name = "fcc_pram",
> + .start = 0x8400,
> + .end = 0x84ff,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .start = SIU_INT_FCC1,
> + .end = SIU_INT_FCC1,
> + .flags = IORESOURCE_IRQ,
> + },
> + },
> + },
> + [MPC82xx_CPM_FCC2] = {
> + .name = "fsl-cpm-fcc",
> + .id = 2,
> + .num_resources = 3,
> + .resource = (struct resource[]) {
> + {
> + .name = "fcc_regs",
> + .start = 0x11320,
> + .end = 0x1133f,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .name = "fcc_pram",
> + .start = 0x8500,
> + .end = 0x85ff,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .start = SIU_INT_FCC2,
> + .end = SIU_INT_FCC2,
> + .flags = IORESOURCE_IRQ,
> + },
> + },
> + },
> + [MPC82xx_CPM_FCC3] = {
> + .name = "fsl-cpm-fcc",
> + .id = 3,
> + .num_resources = 3,
> + .resource = (struct resource[]) {
> + {
> + .name = "fcc_regs",
> + .start = 0x11340,
> + .end = 0x1135f,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .name = "fcc_pram",
> + .start = 0x8600,
> + .end = 0x86ff,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .start = SIU_INT_FCC3,
> + .end = SIU_INT_FCC3,
> + .flags = IORESOURCE_IRQ,
> + },
> + },
> + },
> + [MPC82xx_CPM_I2C] = {
> + .name = "fsl-cpm-i2c",
> + .id = 1,
> + .num_resources = 3,
> + .resource = (struct resource[]) {
> + {
> + .name = "i2c_mem",
> + .start = 0x11860,
> + .end = 0x118BF,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .name = "i2c_pram",
> + .start = 0x8afc,
> + .end = 0x8afd,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .start = SIU_INT_I2C,
> + .end = SIU_INT_I2C,
> + .flags = IORESOURCE_IRQ,
> + },
> + },
> + },
> + [MPC82xx_CPM_SCC1] = {
> + .name = "fsl-cpm-scc",
> + .id = 1,
> + .num_resources = 3,
> + .resource = (struct resource[]) {
> + {
> + .name = "scc_mem",
> + .start = 0x11A00,
> + .end = 0x11A1F,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .name = "scc_pram",
> + .start = 0x8000,
> + .end = 0x80ff,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .start = SIU_INT_SCC1,
> + .end = SIU_INT_SCC1,
> + .flags = IORESOURCE_IRQ,
> + },
> + },
> + },
> + [MPC82xx_CPM_SCC2] = {
> + .name = "fsl-cpm-scc",
> + .id = 2,
> + .num_resources = 3,
> + .resource = (struct resource[]) {
> + {
> + .name = "scc_mem",
> + .start = 0x11A20,
> + .end = 0x11A3F,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .name = "scc_pram",
> + .start = 0x8100,
> + .end = 0x81ff,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .start = SIU_INT_SCC2,
> + .end = SIU_INT_SCC2,
> + .flags = IORESOURCE_IRQ,
> + },
> + },
> + },
> + [MPC82xx_CPM_SCC3] = {
> + .name = "fsl-cpm-scc",
> + .id = 3,
> + .num_resources = 3,
> + .resource = (struct resource[]) {
> + {
> + .name = "scc_mem",
> + .start = 0x11A40,
> + .end = 0x11A5F,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .name = "scc_pram",
> + .start = 0x8200,
> + .end = 0x82ff,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .start = SIU_INT_SCC3,
> + .end = SIU_INT_SCC3,
> + .flags = IORESOURCE_IRQ,
> + },
> + },
> + },
> + [MPC82xx_CPM_SCC4] = {
> + .name = "fsl-cpm-scc",
> + .id = 4,
> + .num_resources = 3,
> + .resource = (struct resource[]) {
> + {
> + .name = "scc_mem",
> + .start = 0x11A60,
> + .end = 0x11A7F,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .name = "scc_pram",
> + .start = 0x8300,
> + .end = 0x83ff,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .start = SIU_INT_SCC4,
> + .end = SIU_INT_SCC4,
> + .flags = IORESOURCE_IRQ,
> + },
> + },
> + },
> + [MPC82xx_CPM_SPI] = {
> + .name = "fsl-cpm-spi",
> + .id = 1,
> + .num_resources = 3,
> + .resource = (struct resource[]) {
> + {
> + .name = "spi_mem",
> + .start = 0x11AA0,
> + .end = 0x11AFF,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .name = "spi_pram",
> + .start = 0x89fc,
> + .end = 0x89fd,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .start = SIU_INT_SPI,
> + .end = SIU_INT_SPI,
> + .flags = IORESOURCE_IRQ,
> + },
> + },
> + },
> + [MPC82xx_CPM_MCC1] = {
> + .name = "fsl-cpm-mcc",
> + .id = 1,
> + .num_resources = 3,
> + .resource = (struct resource[]) {
> + {
> + .name = "mcc_mem",
> + .start = 0x11B30,
> + .end = 0x11B3F,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .name = "mcc_pram",
> + .start = 0x8700,
> + .end = 0x877f,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .start = SIU_INT_MCC1,
> + .end = SIU_INT_MCC1,
> + .flags = IORESOURCE_IRQ,
> + },
> + },
> + },
> + [MPC82xx_CPM_MCC2] = {
> + .name = "fsl-cpm-mcc",
> + .id = 2,
> + .num_resources = 3,
> + .resource = (struct resource[]) {
> + {
> + .name = "mcc_mem",
> + .start = 0x11B50,
> + .end = 0x11B5F,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .name = "mcc_pram",
> + .start = 0x8800,
> + .end = 0x887f,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .start = SIU_INT_MCC2,
> + .end = SIU_INT_MCC2,
> + .flags = IORESOURCE_IRQ,
> + },
> + },
> + },
> + [MPC82xx_CPM_SMC1] = {
> + .name = "fsl-cpm-smc",
> + .id = 1,
> + .num_resources = 3,
> + .resource = (struct resource[]) {
> + {
> + .name = "smc_mem",
> + .start = 0x11A80,
> + .end = 0x11A8F,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .name = "smc_pram",
> + .start = 0x87fc,
> + .end = 0x87fd,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .start = SIU_INT_SMC1,
> + .end = SIU_INT_SMC1,
> + .flags = IORESOURCE_IRQ,
> + },
> + },
> + },
> + [MPC82xx_CPM_SMC2] = {
> + .name = "fsl-cpm-smc",
> + .id = 2,
> + .num_resources = 3,
> + .resource = (struct resource[]) {
> + {
> + .name = "smc_mem",
> + .start = 0x11A90,
> + .end = 0x11A9F,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .name = "smc_pram",
> + .start = 0x88fc,
> + .end = 0x88fd,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .start = SIU_INT_SMC2,
> + .end = SIU_INT_SMC2,
> + .flags = IORESOURCE_IRQ,
> + },
> + },
> + },
> + [MPC82xx_CPM_USB] = {
> + .name = "fsl-cpm-usb",
> + .id = 1,
> + .num_resources = 3,
> + .resource = (struct resource[]) {
> + {
> + .name = "usb_mem",
> + .start = 0x11b60,
> + .end = 0x11b78,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .name = "usb_pram",
> + .start = 0x8b00,
> + .end = 0x8bff,
> + .flags = IORESOURCE_MEM,
> + },
> + {
> + .start = SIU_INT_USB,
> + .end = SIU_INT_USB,
> + .flags = IORESOURCE_IRQ,
> + },
> +
> + },
> + },
> + [MPC82xx_SEC1] = {
> + .name = "fsl-sec",
> + .id = 1,
> + .num_resources = 1,
> + .resource = (struct resource[]) {
> + {
> + .name = "sec_mem",
> + .start = 0x40000,
> + .end = 0x52fff,
> + .flags = IORESOURCE_MEM,
> + },
> + },
> + },
> +};
> +
> +static int __init mach_mpc82xx_fixup(struct platform_device *pdev)
> +{
> + ppc_sys_fixup_mem_resource(pdev, CPM_MAP_ADDR);
> + return 0;
> +}
> +
> +static int __init mach_mpc82xx_init(void)
> +{
> + if (ppc_md.progress)
> + ppc_md.progress("mach_mpc82xx_init:enter", 0);
> + ppc_sys_device_fixup = mach_mpc82xx_fixup;
> + return 0;
> +}
> +
> +postcore_initcall(mach_mpc82xx_init);
> diff --git a/arch/ppc/syslib/mpc82xx_sys.c
> b/arch/ppc/syslib/mpc82xx_sys.c
> new file mode 100644
> --- /dev/null
> +++ b/arch/ppc/syslib/mpc82xx_sys.c
> @@ -0,0 +1,200 @@
> +/*
> + * arch/ppc/syslib/mpc82xx_devices.c
> + *
> + * MPC82xx System descriptions
> + *
> + * Maintainer: Kumar Gala <kumar.gala@freescale.com>
> + *
> + * This file is licensed under the terms of the GNU General Public
> License
> + * version 2. This program is licensed "as is" without any warranty
> of any
> + * kind, whether express or implied.
> + */
> +
> +#include <linux/init.h>
> +#include <linux/module.h>
> +#include <linux/device.h>
> +
> +#include <asm/ppc_sys.h>
> +
> +struct ppc_sys_spec *cur_ppc_sys_spec;
> +struct ppc_sys_spec ppc_sys_specs[] = {
> + /* below is a list of the 8260 family of processors */
> + {
> + .ppc_sys_name = "8250",
> + .mask = 0x0000ff00,
> + .value = 0x00000000,
> + .num_devices = 12,
> + .device_list = (enum ppc_sys_devices[])
> + {
> + MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
> + MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
> + MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1,
> + MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
> + }
> + },
> + {
> + .ppc_sys_name = "8255",
> + .mask = 0x0000ff00,
> + .value = 0x00000000,
> + .num_devices = 11,
> + .device_list = (enum ppc_sys_devices[])
> + {
> + MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1,
> + MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SCC4,
> + MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1, MPC82xx_CPM_SMC2,
> + MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
> + }
> + },
> + {
> + .ppc_sys_name = "8260",
> + .mask = 0x0000ff00,
> + .value = 0x00000000,
> + .num_devices = 12,
> + .device_list = (enum ppc_sys_devices[])
> + {
> + MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
> + MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
> + MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1,
> + MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
> + }
> + },
> + {
> + .ppc_sys_name = "8264",
> + .mask = 0x0000ff00,
> + .value = 0x00000000,
> + .num_devices = 12,
> + .device_list = (enum ppc_sys_devices[])
> + {
> + MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
> + MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
> + MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1,
> + MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
> + }
> + },
> + {
> + .ppc_sys_name = "8265",
> + .mask = 0x0000ff00,
> + .value = 0x00000000,
> + .num_devices = 12,
> + .device_list = (enum ppc_sys_devices[])
> + {
> + MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
> + MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
> + MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1,
> + MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
> + }
> + },
> + {
> + .ppc_sys_name = "8266",
> + .mask = 0x0000ff00,
> + .value = 0x00000000,
> + .num_devices = 12,
> + .device_list = (enum ppc_sys_devices[])
> + {
> + MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
> + MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
> + MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1,
> + MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
> + }
> + },
> + /* below is a list of the 8272 family of processors */
> + {
> + .ppc_sys_name = "8247",
> + .mask = 0x000fe000,
> + .value = 0x0000c000,
> + .num_devices = 10,
> + .device_list = (enum ppc_sys_devices[])
> + {
> + MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1,
> + MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SMC1,
> + MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
> + MPC82xx_CPM_USB,
> + },
> + },
> + {
> + .ppc_sys_name = "8248",
> + .mask = 0x000fe000,
> + .value = 0x0000c000,
> + .num_devices = 11,
> + .device_list = (enum ppc_sys_devices[])
> + {
> + MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1,
> + MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SMC1,
> + MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
> + MPC82xx_CPM_USB, MPC82xx_SEC1,
> + },
> + },
> + {
> + .ppc_sys_name = "8271",
> + .mask = 0x000fe000,
> + .value = 0x0000c000,
> + .num_devices = 10,
> + .device_list = (enum ppc_sys_devices[])
> + {
> + MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1,
> + MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SMC1,
> + MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
> + MPC82xx_CPM_USB,
> + },
> + },
> + {
> + .ppc_sys_name = "8272",
> + .mask = 0x000fe000,
> + .value = 0x0000c000,
> + .num_devices = 11,
> + .device_list = (enum ppc_sys_devices[])
> + {
> + MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1,
> + MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SMC1,
> + MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
> + MPC82xx_CPM_USB, MPC82xx_SEC1,
> + },
> + },
> + /* below is a list of the 8280 family of processors */
> + {
> + .ppc_sys_name = "8270",
> + .mask = 0x0000ff00,
> + .value = 0x00000a00,
> + .num_devices = 12,
> + .device_list = (enum ppc_sys_devices[])
> + {
> + MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
> + MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
> + MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1,
> + MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
> + },
> + },
> + {
> + .ppc_sys_name = "8275",
> + .mask = 0x0000ff00,
> + .value = 0x00000a00,
> + .num_devices = 12,
> + .device_list = (enum ppc_sys_devices[])
> + {
> + MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
> + MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
> + MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1,
> + MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
> + },
> + },
> + {
> + .ppc_sys_name = "8280",
> + .mask = 0x0000ff00,
> + .value = 0x00000a00,
> + .num_devices = 13,
> + .device_list = (enum ppc_sys_devices[])
> + {
> + MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
> + MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
> + MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_MCC2,
> + MPC82xx_CPM_SMC1, MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI,
> + MPC82xx_CPM_I2C,
> + },
> + },
> + {
> + /* default match */
> + .ppc_sys_name = "",
> + .mask = 0x00000000,
> + .value = 0x00000000,
> + },
> +};
> diff --git a/include/asm-ppc/irq.h b/include/asm-ppc/irq.h
> --- a/include/asm-ppc/irq.h
> +++ b/include/asm-ppc/irq.h
> @@ -331,6 +331,7 @@ static __inline__ int irq_canonicalize(i
> #define SIU_INT_IDMA3 ((uint)0x08 + CPM_IRQ_OFFSET)
> #define SIU_INT_IDMA4 ((uint)0x09 + CPM_IRQ_OFFSET)
> #define SIU_INT_SDMA ((uint)0x0a + CPM_IRQ_OFFSET)
> +#define SIU_INT_USB ((uint)0x0b + CPM_IRQ_OFFSET)
> #define SIU_INT_TIMER1 ((uint)0x0c + CPM_IRQ_OFFSET)
> #define SIU_INT_TIMER2 ((uint)0x0d + CPM_IRQ_OFFSET)
> #define SIU_INT_TIMER3 ((uint)0x0e + CPM_IRQ_OFFSET)
> diff --git a/include/asm-ppc/mpc8260.h b/include/asm-ppc/mpc8260.h
> --- a/include/asm-ppc/mpc8260.h
> +++ b/include/asm-ppc/mpc8260.h
> @@ -34,8 +34,7 @@
>
> #ifdef CONFIG_TQM8260
> #include <platforms/tqm8260.h>
> -#endif
> -
> +#endif
> #if defined(CONFIG_PQ2ADS) || defined (CONFIG_PQ2FADS)
> #include <platforms/pq2ads.h>
> #endif
> @@ -66,6 +65,24 @@
> #ifndef IO_VIRT_ADDR
> #define IO_VIRT_ADDR IO_PHYS_ADDR
> #endif
> +
> +enum ppc_sys_devices {
> + MPC82xx_CPM_FCC1,
> + MPC82xx_CPM_FCC2,
> + MPC82xx_CPM_FCC3,
> + MPC82xx_CPM_I2C,
> + MPC82xx_CPM_SCC1,
> + MPC82xx_CPM_SCC2,
> + MPC82xx_CPM_SCC3,
> + MPC82xx_CPM_SCC4,
> + MPC82xx_CPM_SPI,
> + MPC82xx_CPM_MCC1,
> + MPC82xx_CPM_MCC2,
> + MPC82xx_CPM_SMC1,
> + MPC82xx_CPM_SMC2,
> + MPC82xx_CPM_USB,
> + MPC82xx_SEC1,
> +};
>
> #ifndef __ASSEMBLY__
> /* The "residual" data board information structure the boot loader
> diff --git a/include/asm-ppc/ppc_sys.h b/include/asm-ppc/ppc_sys.h
> --- a/include/asm-ppc/ppc_sys.h
> +++ b/include/asm-ppc/ppc_sys.h
> @@ -21,7 +21,9 @@
> #include <linux/device.h>
> #include <linux/types.h>
>
> -#if defined(CONFIG_83xx)
> +#if defined(CONFIG_8260)
> +#include <asm/mpc8260.h>
> +#elif defined(CONFIG_83xx)
> #include <asm/mpc83xx.h>
> #elif defined(CONFIG_85xx)
> #include <asm/mpc85xx.h>
>
^ permalink raw reply
* Re: RFC: cpm2_devices.c
From: Kumar Gala @ 2005-06-15 3:35 UTC (permalink / raw)
To: Allen Curtis; +Cc: linuxppc-embedded
In-Reply-To: <1118773086.29515.10.camel@dell2650.onz.com>
Allen,
I've also included our version of this patch for commentary. Did you see a
need for the following to actually be devices? (DMA, CPM, SI1, SIC2).
I can provide feedback on all the issues I had with you patch, but would
prefer to start with ours (let me know).
- kumar
diff --git a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile
--- a/arch/ppc/syslib/Makefile
+++ b/arch/ppc/syslib/Makefile
@@ -80,7 +80,8 @@ obj-$(CONFIG_SANDPOINT) += i8259.o pci_
obj-$(CONFIG_SBC82xx) += todc_time.o
obj-$(CONFIG_SPRUCE) += cpc700_pic.o indirect_pci.o pci_auto.o \
todc_time.o
-obj-$(CONFIG_8260) += m8260_setup.o
+obj-$(CONFIG_8260) += m8260_setup.o mpc82xx_devices.o mpc82xx_sys.o \
+ ppc_sys.o
obj-$(CONFIG_PCI_8260) += m82xx_pci.o indirect_pci.o pci_auto.o
obj-$(CONFIG_8260_PCI9) += m8260_pci_erratum9.o
obj-$(CONFIG_CPM2) += cpm2_common.o cpm2_pic.o
diff --git a/arch/ppc/syslib/mpc82xx_devices.c b/arch/ppc/syslib/mpc82xx_devices.c
new file mode 100644
--- /dev/null
+++ b/arch/ppc/syslib/mpc82xx_devices.c
@@ -0,0 +1,389 @@
+/*
+ * arch/ppc/syslib/mpc82xx_devices.c
+ *
+ * MPC82xx Device descriptions
+ *
+ * Maintainer: Kumar Gala <kumar.gala@freescale.com>
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/device.h>
+#include <linux/ioport.h>
+#include <asm/cpm2.h>
+#include <asm/irq.h>
+#include <asm/ppc_sys.h>
+
+struct platform_device ppc_sys_platform_devices[] = {
+ [MPC82xx_CPM_FCC1] = {
+ .name = "fsl-cpm-fcc",
+ .id = 1,
+ .num_resources = 3,
+ .resource = (struct resource[]) {
+ {
+ .name = "fcc_regs",
+ .start = 0x11300,
+ .end = 0x1131f,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "fcc_pram",
+ .start = 0x8400,
+ .end = 0x84ff,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = SIU_INT_FCC1,
+ .end = SIU_INT_FCC1,
+ .flags = IORESOURCE_IRQ,
+ },
+ },
+ },
+ [MPC82xx_CPM_FCC2] = {
+ .name = "fsl-cpm-fcc",
+ .id = 2,
+ .num_resources = 3,
+ .resource = (struct resource[]) {
+ {
+ .name = "fcc_regs",
+ .start = 0x11320,
+ .end = 0x1133f,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "fcc_pram",
+ .start = 0x8500,
+ .end = 0x85ff,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = SIU_INT_FCC2,
+ .end = SIU_INT_FCC2,
+ .flags = IORESOURCE_IRQ,
+ },
+ },
+ },
+ [MPC82xx_CPM_FCC3] = {
+ .name = "fsl-cpm-fcc",
+ .id = 3,
+ .num_resources = 3,
+ .resource = (struct resource[]) {
+ {
+ .name = "fcc_regs",
+ .start = 0x11340,
+ .end = 0x1135f,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "fcc_pram",
+ .start = 0x8600,
+ .end = 0x86ff,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = SIU_INT_FCC3,
+ .end = SIU_INT_FCC3,
+ .flags = IORESOURCE_IRQ,
+ },
+ },
+ },
+ [MPC82xx_CPM_I2C] = {
+ .name = "fsl-cpm-i2c",
+ .id = 1,
+ .num_resources = 3,
+ .resource = (struct resource[]) {
+ {
+ .name = "i2c_mem",
+ .start = 0x11860,
+ .end = 0x118BF,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "i2c_pram",
+ .start = 0x8afc,
+ .end = 0x8afd,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = SIU_INT_I2C,
+ .end = SIU_INT_I2C,
+ .flags = IORESOURCE_IRQ,
+ },
+ },
+ },
+ [MPC82xx_CPM_SCC1] = {
+ .name = "fsl-cpm-scc",
+ .id = 1,
+ .num_resources = 3,
+ .resource = (struct resource[]) {
+ {
+ .name = "scc_mem",
+ .start = 0x11A00,
+ .end = 0x11A1F,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "scc_pram",
+ .start = 0x8000,
+ .end = 0x80ff,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = SIU_INT_SCC1,
+ .end = SIU_INT_SCC1,
+ .flags = IORESOURCE_IRQ,
+ },
+ },
+ },
+ [MPC82xx_CPM_SCC2] = {
+ .name = "fsl-cpm-scc",
+ .id = 2,
+ .num_resources = 3,
+ .resource = (struct resource[]) {
+ {
+ .name = "scc_mem",
+ .start = 0x11A20,
+ .end = 0x11A3F,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "scc_pram",
+ .start = 0x8100,
+ .end = 0x81ff,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = SIU_INT_SCC2,
+ .end = SIU_INT_SCC2,
+ .flags = IORESOURCE_IRQ,
+ },
+ },
+ },
+ [MPC82xx_CPM_SCC3] = {
+ .name = "fsl-cpm-scc",
+ .id = 3,
+ .num_resources = 3,
+ .resource = (struct resource[]) {
+ {
+ .name = "scc_mem",
+ .start = 0x11A40,
+ .end = 0x11A5F,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "scc_pram",
+ .start = 0x8200,
+ .end = 0x82ff,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = SIU_INT_SCC3,
+ .end = SIU_INT_SCC3,
+ .flags = IORESOURCE_IRQ,
+ },
+ },
+ },
+ [MPC82xx_CPM_SCC4] = {
+ .name = "fsl-cpm-scc",
+ .id = 4,
+ .num_resources = 3,
+ .resource = (struct resource[]) {
+ {
+ .name = "scc_mem",
+ .start = 0x11A60,
+ .end = 0x11A7F,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "scc_pram",
+ .start = 0x8300,
+ .end = 0x83ff,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = SIU_INT_SCC4,
+ .end = SIU_INT_SCC4,
+ .flags = IORESOURCE_IRQ,
+ },
+ },
+ },
+ [MPC82xx_CPM_SPI] = {
+ .name = "fsl-cpm-spi",
+ .id = 1,
+ .num_resources = 3,
+ .resource = (struct resource[]) {
+ {
+ .name = "spi_mem",
+ .start = 0x11AA0,
+ .end = 0x11AFF,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "spi_pram",
+ .start = 0x89fc,
+ .end = 0x89fd,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = SIU_INT_SPI,
+ .end = SIU_INT_SPI,
+ .flags = IORESOURCE_IRQ,
+ },
+ },
+ },
+ [MPC82xx_CPM_MCC1] = {
+ .name = "fsl-cpm-mcc",
+ .id = 1,
+ .num_resources = 3,
+ .resource = (struct resource[]) {
+ {
+ .name = "mcc_mem",
+ .start = 0x11B30,
+ .end = 0x11B3F,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "mcc_pram",
+ .start = 0x8700,
+ .end = 0x877f,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = SIU_INT_MCC1,
+ .end = SIU_INT_MCC1,
+ .flags = IORESOURCE_IRQ,
+ },
+ },
+ },
+ [MPC82xx_CPM_MCC2] = {
+ .name = "fsl-cpm-mcc",
+ .id = 2,
+ .num_resources = 3,
+ .resource = (struct resource[]) {
+ {
+ .name = "mcc_mem",
+ .start = 0x11B50,
+ .end = 0x11B5F,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "mcc_pram",
+ .start = 0x8800,
+ .end = 0x887f,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = SIU_INT_MCC2,
+ .end = SIU_INT_MCC2,
+ .flags = IORESOURCE_IRQ,
+ },
+ },
+ },
+ [MPC82xx_CPM_SMC1] = {
+ .name = "fsl-cpm-smc",
+ .id = 1,
+ .num_resources = 3,
+ .resource = (struct resource[]) {
+ {
+ .name = "smc_mem",
+ .start = 0x11A80,
+ .end = 0x11A8F,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "smc_pram",
+ .start = 0x87fc,
+ .end = 0x87fd,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = SIU_INT_SMC1,
+ .end = SIU_INT_SMC1,
+ .flags = IORESOURCE_IRQ,
+ },
+ },
+ },
+ [MPC82xx_CPM_SMC2] = {
+ .name = "fsl-cpm-smc",
+ .id = 2,
+ .num_resources = 3,
+ .resource = (struct resource[]) {
+ {
+ .name = "smc_mem",
+ .start = 0x11A90,
+ .end = 0x11A9F,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "smc_pram",
+ .start = 0x88fc,
+ .end = 0x88fd,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = SIU_INT_SMC2,
+ .end = SIU_INT_SMC2,
+ .flags = IORESOURCE_IRQ,
+ },
+ },
+ },
+ [MPC82xx_CPM_USB] = {
+ .name = "fsl-cpm-usb",
+ .id = 1,
+ .num_resources = 3,
+ .resource = (struct resource[]) {
+ {
+ .name = "usb_mem",
+ .start = 0x11b60,
+ .end = 0x11b78,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "usb_pram",
+ .start = 0x8b00,
+ .end = 0x8bff,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = SIU_INT_USB,
+ .end = SIU_INT_USB,
+ .flags = IORESOURCE_IRQ,
+ },
+
+ },
+ },
+ [MPC82xx_SEC1] = {
+ .name = "fsl-sec",
+ .id = 1,
+ .num_resources = 1,
+ .resource = (struct resource[]) {
+ {
+ .name = "sec_mem",
+ .start = 0x40000,
+ .end = 0x52fff,
+ .flags = IORESOURCE_MEM,
+ },
+ },
+ },
+};
+
+static int __init mach_mpc82xx_fixup(struct platform_device *pdev)
+{
+ ppc_sys_fixup_mem_resource(pdev, CPM_MAP_ADDR);
+ return 0;
+}
+
+static int __init mach_mpc82xx_init(void)
+{
+ if (ppc_md.progress)
+ ppc_md.progress("mach_mpc82xx_init:enter", 0);
+ ppc_sys_device_fixup = mach_mpc82xx_fixup;
+ return 0;
+}
+
+postcore_initcall(mach_mpc82xx_init);
diff --git a/arch/ppc/syslib/mpc82xx_sys.c b/arch/ppc/syslib/mpc82xx_sys.c
new file mode 100644
--- /dev/null
+++ b/arch/ppc/syslib/mpc82xx_sys.c
@@ -0,0 +1,200 @@
+/*
+ * arch/ppc/syslib/mpc82xx_devices.c
+ *
+ * MPC82xx System descriptions
+ *
+ * Maintainer: Kumar Gala <kumar.gala@freescale.com>
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/device.h>
+
+#include <asm/ppc_sys.h>
+
+struct ppc_sys_spec *cur_ppc_sys_spec;
+struct ppc_sys_spec ppc_sys_specs[] = {
+ /* below is a list of the 8260 family of processors */
+ {
+ .ppc_sys_name = "8250",
+ .mask = 0x0000ff00,
+ .value = 0x00000000,
+ .num_devices = 12,
+ .device_list = (enum ppc_sys_devices[])
+ {
+ MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
+ MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
+ MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1,
+ MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
+ }
+ },
+ {
+ .ppc_sys_name = "8255",
+ .mask = 0x0000ff00,
+ .value = 0x00000000,
+ .num_devices = 11,
+ .device_list = (enum ppc_sys_devices[])
+ {
+ MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1,
+ MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SCC4,
+ MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1, MPC82xx_CPM_SMC2,
+ MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
+ }
+ },
+ {
+ .ppc_sys_name = "8260",
+ .mask = 0x0000ff00,
+ .value = 0x00000000,
+ .num_devices = 12,
+ .device_list = (enum ppc_sys_devices[])
+ {
+ MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
+ MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
+ MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1,
+ MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
+ }
+ },
+ {
+ .ppc_sys_name = "8264",
+ .mask = 0x0000ff00,
+ .value = 0x00000000,
+ .num_devices = 12,
+ .device_list = (enum ppc_sys_devices[])
+ {
+ MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
+ MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
+ MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1,
+ MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
+ }
+ },
+ {
+ .ppc_sys_name = "8265",
+ .mask = 0x0000ff00,
+ .value = 0x00000000,
+ .num_devices = 12,
+ .device_list = (enum ppc_sys_devices[])
+ {
+ MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
+ MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
+ MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1,
+ MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
+ }
+ },
+ {
+ .ppc_sys_name = "8266",
+ .mask = 0x0000ff00,
+ .value = 0x00000000,
+ .num_devices = 12,
+ .device_list = (enum ppc_sys_devices[])
+ {
+ MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
+ MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
+ MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1,
+ MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
+ }
+ },
+ /* below is a list of the 8272 family of processors */
+ {
+ .ppc_sys_name = "8247",
+ .mask = 0x000fe000,
+ .value = 0x0000c000,
+ .num_devices = 10,
+ .device_list = (enum ppc_sys_devices[])
+ {
+ MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1,
+ MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SMC1,
+ MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
+ MPC82xx_CPM_USB,
+ },
+ },
+ {
+ .ppc_sys_name = "8248",
+ .mask = 0x000fe000,
+ .value = 0x0000c000,
+ .num_devices = 11,
+ .device_list = (enum ppc_sys_devices[])
+ {
+ MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1,
+ MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SMC1,
+ MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
+ MPC82xx_CPM_USB, MPC82xx_SEC1,
+ },
+ },
+ {
+ .ppc_sys_name = "8271",
+ .mask = 0x000fe000,
+ .value = 0x0000c000,
+ .num_devices = 10,
+ .device_list = (enum ppc_sys_devices[])
+ {
+ MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1,
+ MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SMC1,
+ MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
+ MPC82xx_CPM_USB,
+ },
+ },
+ {
+ .ppc_sys_name = "8272",
+ .mask = 0x000fe000,
+ .value = 0x0000c000,
+ .num_devices = 11,
+ .device_list = (enum ppc_sys_devices[])
+ {
+ MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1,
+ MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SMC1,
+ MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
+ MPC82xx_CPM_USB, MPC82xx_SEC1,
+ },
+ },
+ /* below is a list of the 8280 family of processors */
+ {
+ .ppc_sys_name = "8270",
+ .mask = 0x0000ff00,
+ .value = 0x00000a00,
+ .num_devices = 12,
+ .device_list = (enum ppc_sys_devices[])
+ {
+ MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
+ MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
+ MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1,
+ MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
+ },
+ },
+ {
+ .ppc_sys_name = "8275",
+ .mask = 0x0000ff00,
+ .value = 0x00000a00,
+ .num_devices = 12,
+ .device_list = (enum ppc_sys_devices[])
+ {
+ MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
+ MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
+ MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_SMC1,
+ MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C,
+ },
+ },
+ {
+ .ppc_sys_name = "8280",
+ .mask = 0x0000ff00,
+ .value = 0x00000a00,
+ .num_devices = 13,
+ .device_list = (enum ppc_sys_devices[])
+ {
+ MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_FCC3,
+ MPC82xx_CPM_SCC1, MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3,
+ MPC82xx_CPM_SCC4, MPC82xx_CPM_MCC1, MPC82xx_CPM_MCC2,
+ MPC82xx_CPM_SMC1, MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI,
+ MPC82xx_CPM_I2C,
+ },
+ },
+ {
+ /* default match */
+ .ppc_sys_name = "",
+ .mask = 0x00000000,
+ .value = 0x00000000,
+ },
+};
diff --git a/include/asm-ppc/irq.h b/include/asm-ppc/irq.h
--- a/include/asm-ppc/irq.h
+++ b/include/asm-ppc/irq.h
@@ -331,6 +331,7 @@ static __inline__ int irq_canonicalize(i
#define SIU_INT_IDMA3 ((uint)0x08 + CPM_IRQ_OFFSET)
#define SIU_INT_IDMA4 ((uint)0x09 + CPM_IRQ_OFFSET)
#define SIU_INT_SDMA ((uint)0x0a + CPM_IRQ_OFFSET)
+#define SIU_INT_USB ((uint)0x0b + CPM_IRQ_OFFSET)
#define SIU_INT_TIMER1 ((uint)0x0c + CPM_IRQ_OFFSET)
#define SIU_INT_TIMER2 ((uint)0x0d + CPM_IRQ_OFFSET)
#define SIU_INT_TIMER3 ((uint)0x0e + CPM_IRQ_OFFSET)
diff --git a/include/asm-ppc/mpc8260.h b/include/asm-ppc/mpc8260.h
--- a/include/asm-ppc/mpc8260.h
+++ b/include/asm-ppc/mpc8260.h
@@ -34,8 +34,7 @@
#ifdef CONFIG_TQM8260
#include <platforms/tqm8260.h>
-#endif
-
+#endif
#if defined(CONFIG_PQ2ADS) || defined (CONFIG_PQ2FADS)
#include <platforms/pq2ads.h>
#endif
@@ -66,6 +65,24 @@
#ifndef IO_VIRT_ADDR
#define IO_VIRT_ADDR IO_PHYS_ADDR
#endif
+
+enum ppc_sys_devices {
+ MPC82xx_CPM_FCC1,
+ MPC82xx_CPM_FCC2,
+ MPC82xx_CPM_FCC3,
+ MPC82xx_CPM_I2C,
+ MPC82xx_CPM_SCC1,
+ MPC82xx_CPM_SCC2,
+ MPC82xx_CPM_SCC3,
+ MPC82xx_CPM_SCC4,
+ MPC82xx_CPM_SPI,
+ MPC82xx_CPM_MCC1,
+ MPC82xx_CPM_MCC2,
+ MPC82xx_CPM_SMC1,
+ MPC82xx_CPM_SMC2,
+ MPC82xx_CPM_USB,
+ MPC82xx_SEC1,
+};
#ifndef __ASSEMBLY__
/* The "residual" data board information structure the boot loader
diff --git a/include/asm-ppc/ppc_sys.h b/include/asm-ppc/ppc_sys.h
--- a/include/asm-ppc/ppc_sys.h
+++ b/include/asm-ppc/ppc_sys.h
@@ -21,7 +21,9 @@
#include <linux/device.h>
#include <linux/types.h>
-#if defined(CONFIG_83xx)
+#if defined(CONFIG_8260)
+#include <asm/mpc8260.h>
+#elif defined(CONFIG_83xx)
#include <asm/mpc83xx.h>
#elif defined(CONFIG_85xx)
#include <asm/mpc85xx.h>
^ permalink raw reply
* Re: [PATCH 2.6][PPC32] RESEND: don't recursively crash in die() on CHRP/PReP machines
From: Benjamin Herrenschmidt @ 2005-06-14 23:11 UTC (permalink / raw)
To: Jakub Bogusz; +Cc: Andrew Morton, linuxppc-dev, linux-kernel
In-Reply-To: <20050614193826.GE13702@fngna.oyu>
On Tue, 2005-06-14 at 21:38 +0200, Jakub Bogusz wrote:
> This patch avoids recursive crash (leading to kernel stack overflow) in
> die() on CHRP/PReP machines when CONFIG_PMAC_BACKLIGHT=y.
> set_backlight_* functions are placed in pmac section, which is discarded
> when _machine != _MACH_Pmac.
>
> I already posted this patch to LKML few months ago:
> http://www.ussg.iu.edu/hypermail/linux/kernel/0412.0/0300.html
> and it has been applied to linux-2.4 tree, but still not 2.6.
> (patch was made against 2.4.27, but still applies cleanly against
> kernels up to 2.6.11.12)
>
> Signed-off-by: Jakub Bogusz <qboosh@pld-linux.org>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> --- linux-2.4.27/arch/ppc/kernel/traps.c.orig Wed Apr 14 15:05:27 2004
> +++ linux-2.4.27/arch/ppc/kernel/traps.c Mon Nov 29 19:05:28 2004
> @@ -88,8 +88,10 @@
> console_verbose();
> spin_lock_irq(&die_lock);
> #ifdef CONFIG_PMAC_BACKLIGHT
> - set_backlight_enable(1);
> - set_backlight_level(BACKLIGHT_MAX);
> + if (_machine == _MACH_Pmac) {
> + set_backlight_enable(1);
> + set_backlight_level(BACKLIGHT_MAX);
> + }
> #endif
> printk("Oops: %s, sig: %ld\n", str, err);
> show_regs(fp);
>
>
^ permalink raw reply
* [PATCH 2.6][PPC32] RESEND: don't recursively crash in die() on CHRP/PReP machines
From: Jakub Bogusz @ 2005-06-14 19:38 UTC (permalink / raw)
To: linux-kernel, linuxppc-dev
This patch avoids recursive crash (leading to kernel stack overflow) in
die() on CHRP/PReP machines when CONFIG_PMAC_BACKLIGHT=y.
set_backlight_* functions are placed in pmac section, which is discarded
when _machine != _MACH_Pmac.
I already posted this patch to LKML few months ago:
http://www.ussg.iu.edu/hypermail/linux/kernel/0412.0/0300.html
and it has been applied to linux-2.4 tree, but still not 2.6.
(patch was made against 2.4.27, but still applies cleanly against
kernels up to 2.6.11.12)
Signed-off-by: Jakub Bogusz <qboosh@pld-linux.org>
--- linux-2.4.27/arch/ppc/kernel/traps.c.orig Wed Apr 14 15:05:27 2004
+++ linux-2.4.27/arch/ppc/kernel/traps.c Mon Nov 29 19:05:28 2004
@@ -88,8 +88,10 @@
console_verbose();
spin_lock_irq(&die_lock);
#ifdef CONFIG_PMAC_BACKLIGHT
- set_backlight_enable(1);
- set_backlight_level(BACKLIGHT_MAX);
+ if (_machine == _MACH_Pmac) {
+ set_backlight_enable(1);
+ set_backlight_level(BACKLIGHT_MAX);
+ }
#endif
printk("Oops: %s, sig: %ld\n", str, err);
show_regs(fp);
--
Jakub Bogusz http://qboosh.cs.net.pl/
^ permalink raw reply
* RFC: cpm2_devices.c
From: Allen Curtis @ 2005-06-14 18:18 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 796 bytes --]
Please review and comment on the following.
My comments regarding the implementation:
1. This implementation uses the cpm_map_t structure definition to derive
the IORESOURCE_MEM regions. This seems to be more adaptible to CPM
address differences but it assumes that there are unique structures for
each processor type.
2. ppc_sys_spec appears to identify the CPM elements which are
applicable to a particular processor. So this structure, not the
cpm_map_t structure identifies the CPM resources. This implementation
addresses the the CPU differences but assumes that a CPM resource is
always at the same IMMAP address. The FCC, DPRAM usage is an example of
an exception to this rule.
Note: The attachment was generated via cg-diff, please let me know if
there is a preferred format.
Thanks
[-- Attachment #2: cpm2_devices.patch --]
[-- Type: text/x-patch, Size: 12562 bytes --]
diff --git a/arch/ppc/syslib/cpm2_devices.c b/arch/ppc/syslib/cpm2_devices.c
new file mode 100644
--- /dev/null
+++ b/arch/ppc/syslib/cpm2_devices.c
@@ -0,0 +1,460 @@
+/*
+ * arch/ppc/platforms/cpm2_devices.c
+ *
+ * General CPM2 Device descriptions
+ *
+ * Maintainer: Allen Curtis <acurtis@onz.com>
+ * Derived from mpc83xx_devices.c by Kumar Gala
+ *
+ * Copyright 2005 Ones and Zeros Inc.
+ *
+ * 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.
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/device.h>
+#include <linux/fsl_devices.h>
+#include <asm/cpm2.h>
+#include <asm/irq.h>
+#include <asm/ppc_sys.h>
+
+/* We use offsets for IORESOURCE_MEM since we do not know at compile time
+ * what IMMRBAR is, will get fixed up by mach_mpc83xx_fixup
+ */
+
+#define CPM2_STARTOF(m) (offsetof(cpm2_map_t,(m)))
+#define CCPM2_ENDOF(m) (CPM_STARTOF(m)+sizeof(m)-1)
+
+/* Define the CPM2 platform devices
+ */
+struct platform_device ppc_sys_platform_devices[] = {
+ [CPM2_FCC1] = {
+ .name = "fsl-cpm-fcc",
+ .id = 1,
+ .dev.platform_data = ,
+ .num_resources = 5,
+ .resource = (struct resource[]) {
+ {
+ .name = "fcc_regs",
+ .start = CPM2_STARTOF(im_fcc[0]),
+ .end = CPM2_ENDOF(im_fcc[0]),
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "fcc_regs_c",
+ .start = CPM2_STARTOF(im_fcc_c[0]),
+ .end = CPM2_ENDOF(im_fcc_c[0]),
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "fcc_pram",
+ .start = PROFF_FCC1,
+ .end = PROFF_FCC1 + PROFF_FCC_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ /* fcc_mem
+ * This should be allocated from DPRAM, not part
+ * of this structure definition.
+ */
+ {
+ .name = "fcc_mem",
+ .start = PROFF_FCC1_MEM_BASE,
+ .end = PROFF_FCC1_MEM_BASE + PROFF_FCC_MEM_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "interrupt",
+ .start = SIU_INT_FCC1,
+ .end = SIU_INT_FCC1,
+ .flags = IORESOURCE_IRQ,
+ },
+ },
+ },
+ [CPM2_FCC2] = {
+ .name = "fsl-cpm-fcc",
+ .id = 2,
+ .dev.platform_data = ,
+ .num_resources = 5,
+ .resource = (struct resource[]) {
+ {
+ .name = "fcc_regs",
+ .start = CPM2_STARTOF(im_fcc[1]),
+ .end = CPM2_ENDOF(im_fcc[1]),
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "fcc_regs_c",
+ .start = CPM2_STARTOF(im_fcc_c[1]),
+ .end = CPM2_ENDOF(im_fcc_c[1]),
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "fcc_pram",
+ .start = PROFF_FCC2,
+ .end = PROFF_FCC2 + PROFF_FCC_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ /* fcc_mem
+ * This should be allocated from DPRAM, not part
+ * of this structure definition.
+ */
+ {
+ .name = "fcc_mem",
+ .start = PROFF_FCC2_MEM_BASE,
+ .end = PROFF_FCC2_MEM_BASE + PROFF_FCC_MEM_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "interrupt",
+ .start = SIU_INT_FCC2,
+ .end = SIU_INT_FCC2,
+ .flags = IORESOURCE_IRQ,
+ },
+ },
+ },
+ [CPM2_FCC3] = {
+ .name = "fsl-cpm-fcc",
+ .id = 3,
+ .dev.platform_data = ,
+ .num_resources = 5,
+ .resource = (struct resource[]) {
+ {
+ .name = "fcc_regs",
+ .start = CPM2_STARTOF(im_fcc[2]),
+ .end = CPM2_ENDOF(im_fcc[2]),
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "fcc_regs_c",
+ .start = CPM2_STARTOF(im_fcc_c[2]),
+ .end = CPM2_ENDOF(im_fcc_c[2]),
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "fcc_pram",
+ .start = PROFF_FCC3,
+ .end = PROFF_FCC3 + PROFF_FCC_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ /* fcc_mem
+ * This should be allocated from DPRAM, not part
+ * of this structure definition.
+ */
+ {
+ .name = "fcc_mem",
+ .start = PROFF_FCC3_MEM_BASE,
+ .end = PROFF_FCC3_MEM_BASE + PROFF_FCC_MEM_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "interrupt",
+ .start = SIU_INT_FCC3,
+ .end = SIU_INT_FCC3,
+ .flags = IORESOURCE_IRQ,
+ },
+ },
+ },
+ [CPM2_SCC1] = {
+ .name = "fsl-cpm-scc",
+ .id = 1,
+ .dev.platform_data = ,
+ .num_resources = 3,
+ .resource = (struct resource[]) {
+ {
+ .name = "scc_regs",
+ .start = CPM2_STARTOF(im_scc[0]),
+ .end = CPM2_ENDOF(im_scc[0]),
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "scc_pram",
+ .start = PROFF_SCC1,
+ .end = PROFF_SCC1 + PROFF_SCC_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "interrupt",
+ .start = SIU_INT_SCC1,
+ .end = SIU_INT_SCC1,
+ .flags = IORESOURCE_IRQ,
+ },
+ },
+ },
+ [CPM2_SCC2] = {
+ .name = "fsl-cpm-scc",
+ .id = 2,
+ .dev.platform_data = ,
+ .num_resources = 3,
+ .resource = (struct resource[]) {
+ {
+ .name = "scc_regs",
+ .start = CPM2_STARTOF(im_scc[1]),
+ .end = CPM2_ENDOF(im_scc[1]),
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "scc_pram",
+ .start = PROFF_SCC2,
+ .end = PROFF_SCC2 + PROFF_SCC_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "interrupt",
+ .start = SIU_INT_SCC2,
+ .end = SIU_INT_SCC2,
+ .flags = IORESOURCE_IRQ,
+ },
+ },
+ },
+ [CPM2_SCC3] = {
+ .name = "fsl-cpm-scc",
+ .id = 3,
+ .dev.platform_data = ,
+ .num_resources = 3,
+ .resource = (struct resource[]) {
+ {
+ .name = "scc_regs",
+ .start = CPM2_STARTOF(im_scc[2]),
+ .end = CPM2_ENDOF(im_scc[2]),
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "scc_pram",
+ .start = PROFF_SCC3,
+ .end = PROFF_SCC3 + PROFF_SCC_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "interrupt",
+ .start = SIU_INT_SCC3,
+ .end = SIU_INT_SCC3,
+ .flags = IORESOURCE_IRQ,
+ },
+ },
+ },
+ [CPM2_SCC4] = {
+ .name = "fsl-cpm-scc",
+ .id = 4,
+ .dev.platform_data = ,
+ .num_resources = 3,
+ .resource = (struct resource[]) {
+ {
+ .name = "scc_regs",
+ .start = CPM2_STARTOF(im_scc[3]),
+ .end = CPM2_ENDOF(im_scc[3]),
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "scc_pram",
+ .start = PROFF_SCC4,
+ .end = PROFF_SCC4 + PROFF_SCC_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "interrupt",
+ .start = SIU_INT_SCC4,
+ .end = SIU_INT_SCC4,
+ .flags = IORESOURCE_IRQ,
+ },
+ },
+ },
+ [CPM2_SMC1] = {
+ .name = "fsl-cpm-smc",
+ .id = 1,
+ .dev.platform_data = ,
+ .num_resources = 3,
+ .resource = (struct resource[]) {
+ {
+ .name = "smc_regs",
+ .start = CPM2_STARTOF(im_smc[0]),
+ .end = CPM2_ENDOF(im_smc[0]),
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "smc_pram",
+ .start = PROFF_SMC1_BASE,
+ .end = PROFF_SMC1_BASE + PROFF_SMC_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "interrupt",
+ .start = SIU_INT_SMC1,
+ .end = SIU_INT_SMC1,
+ .flags = IORESOURCE_IRQ,
+ },
+ },
+ },
+ [CPM2_SMC2] = {
+ .name = "fsl-cpm-smc",
+ .id = 2,
+ .dev.platform_data = ,
+ .num_resources = 3,
+ .resource = (struct resource[]) {
+ {
+ .name = "smc_regs",
+ .start = CPM2_STARTOF(im_smc[1]),
+ .end = CPM2_ENDOF(im_smc[1]),
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "smc_pram",
+ .start = PROFF_SMC2_BASE,
+ .end = PROFF_SMC2_BASE + PROFF_SMC_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "interrupt",
+ .start = SIU_INT_SMC2,
+ .end = SIU_INT_SMC2,
+ .flags = IORESOURCE_IRQ,
+ },
+ },
+ },
+ [CPM2_I2C] = {
+ .name = "fsl-cpm-i2c",
+ .id = 1,
+ .dev.platform_data = ,
+ .num_resources = 3,
+ .resource = (struct resource[]) {
+ {
+ .name = "i2c_regs",
+ .start = CPM2_STARTOF(im_i2c),
+ .end = CPM2_ENDOF(im_i2c),
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "i2c_pram",
+ .start = PROFF_I2C_BASE,
+ .end = PROFF_I2C_BASE + PROFF_I2C_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "interrupt",
+ .start = SIU_INT_I2C,
+ .end = SIU_INT_I2C,
+ .flags = IORESOURCE_IRQ,
+ },
+ },
+ },
+ [CPM2_SPI] = {
+ .name = "fsl-cpm-spi",
+ .id = 1,
+ .dev.platform_data = ,
+ .num_resources = 3,
+ .resource = (struct resource[]) {
+ {
+ .name = "spi_regs",
+ .start = CPM2_STARTOF(im_spi),
+ .end = CPM2_ENDOF(im_spi),
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "spi_pram",
+ .start = PROFF_SPI_BASE,
+ .end = PROFF_SPI_BASE + PROFF_SPI_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "interrupt",
+ .start = SIU_INT_SPI,
+ .end = SIU_INT_SPI,
+ .flags = IORESOURCE_IRQ,
+ },
+ },
+ },
+ [CPM2_CPM] = {
+ .name = "fsl-cpm-cpm",
+ .id = 1,
+ .dev.platform_data = ,
+ .num_resources = 2,
+ .resource = (struct resource[]) {
+ {
+ .name = "cpm_regs",
+ .start = CPM2_STARTOF(im_cpm),
+ .end = CPM2_ENDOF(im_cpm),
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "cpm_mux",
+ .start = CPM2_STARTOF(im_cpmux),
+ .end = CPM2_ENDOF(im_cpmux),
+ .flags = IORESOURCE_MEM,
+ },
+ },
+ },
+#if !defined(CONFIG_8272) && !defined(CONFIG_MPC8555)
+ [CPM2_MMC1] = {
+ .name = "fsl-cpm-mmc",
+ .id = 1,
+ .dev.platform_data = ,
+ .num_resources = 3,
+ .resource = (struct resource[]) {
+ {
+ .name = "mmc_regs",
+ .start = CPM2_STARTOF(im_mmc1),
+ .end = CPM2_ENDOF(im_mmc1),
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "mmc_pram",
+ .start = PROFF_MMC1,
+ .end = PROFF_MMC1 + PROFF_MMC_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "interrupt",
+ .start = SIU_INT_MMC1,
+ .end = SIU_INT_MMC1,
+ .flags = IORESOURCE_IRQ,
+ },
+ },
+ },
+ [CPM2_MMC2] = {
+ .name = "fsl-cpm-mmc",
+ .id = 2,
+ .dev.platform_data = ,
+ .num_resources = 3,
+ .resource = (struct resource[]) {
+ {
+ .name = "mmc_regs",
+ .start = CPM2_STARTOF(im_mmc2),
+ .end = CPM2_ENDOF(im_mmc2),
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "mmc_pram",
+ .start = PROFF_MMC2,
+ .end = PROFF_MMC2 + PROFF_MMC_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "interrupt",
+ .start = SIU_INT_MMC2,
+ .end = SIU_INT_MMC2,
+ .flags = IORESOURCE_IRQ,
+ },
+ },
+ },
+#endif
+
+
+static int __init mach_cpm2_fixup(struct platform_device *pdev)
+{
+ ppc_sys_fixup_mem_resource(pdev, CPM_MAP_ADDR);
+ return 0;
+}
+
+static int __init mach_cpm2_init(void)
+{
+ if (ppc_md.progress)
+ ppc_md.progress("mach_cpm2_init:enter", 0);
+ ppc_sys_device_fixup = mach_cpm2_fixup;
+ return 0;
+}
+
+postcore_initcall(mach_cpm2_init);
+
\ No newline at end of file
diff --git a/include/asm-ppc/cpm2.h b/include/asm-ppc/cpm2.h
--- a/include/asm-ppc/cpm2.h
+++ b/include/asm-ppc/cpm2.h
@@ -170,6 +170,20 @@ typedef struct cpm_buf_desc {
#define PROFF_I2C_BASE ((uint)0x8afc)
#define PROFF_IDMA4_BASE ((uint)0x8afe)
+#define PROFF_FCC_SIZE ((uint))256)
+#define PROFF_SCC_SIZE ((uint))256)
+#define PROFF_SMC_SIZE ((uint)2)
+#define PROFF_IDMA_SIZE ((uint)2)
+#define PROFF_SPI_SIZE ((uint)2)
+#define PROFF_I2C_SIZE ((uint)2)
+#define PROFF_MMC_SIZE ((uint)124)
+#define PROFF_USB_SIZE ((uint)256)
+
+#define PROFF_FCC_MEM_SIZE ((uint)128)
+#define PROFF_FCC1_MEM_BASE (CPM_FCC_SPECIAL_BASE+(PROFF_FCC_MEM_SIZE*0))
+#define PROFF_FCC2_MEM_BASE (CPM_FCC_SPECIAL_BASE+(PROFF_FCC_MEM_SIZE*1))
+#define PROFF_FCC3_MEM_BASE (CPM_FCC_SPECIAL_BASE+(PROFF_FCC_MEM_SIZE*2))
+
/* The SMCs are relocated to any of the first eight DPRAM pages.
* We will fix these at the first locations of DPRAM, until we
* get some microcode patches :-).
@@ -1084,6 +1098,40 @@ typedef struct im_idma {
#define SCCR_PCIDF_MSK 0x00000078 /* PCI division factor */
#define SCCR_PCIDF_SHIFT 3
+/*-----------------------------------------------------------------------
+ * Enumeration of PPC/CPM2 devices for platform initialization
+ */
+
+/* It says this should be an enumeration. If it was #defines then the
+ * cpm2_devices array definition could be conditionally compiled.
+ *
+ * Another approach would be to add all devices and have a flags field
+ * for the different CPM configuration options.
+ */
+enum ppc_sys_devices {
+ CPM2_FCC1,
+ CPM2_FCC2,
+ CPM2_FCC3,
+ CPM2_SCC1,
+ CPM2_SCC2,
+ CPM2_SCC3,
+ CPM2_SCC4,
+ CPM2_SMC1,
+ CPM2_SMC2,
+ CPM2_I2C,
+ CPM2_SPI,
+/* CPM2_DMA, think about this more, separate SDMA and IDMA? */
+ CPM2_CPM,
+/* CPM2_SI2, */
+#if !defined(CONFIG_8272) && !defined(CONFIG_MPC8555)
+ CPM2_SI1,
+ CPM2_MMC1,
+ CPM2_MMC2,
+#else
+ CPM2_USB,
+#endf
+};
+
#endif /* __CPM2__ */
#endif /* __KERNEL__ */
^ permalink raw reply
* Re: boot kernel problem?
From: Allen Curtis @ 2005-06-14 14:21 UTC (permalink / raw)
To: leo_guo; +Cc: wolfgang, linuxppc-embedded-request, linuxppc-embedded
In-Reply-To: <OQa9KclZrJxs$vCkAaFuL$rXNJWNzE@leo_guo>
0xc0000000 is where the kernel is located in virtual space, after boot
and initialization.
On Jun 14, 2005, at 1:00 AM, leo_guo@jisung.cn wrote:
> Hi all,
>
> For MPC82xx, running U-BOOT-1.1.2 and linux-2.4.24, I have a question:
>
> After uboot download the kernel through net/serial or read out it from
> flash, then it decompress the kernel to SDRAM, from the begin address
> 0x0, and execute the first instruction.
>
> But I am puzzle that the linux kernel entry address is 0xc0000000(know
> from file System.map), how
> can the kernel bootup if you decompress the kernel to address 0x0?
> And I know the MMU is off now.
>
>
> Best Regards!
>
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
^ permalink raw reply
* [PATCH] [RFT] ppc32: add Freescale MPC86xADS boards support
From: Andrei Konovalov @ 2005-06-14 13:30 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 893 bytes --]
This patch adds the Freescale MPC86xADS board to 2.6.12-rc6.
The supported devices are SMC UART and 10Mbit ethernet on SCC1.
The manual for the board says that it "is compatible with the MPC8xxFADS for
software point of view". That's why this patch extends FADS instead of
introducing a new platform.
As far as I can tell, 2.6.12-rc6 misses support for SCC ethernet on FADS.
This patch should fix that, but we don't have the FADS board to check if it does.
And it would be nice if someone gives this patch a run on FADS to verify FADS is
not broken. Thanks in advance.
FEC is not supported as the "combined FCC/FEC ethernet driver" driver
by Pantelis Antoniou (first posted to this list on May 9; I'll
call it "fs_enet" for short) should replace the current FEC driver.
Signed-off-by: Gennadiy Kurtsman <gkurtsman@ru.mvista.com>
Signed-off-by: Andrei Konovalov <akonovalov@ru.mvista.com>
[-- Attachment #2: mpc86xads.20050614.diff --]
[-- Type: text/plain, Size: 18337 bytes --]
diff -Nupr -x .git linux-2.5.base/arch/ppc/configs/mpc86x_ads_defconfig linux-2.5.new/arch/ppc/configs/mpc86x_ads_defconfig
--- linux-2.5.base/arch/ppc/configs/mpc86x_ads_defconfig 1970-01-01 03:00:00.000000000 +0300
+++ linux-2.5.new/arch/ppc/configs/mpc86x_ads_defconfig 2005-06-14 14:06:10.000000000 +0400
@@ -0,0 +1,633 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.12-rc4
+# Tue Jun 14 13:36:35 2005
+#
+CONFIG_MMU=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_HAVE_DEC_LOCK=y
+CONFIG_PPC=y
+CONFIG_PPC32=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+# CONFIG_CLEAN_COMPILE is not set
+CONFIG_BROKEN=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+# CONFIG_SWAP is not set
+CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
+# CONFIG_HOTPLUG is not set
+CONFIG_KOBJECT_UEVENT=y
+# CONFIG_IKCONFIG is not set
+CONFIG_EMBEDDED=y
+# CONFIG_KALLSYMS is not set
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+# CONFIG_BASE_FULL is not set
+CONFIG_FUTEX=y
+# CONFIG_EPOLL is not set
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+# CONFIG_SHMEM is not set
+CONFIG_CC_ALIGN_FUNCTIONS=0
+CONFIG_CC_ALIGN_LABELS=0
+CONFIG_CC_ALIGN_LOOPS=0
+CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_TINY_SHMEM=y
+CONFIG_BASE_SMALL=1
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+# CONFIG_MODULE_UNLOAD is not set
+CONFIG_OBSOLETE_MODPARM=y
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+# CONFIG_KMOD is not set
+
+#
+# Processor
+#
+# CONFIG_6xx is not set
+# CONFIG_40x is not set
+# CONFIG_44x is not set
+# CONFIG_POWER3 is not set
+# CONFIG_POWER4 is not set
+CONFIG_8xx=y
+# CONFIG_E500 is not set
+# CONFIG_MATH_EMULATION is not set
+# CONFIG_CPU_FREQ is not set
+CONFIG_EMBEDDEDBOOT=y
+# CONFIG_PM is not set
+CONFIG_NOT_COHERENT_CACHE=y
+
+#
+# Platform options
+#
+CONFIG_FADS=y
+# CONFIG_RPXLITE is not set
+# CONFIG_RPXCLASSIC is not set
+# CONFIG_BSEIP is not set
+# CONFIG_MPC8XXFADS is not set
+CONFIG_MPC86XADS=y
+# CONFIG_TQM823L is not set
+# CONFIG_TQM850L is not set
+# CONFIG_TQM855L is not set
+# CONFIG_TQM860L is not set
+# CONFIG_FPS850L is not set
+# CONFIG_SPD823TS is not set
+# CONFIG_IVMS8 is not set
+# CONFIG_IVML24 is not set
+# CONFIG_SM850 is not set
+# CONFIG_HERMES_PRO is not set
+# CONFIG_IP860 is not set
+# CONFIG_LWMON is not set
+# CONFIG_PCU_E is not set
+# CONFIG_CCM is not set
+# CONFIG_LANTEC is not set
+# CONFIG_MBX is not set
+# CONFIG_WINCEPT is not set
+# CONFIG_SMP is not set
+# CONFIG_PREEMPT is not set
+# CONFIG_HIGHMEM is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_CMDLINE_BOOL is not set
+CONFIG_ISA_DMA_API=y
+
+#
+# Bus options
+#
+# CONFIG_PCI is not set
+# CONFIG_PCI_DOMAINS is not set
+# CONFIG_PCI_QSPAN is not set
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# Advanced setup
+#
+# CONFIG_ADVANCED_OPTIONS is not set
+
+#
+# Default settings for advanced configuration options are used
+#
+CONFIG_HIGHMEM_START=0xfe000000
+CONFIG_LOWMEM_SIZE=0x30000000
+CONFIG_KERNEL_START=0xc0000000
+CONFIG_TASK_SIZE=0x80000000
+CONFIG_CONSISTENT_START=0xff100000
+CONFIG_CONSISTENT_SIZE=0x00200000
+CONFIG_BOOT_LOAD=0x00400000
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+# CONFIG_STANDALONE is not set
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_FW_LOADER is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Plug and Play support
+#
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_RAM is not set
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_LBD is not set
+# CONFIG_CDROM_PKTCDVD is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_SCSI is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
+# Fusion MPT device support
+#
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_IEEE1394 is not set
+
+#
+# I2O device support
+#
+
+#
+# Macintosh device drivers
+#
+
+#
+# Networking support
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+# CONFIG_IP_PNP_BOOTP is not set
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_TUNNEL is not set
+CONFIG_IP_TCPDIAG=y
+# CONFIG_IP_TCPDIAG_IPV6 is not set
+CONFIG_IPV6=m
+# CONFIG_IPV6_PRIVACY is not set
+# CONFIG_INET6_AH is not set
+# CONFIG_INET6_ESP is not set
+# CONFIG_INET6_IPCOMP is not set
+# CONFIG_INET6_TUNNEL is not set
+# CONFIG_IPV6_TUNNEL is not set
+# CONFIG_NETFILTER is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_SCTP is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+# CONFIG_NET_CLS_ROUTE is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+# CONFIG_MII is not set
+# CONFIG_OAKNET is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+
+#
+# Ethernet (10000 Mbit)
+#
+
+#
+# Token Ring devices
+#
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+# CONFIG_INPUT is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+CONFIG_SOUND_GAMEPORT=y
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_CPM=y
+CONFIG_SERIAL_CPM_CONSOLE=y
+# CONFIG_SERIAL_CPM_SCC1 is not set
+# CONFIG_SERIAL_CPM_SCC2 is not set
+# CONFIG_SERIAL_CPM_SCC3 is not set
+# CONFIG_SERIAL_CPM_SCC4 is not set
+CONFIG_SERIAL_CPM_SMC1=y
+# CONFIG_SERIAL_CPM_SMC2 is not set
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_GEN_RTC is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Misc devices
+#
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# Graphics support
+#
+# CONFIG_FB is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+# CONFIG_USB_ARCH_HAS_HCD is not set
+# CONFIG_USB_ARCH_HAS_OHCI is not set
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# InfiniBand support
+#
+# CONFIG_INFINIBAND is not set
+
+#
+# File systems
+#
+# CONFIG_EXT2_FS is not set
+CONFIG_EXT3_FS=y
+# CONFIG_EXT3_FS_XATTR is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+
+#
+# XFS support
+#
+# CONFIG_XFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_QUOTA is not set
+# CONFIG_DNOTIFY is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
+# CONFIG_DEVFS_FS is not set
+# CONFIG_DEVPTS_FS_XATTR is not set
+# CONFIG_TMPFS is not set
+# CONFIG_HUGETLBFS is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+CONFIG_NFS_V4=y
+# CONFIG_NFS_DIRECTIO is not set
+# CONFIG_NFSD is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+
+#
+# Native Language Support
+#
+# CONFIG_NLS is not set
+
+#
+# MPC8xx CPM Options
+#
+CONFIG_SCC_ENET=y
+CONFIG_SCC1_ENET=y
+# CONFIG_SCC2_ENET is not set
+# CONFIG_SCC3_ENET is not set
+# CONFIG_FEC_ENET is not set
+# CONFIG_ENET_BIG_BUFFERS is not set
+
+#
+# Generic MPC8xx Options
+#
+# CONFIG_8xx_COPYBACK is not set
+# CONFIG_8xx_CPU6 is not set
+CONFIG_NO_UCODE_PATCH=y
+# CONFIG_USB_SOF_UCODE_PATCH is not set
+# CONFIG_I2C_SPI_UCODE_PATCH is not set
+# CONFIG_I2C_SPI_SMC1_UCODE_PATCH is not set
+
+#
+# Library routines
+#
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC32 is not set
+# CONFIG_LIBCRC32C is not set
+
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+# CONFIG_DEBUG_KERNEL is not set
+CONFIG_LOG_BUF_SHIFT=14
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
+CONFIG_CRYPTO=y
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_WP512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Hardware crypto devices
+#
diff -Nupr -x .git linux-2.5.base/arch/ppc/Kconfig linux-2.5.new/arch/ppc/Kconfig
--- linux-2.5.base/arch/ppc/Kconfig 2005-06-03 14:11:55.000000000 +0400
+++ linux-2.5.new/arch/ppc/Kconfig 2005-06-13 20:44:04.000000000 +0400
@@ -261,6 +261,9 @@ endmenu
menu "Platform options"
+config FADS
+ bool
+
choice
prompt "8xx Machine Type"
depends on 8xx
@@ -376,8 +379,17 @@ config BSEIP
26MB DRAM, 4MB flash, Ethernet, a 16K-gate FPGA, USB, an LCD/video
controller, and two RS232 ports.
-config FADS
+config MPC8XXFADS
bool "FADS"
+ select FADS
+
+config MPC86XADS
+ bool "MPC86XADS"
+ help
+ MPC86x Application Development System by Freescale Semiconductor.
+ The MPC86xADS is meant to serve as a platform for s/w and h/w
+ development around the MPC86X processor families.
+ select FADS
config TQM823L
bool "TQM823L"
diff -Nupr -x .git linux-2.5.base/arch/ppc/platforms/fads.h linux-2.5.new/arch/ppc/platforms/fads.h
--- linux-2.5.base/arch/ppc/platforms/fads.h 2005-05-24 20:11:22.000000000 +0400
+++ linux-2.5.new/arch/ppc/platforms/fads.h 2005-06-13 20:52:35.000000000 +0400
@@ -3,7 +3,18 @@
* the Motorola 860T FADS board. Copied from the MBX stuff.
*
* Copyright (c) 1998 Dan Malek (dmalek@jlc.net)
+ *
+ * Added MPC86XADS support.
+ * The MPC86xADS manual says the board "is compatible with the MPC8xxFADS
+ * for SW point of view". This is 99% correct.
+ *
+ * Author: MontaVista Software, Inc.
+ * source@mvista.com
+ * 2005 (c) MontaVista Software, Inc. This file is licensed under the
+ * terms of the GNU General Public License version 2. This program is licensed
+ * "as is" without any warranty of any kind, whether express or implied.
*/
+
#ifdef __KERNEL__
#ifndef __ASM_FADS_H__
#define __ASM_FADS_H__
@@ -12,18 +23,45 @@
#include <asm/ppcboot.h>
+#if defined(CONFIG_MPC86XADS)
+
+/* U-Boot maps BCSR to 0xff080000 */
+#define BCSR_ADDR ((uint)0xff080000)
+
+/* MPC86XADS has one more CPLD and an additional BCSR.
+ */
+#define CFG_PHYDEV_ADDR ((uint)0xff0a0000)
+#define BCSR5 ((uint)(CFG_PHYDEV_ADDR + 0x300))
+
+#define BCSR5_T1_RST 0x10
+#define BCSR5_ATM155_RST 0x08
+#define BCSR5_ATM25_RST 0x04
+#define BCSR5_MII1_EN 0x02
+#define BCSR5_MII1_RST 0x01
+
+/* There is no PHY link change interrupt */
+#define PHY_INTERRUPT (-1)
+
+#else /* FADS */
+
/* Memory map is configured by the PROM startup.
* I tried to follow the FADS manual, although the startup PROM
* dictates this and we simply have to move some of the physical
* addresses for Linux.
*/
#define BCSR_ADDR ((uint)0xff010000)
+
+/* PHY link change interrupt */
+#define PHY_INTERRUPT SIU_IRQ2
+
+#endif /* CONFIG_MPC86XADS */
+
#define BCSR_SIZE ((uint)(64 * 1024))
-#define BCSR0 ((uint)0xff010000)
-#define BCSR1 ((uint)0xff010004)
-#define BCSR2 ((uint)0xff010008)
-#define BCSR3 ((uint)0xff01000c)
-#define BCSR4 ((uint)0xff010010)
+#define BCSR0 ((uint)(BCSR_ADDR + 0x00))
+#define BCSR1 ((uint)(BCSR_ADDR + 0x04))
+#define BCSR2 ((uint)(BCSR_ADDR + 0x08))
+#define BCSR3 ((uint)(BCSR_ADDR + 0x0c))
+#define BCSR4 ((uint)(BCSR_ADDR + 0x10))
#define IMAP_ADDR ((uint)0xff000000)
#define IMAP_SIZE ((uint)(64 * 1024))
@@ -34,8 +72,17 @@
/* Bits of interest in the BCSRs.
*/
#define BCSR1_ETHEN ((uint)0x20000000)
+#define BCSR1_IRDAEN ((uint)0x10000000)
#define BCSR1_RS232EN_1 ((uint)0x01000000)
+#define BCSR1_PCCEN ((uint)0x00800000)
+#define BCSR1_PCCVCC0 ((uint)0x00400000)
+#define BCSR1_PCCVPP0 ((uint)0x00200000)
+#define BCSR1_PCCVPP1 ((uint)0x00100000)
+#define BCSR1_PCCVPP_MASK (BCSR1_PCCVPP0 | BCSR1_PCCVPP1)
#define BCSR1_RS232EN_2 ((uint)0x00040000)
+#define BCSR1_PCCVCC1 ((uint)0x00010000)
+#define BCSR1_PCCVCC_MASK (BCSR1_PCCVCC0 | BCSR1_PCCVCC1)
+
#define BCSR4_ETHLOOP ((uint)0x80000000) /* EEST Loopback */
#define BCSR4_EEFDX ((uint)0x40000000) /* EEST FDX enable */
#define BCSR4_FETH_EN ((uint)0x08000000) /* PHY enable */
@@ -44,14 +91,64 @@
#define BCSR4_FETHFDE ((uint)0x02000000) /* PHY FDX advertise */
#define BCSR4_FETHRST ((uint)0x00200000) /* PHY Reset */
+/* IO_BASE definition for pcmcia.
+ */
+#define _IO_BASE 0x80000000
+#define _IO_BASE_SIZE 0x1000
+
+#ifdef CONFIG_IDE
+#define MAX_HWIFS 1
+#endif
+
/* Interrupt level assignments.
*/
#define FEC_INTERRUPT SIU_LEVEL1 /* FEC interrupt */
-#define PHY_INTERRUPT SIU_IRQ2 /* PHY link change interrupt */
/* We don't use the 8259.
*/
#define NR_8259_INTS 0
+/* CPM Ethernet through SCC1 or SCC2 */
+
+#ifdef CONFIG_SCC1_ENET /* Probably 860 variant */
+/* Bits in parallel I/O port registers that have to be set/cleared
+ * to configure the pins for SCC1 use.
+ * TCLK - CLK1, RCLK - CLK2.
+ */
+#define PA_ENET_RXD ((ushort)0x0001)
+#define PA_ENET_TXD ((ushort)0x0002)
+#define PA_ENET_TCLK ((ushort)0x0100)
+#define PA_ENET_RCLK ((ushort)0x0200)
+#define PB_ENET_TENA ((uint)0x00001000)
+#define PC_ENET_CLSN ((ushort)0x0010)
+#define PC_ENET_RENA ((ushort)0x0020)
+
+/* Control bits in the SICR to route TCLK (CLK1) and RCLK (CLK2) to
+ * SCC1. Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
+ */
+#define SICR_ENET_MASK ((uint)0x000000ff)
+#define SICR_ENET_CLKRT ((uint)0x0000002c)
+#endif /* CONFIG_SCC1_ENET */
+
+#ifdef CONFIG_SCC2_ENET /* Probably 823/850 variant */
+/* Bits in parallel I/O port registers that have to be set/cleared
+ * to configure the pins for SCC1 use.
+ * TCLK - CLK1, RCLK - CLK2.
+ */
+#define PA_ENET_RXD ((ushort)0x0004)
+#define PA_ENET_TXD ((ushort)0x0008)
+#define PA_ENET_TCLK ((ushort)0x0400)
+#define PA_ENET_RCLK ((ushort)0x0200)
+#define PB_ENET_TENA ((uint)0x00002000)
+#define PC_ENET_CLSN ((ushort)0x0040)
+#define PC_ENET_RENA ((ushort)0x0080)
+
+/* Control bits in the SICR to route TCLK and RCLK to
+ * SCC2. Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
+ */
+#define SICR_ENET_MASK ((uint)0x0000ff00)
+#define SICR_ENET_CLKRT ((uint)0x00002e00)
+#endif /* CONFIG_SCC2_ENET */
+
#endif /* __ASM_FADS_H__ */
#endif /* __KERNEL__ */
^ permalink raw reply
* Re: boot time scheduling hile atomic
From: Takeharu KATO @ 2005-06-14 12:41 UTC (permalink / raw)
To: Rune Torgersen; +Cc: linuxppc-dev list
In-Reply-To: <DCEAAC0833DD314AB0B58112AD99B93B8593BC@ismail.innsys.innovsys.com>
Hi
IMHO, it is more preferable to change kernel thread creation mechanism adapting to
other architecture(in stead of tweaking exception handling) to solve the issue at least.
Of course, cleaning up the exception codes to adapt to ppc64 is also preferable from
code maintenance view.
Anyway, please try to apply the patch as follow:
http://ozlabs.org/ppc32-patches/patch.pl?id=318
Rune Torgersen wrote:
> Any patch forthcomming soon?
>
>
>>-----Original Message-----
>>From: linuxppc-dev-bounces@ozlabs.org
>>[mailto:linuxppc-dev-bounces@ozlabs.org] On Behalf Of
>>Benjamin Herrenschmidt
>>Sent: Wednesday, March 16, 2005 16:29
>>To: Takeharu KATO
>>Cc: linuxppc-dev list
>>Subject: Re: boot time scheduling hile atomic
>>
>>On Wed, 2005-03-16 at 23:07 +0900, Takeharu KATO wrote:
>>
>>>Hi Benjamin:
>>>
>>>I can not figure out why my previous patch is more preferable than
>>>later one.
>>>Could you explain the reason of that please.
>>
>>There may be other kernel bits calling syscall, it sounds saner to
>>always make sure we don't reschedule when in atomic (though
>>it's dubious
>>that it's allowed to do syscalls in atomic regions, let's be safe
>>there).
>>
>>In fact, we are thinking about consolidating the syscall
>>return path and
>>the normal irq return path like we did on ppc64.
>>
>>Ben.
>>
>>
>>_______________________________________________
>>Linuxppc-dev mailing list
>>Linuxppc-dev@ozlabs.org
>>https://ozlabs.org/mailman/listinfo/linuxppc-dev
>>
>>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>
^ permalink raw reply
* Anyone got drivers/mtd/maps/pm828.c?
From: Alex Zeffertt @ 2005-06-14 9:47 UTC (permalink / raw)
To: linuxppc-embedded
Hi there,
I need to get flash partitions working on my PM828 development board.
Has anybody already written a pm828.c? If so I'd appreciate a look at
it.
TIA,
Alex
^ permalink raw reply
* Re: multicast disabled on 8260_io/fcc_enet.c
From: Alex Zeffertt @ 2005-06-14 8:31 UTC (permalink / raw)
To: Samuel Osorio Calvo; +Cc: linuxppc-embedded
In-Reply-To: <s2adccfe.092@scms1.sc.signaal.nl>
On Mon, 13 Jun 2005 18:14:06 +0200
"Samuel Osorio Calvo" <samuel.osorio@nl.thalesgroup.com> wrote:
> Hi all!
>
> I was playing with a mpc8260 board and the latest ELDK version, 3.1.1
> (linux 2.4.25) and face a strange behaviour:
>
> I was trying to make multicast work and everything seemed to be ok
> (/proc/net/igmp, /proc/net/dev_mcast), making a local ping to
> 224.0.0.1 returns localhost as part of the group, etc....BUT it was
> not possible to contact the board to the group it had joined from the
> network. I was digging into the kernel drivers and found a strange
> return statement just in teh start of the funciton set_multicast_list
> (arround line 1471 of the file mentioned in the subject of the mail).
> I moved the return to the end of the function and everything worked
> perfectly.
>
> My question is wether the return statement was moved at the starting
> of the function due to some bug of the set_multicast_list code or it
> was just a typo???
>
According to
http://ozlabs.org/pipermail/linuxppc-embedded/2005-May/018529.html
it would seem that multicast is not correctly implemented and has been
effectively commented out. This also stops promisc mode working. I
have removed the return in my source tree and promisc mode now works
fine. I can't say whether multicast works. Maybe you could just give it
a try and see what happens....
Alex
^ permalink raw reply
* boot kernel problem?
From: leo_guo @ 2005-06-14 8:00 UTC (permalink / raw)
To: linuxppc-embedded, linuxppc-embedded-request; +Cc: wolfgang
SGkgYWxsLA0KDQpGb3IgTVBDODJ4eCwgcnVubmluZyBVLUJPT1QtMS4xLjIg
YW5kIGxpbnV4LTIuNC4yNCwgSSBoYXZlIGEgcXVlc3Rpb246DQoNCkFmdGVy
IHVib290IGRvd25sb2FkIHRoZSBrZXJuZWwgdGhyb3VnaCBuZXQvc2VyaWFs
IG9yIHJlYWQgb3V0IGl0IGZyb20gZmxhc2gsIHRoZW4gaXQgZGVjb21wcmVz
cyB0aGUga2VybmVsIHRvIFNEUkFNLCBmcm9tIHRoZSBiZWdpbiBhZGRyZXNz
IDB4MCwgYW5kIGV4ZWN1dGUgdGhlIGZpcnN0IGluc3RydWN0aW9uLg0KDQpC
dXQgSSBhbSBwdXp6bGUgdGhhdCB0aGUgbGludXgga2VybmVsIGVudHJ5IGFk
ZHJlc3MgaXMgMHhjMDAwMDAwMChrbm93IGZyb20gZmlsZSBTeXN0ZW0ubWFw
KSwgaG93IA0KIGNhbiB0aGUga2VybmVsIGJvb3R1cCBpZiB5b3UgZGVjb21w
cmVzcyB0aGUga2VybmVsIHRvIGFkZHJlc3MgMHgwPyBBbmQgSSBrbm93IHRo
ZSBNTVUgaXMgb2ZmIG5vdy4NCg0KDQpCZXN0IFJlZ2FyZHMhDQoNCiAgIA==
^ permalink raw reply
* [PATCH] -mm: add error checking to mpc85xx rapidio support
From: mporter @ 2005-06-14 0:14 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, linuxppc-embedded
Add more error checking to the MPC85xx RIO support. Clean up some
printks.
Signed-off-by: Matt Porter <mporter@kernel.crashing.org>
diff --git a/arch/ppc/syslib/ppc85xx_rio.c b/arch/ppc/syslib/ppc85xx_rio.c
--- a/arch/ppc/syslib/ppc85xx_rio.c
+++ b/arch/ppc/syslib/ppc85xx_rio.c
@@ -41,6 +41,7 @@
#define RIO_MSG_ISR_DIQI 0x00000001
#define RIO_MSG_DESC_SIZE 32
+#define RIO_MSG_BUFFER_SIZE 4096
#define RIO_MIN_TX_RING_SIZE 2
#define RIO_MAX_TX_RING_SIZE 2048
#define RIO_MIN_RX_RING_SIZE 2
@@ -301,9 +302,9 @@ rio_hw_add_outb_message(struct rio_mport
(struct rio_tx_desc *)msg_tx_ring.virt + msg_tx_ring.tx_slot;
int ret = 0;
- pr_debug(KERN_INFO
- "RIO: rio_hw_add_outb_message(): destid %4.4x mbox %d buffer %8.8x len %8.8x\n",
- rdev->destid, mbox, (int)buffer, len);
+ pr_debug
+ ("RIO: rio_hw_add_outb_message(): destid %4.4x mbox %d buffer %8.8x len %8.8x\n",
+ rdev->destid, mbox, (int)buffer, len);
if ((len < 8) || (len > RIO_MAX_MSG_SIZE)) {
ret = -EINVAL;
@@ -361,13 +362,13 @@ mpc85xx_rio_tx_handler(int irq, void *de
osr = in_be32((void *)&msg_regs->osr);
if (osr & RIO_MSG_OSR_TE) {
- printk(KERN_INFO "RIO: outbound message transmission error\n");
+ pr_info("RIO: outbound message transmission error\n");
out_be32((void *)&msg_regs->osr, RIO_MSG_OSR_TE);
goto out;
}
if (osr & RIO_MSG_OSR_QOI) {
- printk(KERN_INFO "RIO: outbound message queue overflow\n");
+ pr_info("RIO: outbound message queue overflow\n");
out_be32((void *)&msg_regs->osr, RIO_MSG_OSR_QOI);
goto out;
}
@@ -392,12 +393,12 @@ mpc85xx_rio_tx_handler(int irq, void *de
* @entries: Number of entries in the outbound mailbox ring
*
* Initializes buffer ring, request the outbound message interrupt,
- * and enables the outbound message unit. Returns %0 on success or
- * %-EINVAL on failure.
+ * and enables the outbound message unit. Returns %0 on success and
+ * %-EINVAL or %-ENOMEM on failure.
*/
int rio_open_outb_mbox(struct rio_mport *mport, int mbox, int entries)
{
- int i, rc = 0;
+ int i, j, rc = 0;
if ((entries < RIO_MIN_TX_RING_SIZE) ||
(entries > RIO_MAX_TX_RING_SIZE) || (!is_power_of_2(entries))) {
@@ -409,17 +410,33 @@ int rio_open_outb_mbox(struct rio_mport
msg_tx_ring.size = entries;
for (i = 0; i < msg_tx_ring.size; i++) {
- msg_tx_ring.virt_buffer[i] =
- (void *)__get_free_page(GFP_KERNEL);
- msg_tx_ring.phys_buffer[i] =
- (dma_addr_t) __pa(msg_tx_ring.virt_buffer[i]);
+ if (!
+ (msg_tx_ring.virt_buffer[i] =
+ dma_alloc_coherent(NULL, RIO_MSG_BUFFER_SIZE,
+ &msg_tx_ring.phys_buffer[i],
+ GFP_KERNEL))) {
+ rc = -ENOMEM;
+ for (j = 0; j < msg_tx_ring.size; j++)
+ if (msg_tx_ring.virt_buffer[j])
+ dma_free_coherent(NULL,
+ RIO_MSG_BUFFER_SIZE,
+ msg_tx_ring.
+ virt_buffer[j],
+ msg_tx_ring.
+ phys_buffer[j]);
+ goto out;
+ }
}
/* Initialize outbound message descriptor ring */
- msg_tx_ring.virt = dma_alloc_coherent(NULL,
- msg_tx_ring.size *
- RIO_MSG_DESC_SIZE,
- &msg_tx_ring.phys, GFP_KERNEL);
+ if (!(msg_tx_ring.virt = dma_alloc_coherent(NULL,
+ msg_tx_ring.size *
+ RIO_MSG_DESC_SIZE,
+ &msg_tx_ring.phys,
+ GFP_KERNEL))) {
+ rc = -ENOMEM;
+ goto out_dma;
+ }
memset(msg_tx_ring.virt, 0, msg_tx_ring.size * RIO_MSG_DESC_SIZE);
msg_tx_ring.tx_slot = 0;
@@ -434,8 +451,10 @@ int rio_open_outb_mbox(struct rio_mport
out_be32((void *)&msg_regs->osr, 0x000000b3);
/* Hook up outbound message handler */
- request_irq(MPC85xx_IRQ_RIO_TX, mpc85xx_rio_tx_handler, 0, "msg_tx",
- (void *)mport);
+ if ((rc =
+ request_irq(MPC85xx_IRQ_RIO_TX, mpc85xx_rio_tx_handler, 0,
+ "msg_tx", (void *)mport)) < 0)
+ goto out_irq;
/*
* Configure outbound message unit
@@ -456,6 +475,18 @@ int rio_open_outb_mbox(struct rio_mport
out:
return rc;
+
+ out_irq:
+ dma_free_coherent(NULL, msg_tx_ring.size * RIO_MSG_DESC_SIZE,
+ msg_tx_ring.virt, msg_tx_ring.phys);
+
+ out_dma:
+ for (i = 0; i < msg_tx_ring.size; i++)
+ dma_free_coherent(NULL, RIO_MSG_BUFFER_SIZE,
+ msg_tx_ring.virt_buffer[i],
+ msg_tx_ring.phys_buffer[i]);
+
+ return rc;
}
/**
@@ -497,7 +528,7 @@ mpc85xx_rio_rx_handler(int irq, void *de
isr = in_be32((void *)&msg_regs->isr);
if (isr & RIO_MSG_ISR_TE) {
- printk(KERN_INFO "RIO: inbound message reception error\n");
+ pr_info("RIO: inbound message reception error\n");
out_be32((void *)&msg_regs->isr, RIO_MSG_ISR_TE);
goto out;
}
@@ -528,7 +559,7 @@ mpc85xx_rio_rx_handler(int irq, void *de
*
* Initializes buffer ring, request the inbound message interrupt,
* and enables the inbound message unit. Returns %0 on success
- * or %-EINVAL on failure.
+ * and %-EINVAL or %-ENOMEM on failure.
*/
int rio_open_inb_mbox(struct rio_mport *mport, int mbox, int entries)
{
@@ -547,10 +578,14 @@ int rio_open_inb_mbox(struct rio_mport *
msg_rx_ring.virt_buffer[i] = NULL;
/* Initialize inbound message ring */
- msg_rx_ring.virt = dma_alloc_coherent(NULL,
- msg_rx_ring.size *
- RIO_MAX_MSG_SIZE,
- &msg_rx_ring.phys, GFP_KERNEL);
+ if (!(msg_rx_ring.virt = dma_alloc_coherent(NULL,
+ msg_rx_ring.size *
+ RIO_MAX_MSG_SIZE,
+ &msg_rx_ring.phys,
+ GFP_KERNEL))) {
+ rc = -ENOMEM;
+ goto out;
+ }
/* Point dequeue/enqueue pointers at first entry in ring */
out_be32((void *)&msg_regs->ifqdpar, (u32) msg_rx_ring.phys);
@@ -560,8 +595,14 @@ int rio_open_inb_mbox(struct rio_mport *
out_be32((void *)&msg_regs->isr, 0x00000091);
/* Hook up inbound message handler */
- request_irq(MPC85xx_IRQ_RIO_RX, mpc85xx_rio_rx_handler, 0, "msg_rx",
- (void *)mport);
+ if ((rc =
+ request_irq(MPC85xx_IRQ_RIO_RX, mpc85xx_rio_rx_handler, 0,
+ "msg_rx", (void *)mport)) < 0) {
+ dma_free_coherent(NULL, RIO_MSG_BUFFER_SIZE,
+ msg_tx_ring.virt_buffer[i],
+ msg_tx_ring.phys_buffer[i]);
+ goto out;
+ }
/*
* Configure inbound message unit:
@@ -665,8 +706,8 @@ void *rio_hw_get_inb_message(struct rio_
buf = msg_rx_ring.virt_buffer[buf_idx];
if (!buf) {
- pr_debug(KERN_ERR
- "RIO: inbound message copy failed, no buffers\n");
+ printk(KERN_ERR
+ "RIO: inbound message copy failed, no buffers\n");
goto out1;
}
@@ -704,13 +745,13 @@ mpc85xx_rio_dbell_handler(int irq, void
dsr = in_be32((void *)&msg_regs->dsr);
if (dsr & DOORBELL_DSR_TE) {
- printk(KERN_INFO "RIO: doorbell reception error\n");
+ pr_info("RIO: doorbell reception error\n");
out_be32((void *)&msg_regs->dsr, DOORBELL_DSR_TE);
goto out;
}
if (dsr & DOORBELL_DSR_QFI) {
- printk(KERN_INFO "RIO: doorbell queue full\n");
+ pr_info("RIO: doorbell queue full\n");
out_be32((void *)&msg_regs->dsr, DOORBELL_DSR_QFI);
goto out;
}
@@ -724,9 +765,9 @@ mpc85xx_rio_dbell_handler(int irq, void
struct rio_dbell *dbell;
int found = 0;
- pr_debug(KERN_INFO
- "RIO: processing doorbell, sid %2.2x tid %2.2x info %4.4x\n",
- DBELL_SID(dmsg), DBELL_TID(dmsg), DBELL_INF(dmsg));
+ pr_debug
+ ("RIO: processing doorbell, sid %2.2x tid %2.2x info %4.4x\n",
+ DBELL_SID(dmsg), DBELL_TID(dmsg), DBELL_INF(dmsg));
list_for_each_entry(dbell, &port->dbells, node) {
if ((dbell->res->start <= DBELL_INF(dmsg)) &&
@@ -739,10 +780,9 @@ mpc85xx_rio_dbell_handler(int irq, void
dbell->dinb(port, DBELL_SID(dmsg), DBELL_TID(dmsg),
DBELL_INF(dmsg));
} else {
- pr_debug(KERN_INFO
- "RIO: spurious doorbell, sid %2.2x tid %2.2x info %4.4x\n",
- DBELL_SID(dmsg), DBELL_TID(dmsg),
- DBELL_INF(dmsg));
+ pr_debug
+ ("RIO: spurious doorbell, sid %2.2x tid %2.2x info %4.4x\n",
+ DBELL_SID(dmsg), DBELL_TID(dmsg), DBELL_INF(dmsg));
}
dmr = in_be32((void *)&msg_regs->dmr);
out_be32((void *)&msg_regs->dmr, dmr | DOORBELL_DMR_DI);
@@ -758,19 +798,33 @@ mpc85xx_rio_dbell_handler(int irq, void
* @mport: Master port implementing the inbound doorbell unit
*
* Initializes doorbell unit hardware and inbound DMA buffer
- * ring. Called from mpc85xx_rio_setup().
+ * ring. Called from mpc85xx_rio_setup(). Returns %0 on success
+ * or %-ENOMEM on failure.
*/
-static void mpc85xx_rio_doorbell_init(struct rio_mport *mport)
+static int mpc85xx_rio_doorbell_init(struct rio_mport *mport)
{
+ int rc = 0;
+
/* Map outbound doorbell window immediately after maintenance window */
- dbell_win =
- (u32) ioremap(mport->iores.start + RIO_MAINT_WIN_SIZE,
- RIO_DBELL_WIN_SIZE);
+ if (!(dbell_win =
+ (u32) ioremap(mport->iores.start + RIO_MAINT_WIN_SIZE,
+ RIO_DBELL_WIN_SIZE))) {
+ printk(KERN_ERR
+ "RIO: unable to map outbound doorbell window\n");
+ rc = -ENOMEM;
+ goto out;
+ }
/* Initialize inbound doorbells */
- dbell_ring.virt = dma_alloc_coherent(NULL,
- 512 * DOORBELL_MESSAGE_SIZE,
- &dbell_ring.phys, GFP_KERNEL);
+ if (!(dbell_ring.virt = dma_alloc_coherent(NULL,
+ 512 * DOORBELL_MESSAGE_SIZE,
+ &dbell_ring.phys,
+ GFP_KERNEL))) {
+ printk(KERN_ERR "RIO: unable allocate inbound doorbell ring\n");
+ rc = -ENOMEM;
+ iounmap((void *)dbell_win);
+ goto out;
+ }
/* Point dequeue/enqueue pointers at first entry in ring */
out_be32((void *)&msg_regs->dqdpar, (u32) dbell_ring.phys);
@@ -780,11 +834,22 @@ static void mpc85xx_rio_doorbell_init(st
out_be32((void *)&msg_regs->dsr, 0x00000091);
/* Hook up doorbell handler */
- request_irq(MPC85xx_IRQ_RIO_BELL, mpc85xx_rio_dbell_handler, 0,
- "dbell_rx", (void *)mport);
+ if ((rc =
+ request_irq(MPC85xx_IRQ_RIO_BELL, mpc85xx_rio_dbell_handler, 0,
+ "dbell_rx", (void *)mport) < 0)) {
+ iounmap((void *)dbell_win);
+ dma_free_coherent(NULL, 512 * DOORBELL_MESSAGE_SIZE,
+ dbell_ring.virt, dbell_ring.phys);
+ printk(KERN_ERR
+ "MPC85xx RIO: unable to request inbound doorbell irq");
+ goto out;
+ }
/* Configure doorbells for snooping, 512 entries, and enable */
out_be32((void *)&msg_regs->dmr, 0x00108161);
+
+ out:
+ return rc;
}
static char *cmdline = NULL;
^ permalink raw reply
* Re: UART TL 16C550C on custom mpc5200 board
From: Wolfgang Denk @ 2005-06-13 19:42 UTC (permalink / raw)
To: achim.machura; +Cc: Linuxppc-Embedded (E-Mail)
In-Reply-To: <000d01c5701b$d08210e0$34f1ff0a@beint.local>
In message <000d01c5701b$d08210e0$34f1ff0a@beint.local> you wrote:
>
> i'm working on a custom 5200 board with kernel 2.4.25.
> I have to integrate an UART 16C550C in /dev/ttyXX.
> Does everyone knows an existing driver i can modify for use with this chip?
You don't have to modify much; just configure the interrupts, add
definitions of STD_SERIAL_OP for all ports to your board file in
arch/ppc/platforms/, and make sure that there is no conflict in major
numbers between drivers/char/serial.c and any other serial driver in
your system.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
A woman should have compassion.
-- Kirk, "Catspaw", stardate 3018.2
^ permalink raw reply
* Re: MPC52xx: sysfs failure on adding new device driver
From: Grant Likely @ 2005-06-13 19:08 UTC (permalink / raw)
To: Sylvain Munaut; +Cc: linuxppc-embedded
In-Reply-To: <42A99F1C.50104@246tNt.com>
On 6/10/05, Sylvain Munaut <tnt@246tnt.com> wrote:
> Hi Grant
>=20
> > In the mean time, here's another option: Leave
> > arch/ppc/syslib/mpc52xx_devices.c alone, but modify the table in the
> > board setup code to assign specific drivers to the PSC devices before
> > the table is parsed by the platform bus. This has the added advantage
> > of eliminating the need for mpc52xx_match_psc_function() and it's
> > cousins.
>=20
> > + /* Assign driver names to PSC devices */
> > + ppc_sys_platform_devices[MPC52xx_PSC1].name =3D "mpc52xx-psc.uart=
";
> > + ppc_sys_platform_devices[MPC52xx_PSC2].name =3D "mpc52xx-psc.uart=
";
> > + ppc_sys_platform_devices[MPC52xx_PSC3].name =3D "mpc52xx-psc.spi"=
;
>=20
> Yes, I kinda like that. That maybe the cleanest way, just 1 line of code
> per device and when no subfn is assigned, nothing is loaded.
>=20
> I don't really like messing manually with the ppc_sys_platform
> "internals" outside of the ppc_sys code, but maybe creating a call like
>=20
> ppc_sys_assign_subfn(MPC52xx_PSC1,"uart");
I'm continuing to look at this problem and I'm trying to figure out
how pc_sys_assign_subfn() could be implemented. One issue with this
approach is that the function needs to know what the 'base name' of
the device is. With the current ppc_sys_platform_device scheme, there
is only the .name field in the platform_device structure. The first
time ppc_sys_assign_subfn is called on a device it can simply allocate
a new string buffer and concatenate the original value of .name with a
seperator and the function name.
For example (pseudocode):
before: .name =3D "mpc52xx-psc"; func=3D"uart";
newname=3Dkmalloc(strlen(.name) + 1 + strlen(func), GFP_KERNEL)
strcpy(newname, .name);
newname[strlen(.name)] =3D ':';
strcpy(newname+strlen(.name)+1, func);
.name =3D buff; /* Note original value of .name is not freed; it was
statically allocated */
after: .name =3D "mpc52xx-psc:uart"
If ppc_sys_platform_device is called a second time on the same device,
it needs to free the new buffer, otherwise we have a small memory
leak. However, the function has no easy way to determine if it is
being called a second time.
I see a few of solutions here:
1. Wrap the 'platform_device' structure with a new structure that
includes a .basename field. Default declarations of devices should
set .name to NULL and ppc_sys_assign_subfn() will always use .basename
as a prefix. Any buffer pointed to by .name will always be freed
before assigning new value.
2. Make ppc_sys_assign_subfn() look for the seperator special
character (':' in example). If the special character is there, make
the assumption that a subfn has already been assigned and the old
value should be freed. However, this causes problems if the default
device tree wants to specify a default subfunction.
3. Never free the value of .name. This assumes that once the subfn is
set it will never be changed during runtime and so the function will
only ever replace the original (statically allocated) value of .name.=20
I think this option should be avoided; I don't think that the
assumption is appropriate. There may very well be boards that need to
change the function of a PSC without rebooting.
At the moment, I think option #1 is the cleanest, but it is a little invasi=
ve.
Thoughts?
g.
^ permalink raw reply
* multicast disabled on 8260_io/fcc_enet.c
From: Samuel Osorio Calvo @ 2005-06-13 16:14 UTC (permalink / raw)
To: linuxppc-embedded
Hi all!
I was playing with a mpc8260 board and the latest ELDK version, 3.1.1 =
(linux 2.4.25) and face a strange behaviour:
I was trying to make multicast work and everything seemed to be ok =
(/proc/net/igmp, /proc/net/dev_mcast), making a local ping to 224.0.0.1 =
returns localhost as part of the group, etc....BUT it was not possible to =
contact the board to the group it had joined from the network.
I was digging into the kernel drivers and found a strange return statement =
just in teh start of the funciton set_multicast_list (arround line 1471 of =
the file mentioned in the subject of the mail). I moved the return to the =
end of the function and everything worked perfectly.
My question is wether the return statement was moved at the starting of =
the function due to some bug of the set_multicast_list code or it was just =
a typo???
Thanks to all,
Samuel.
Unclassified.
^ permalink raw reply
* Re: 8xx fixes GIT tree
From: Marcelo Tosatti @ 2005-06-13 11:50 UTC (permalink / raw)
To: linux-ppc-embedded; +Cc: Aristeu Sergio Rozanski Filho
In-Reply-To: <20050609182452.GC8125@logos.cnet>
Hi,
On Thu, Jun 09, 2005 at 03:24:52PM -0300, Marcelo Tosatti wrote:
> On Thu, Jun 09, 2005 at 01:26:50PM -0300, Marcelo Tosatti wrote:
> > Hi,
> >
> > I've put up a GIT tree with some 8xx fixes.
> >
> > I plan to continue collecting fixes there - I encourage other folks
> > working with v2.6 on 8xx to join in and contribute.
> >
> > Its about time to setup a "TODO" list for v2.6 8xx, a few which I
> > remember from the top of my head:
> >
> > - merge CPU15 workaround
> > - merge PCMCIA driver
> > - merge arch/ppc/8xx_io/fec.c v2.6 update
> > - Remove misc-embedded.c
> >
> > It should live somewhere in the web (wiki would be ideal).
> >
> > It contains the following changes at the moment:
>
> Oh, I forgot to mention the URL - its at:
>
> http://www.kernel.org/pub/scm/linux/kernel/git/marcelo/8xx-fixes/
>
> Web interface at:
>
> http://www.kernel.org/git/?p=linux/kernel/git/marcelo/8xx-fixes;a=summary
Wolfgang setup a "TODO list" at
http://www.denx.de/twiki/bin/view/Todo8xx/WebHome
It currently contains:
- merge CPU15 workaround
- merge PCMCIA driver
- merge arch/ppc/8xx_io/fec.c v2.6 update
- Remove misc-embedded.c
- Fix BDI2000 support
^ permalink raw reply
* Re: KGDB on BookE
From: Geoff Levand @ 2005-06-13 16:40 UTC (permalink / raw)
To: Prosun Niyogi; +Cc: linuxppc-embedded
In-Reply-To: <OF6BE916AF.4D6A65C4-ON8625701F.004ACEBA-8625701F.004B9D77@us.ibm.com>
Prosun Niyogi wrote:
>
> I've grabbed latest kernel.org kernel (2.6.11.11) to attempt to get a
> working kgdb on my ebony setup. Checking the mailing list archives, it
> seems as if all the 4xx specific kgdb patches have been merged with
> kernel.org. Is this the case? If so, I have a problem single stepping
> using kgdb. The debugger_sstep(regs) function is never called from
> traps.c. So, as of right now.. I can only set/hit an arbitrary
> breakpoint (for my testing, I've been setting a breakpoint at sys_sync).
> After setting the breakpoint and continuing from the initial kgdb entry
> point, gdb successfully catches the breakpoint at sys_sync, but when I
> attempt to step, the kernel continues normal operation, and subsequent
> attempts at breaking into gdb control by issuing a "sync" command on the
> ebony terminal in minicom do not hit the breakpoint. Any
> pointers/suggestions as to where I can obtain a working kgdb-enabled
> kernel for the ebony board? Any assistance would be helpful.
>
Apply the patches in CVS from http://sourceforge.net/projects/kgdb
This works with 2.6.11.11 and Ebony with both serial and Ether connections,
but I found the kernel hangs with CONFIG_PREEMPT=y.
-Geoff
^ permalink raw reply
* KGDB on BookE
From: Prosun Niyogi @ 2005-06-13 13:45 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 1107 bytes --]
I've grabbed latest kernel.org kernel (2.6.11.11) to attempt to get a
working kgdb on my ebony setup. Checking the mailing list archives, it
seems as if all the 4xx specific kgdb patches have been merged with
kernel.org. Is this the case? If so, I have a problem single stepping
using kgdb. The debugger_sstep(regs) function is never called from
traps.c. So, as of right now.. I can only set/hit an arbitrary breakpoint
(for my testing, I've been setting a breakpoint at sys_sync). After
setting the breakpoint and continuing from the initial kgdb entry point,
gdb successfully catches the breakpoint at sys_sync, but when I attempt to
step, the kernel continues normal operation, and subsequent attempts at
breaking into gdb control by issuing a "sync" command on the ebony
terminal in minicom do not hit the breakpoint. Any pointers/suggestions as
to where I can obtain a working kgdb-enabled kernel for the ebony board?
Any assistance would be helpful.
Thanks.
Prosun Niyogi
Software Engineer
Linux Technology Center
Phone:(512)838-8364 (TL 678-8364)
Fax:(512)838-4663
pniyogi@us.ibm.com
[-- Attachment #2: Type: text/html, Size: 1259 bytes --]
^ permalink raw reply
* UART TL 16C550C on custom mpc5200 board
From: Achim Machura @ 2005-06-13 13:28 UTC (permalink / raw)
To: Linuxppc-Embedded (E-Mail)
Hello,
i'm working on a custom 5200 board with kernel 2.4.25.
I have to integrate an UART 16C550C in /dev/ttyXX.
Does everyone knows an existing driver i can modify for use with this chip?
thanks
Achim
____________________________________________
Achim Machura Softwareentwicklung
Berghof Automationstechnik GmbH
Harretstrasse 1, D-72800 Eningen u.A.
Tel: +49-7121-894-131, Fax: +49-7121-894-100
email: machura@berghof.com
Internet: http://www.berghof.com
^ permalink raw reply
* Re: JVM for PPC405
From: David Ho @ 2005-06-13 13:31 UTC (permalink / raw)
To: colui77@virgilio.it; +Cc: linuxppc-embedded
In-Reply-To: <4293EE1500034F4D@ims2a.cp.tin.it>
At nanometrics, we have tried numerous different JVMs but we ended up
using GCJ instead, it gives us the speed to run applications on a tiny
66MHz MPC8xx so if you are evaluating JVM options, I suggest you try
GCJ included in GCC 4.0.
David
On 6/13/05, colui77@virgilio.it <colui77@virgilio.it> wrote:
> Hi all,
> I need to installa a JVM on montavista linux for ML300 (PPC405).
> I tried the Blackdown 1.3.1 for PPC but it doesn't seems to work
> (at the command
> $ java
> I received
> illegal istruction)
> Any suggestion? Please I need help...
> Luigi
>=20
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
^ permalink raw reply
* JVM for PPC405
From: colui77 @ 2005-06-13 11:50 UTC (permalink / raw)
To: linuxppc-embedded
Hi all,
I need to installa a JVM on montavista linux for ML300 (PPC405).
I tried the Blackdown 1.3.1 for PPC but it doesn't seems to work
(at the command
$ java
I received
illegal istruction)
Any suggestion? Please I need help...
Luigi
^ permalink raw reply
* (no subject)
From: colui77 @ 2005-06-13 11:38 UTC (permalink / raw)
To: linuxppc-embedded
Hi guys,
any of you knows a version of JVM running on Montavista linux for ML300
(PPC405)
I tried the Blackdown 1.3.1 for PPC but it doesn't seem to work...
Any suggestion?
Thanks,
Luigi
^ permalink raw reply
* Re: mpc82xx FCC patches
From: Vitaly Bordug @ 2005-06-13 7:23 UTC (permalink / raw)
To: Allen Curtis; +Cc: Ppc Embedded
In-Reply-To: <cd9d527ad15c64842229a54e1ed3d6b0@onz.com>
Allen Curtis wrote:
> Can someone tell me if this is the latest FCC patch?
> http://ozlabs.org/pipermail/linuxppc-embedded/2005-May/018124.html
>
> It appears from the comments that there are a few RFCs outstanding.
You understand things right, but this work is not finished yet, so the
"final" patch does not exist. The next version of RFC will be provided,
but it also could not be in final state. Of course you can use the
current stuff if you wish...
--
Sincerely,
Vitaly
^ permalink raw reply
* Re: mpc82xx FCC patches
From: Allen Curtis @ 2005-06-13 0:49 UTC (permalink / raw)
To: Allen Curtis; +Cc: Ppc Embedded
In-Reply-To: <cd9d527ad15c64842229a54e1ed3d6b0@onz.com>
> Can someone tell me if this is the latest FCC patch?
> http://ozlabs.org/pipermail/linuxppc-embedded/2005-May/018124.html
>
Ok, it isn't but does someone have a single patch?
^ permalink raw reply
* mpc82xx FCC patches
From: Allen Curtis @ 2005-06-13 0:29 UTC (permalink / raw)
To: Ppc Embedded
Can someone tell me if this is the latest FCC patch?
http://ozlabs.org/pipermail/linuxppc-embedded/2005-May/018124.html
It appears from the comments that there are a few RFCs outstanding.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox