Hi Imre, On 23.09.2014 11:54, Claudio Thomas wrote: > On 23.09.2014 11:41, Imre Kaloz wrote: >> On Tue, 23 Sep 2014 11:10:17 +0200, Claudio Thomas >> <c...@xmodus-systems.de> wrote: >> >> <snip> >> Well, RB333 is MPC8321, RB600 is MPC8323 and we support the >> MPC8377EWLAN board, which is MPC8377E :) >> >> <snip> >> MPC8306 should be the same "PowerQUICC II Pro" family and seems pretty >> similar to MPC8308. Do you have a patch for the board to check? >> >> >> Imre > I've annexed the actual state of my two patch files and my actual config > (which is currently very different due to the use of menuconfig and some > experimental changes) I'm sorry, I've given you a patch file that conflicts with the existing once, because I was testing without using them to minimise interference. I've fixed the file to be patched after 200-powerpc-add-rbppc-support.patch and 201-powerpc-add-rb_iomap.patch. The 501.. should be ok.
Comparing the configs I've noticed... * that RB600/RB300 use a NAND flash but XM1700 uses an error-free 64MB NOR flash ( S29GL512S10TFI020 - http://www.digikey.com/product-detail/en/S29GL512S10TFI020/1274-1036-ND/3761529 ), this may also could be a problem. * Also there is no VIA-Chip, so CONFIG_VIA_VELOCITY=y could maybe be changed to CONFIG_VIA_VELOCITY=m. The Package kmod-via-velocity could be handled by different profiles, so this should not be a Problem. * RB600/RB300 uses CONFIG_BLK_DEV_SD=y, but XM1700 has no SD card, but it needs a CONFIG_BLK_DEV_RAM and uses CONFIG_MMC. * XM1700 does not need CONFIG_MTD_NAND=y, because it has a NOR flash. * RB600/RB300 has a SCSI port? (CONFIG_SCSI) * XM1700 has CONFIG_SERIAL_8250_NR_UARTS=4, no definition found for RB600/RB300 * CONFIG_VITESSE_PHY? * XM1700 needs CONFIG_USB=y to comunicate to the GSM-chip * RB600/RB300 uses CONFIG_YAFFS_FS as filesystem? As more as I compare both configs then harder it seems to me to get both to get together. Claudio
diff -rupN a/arch/powerpc/configs/mpc83xx_defconfig b/arch/powerpc/configs/mpc83xx_defconfig --- a/arch/powerpc/configs/mpc83xx_defconfig 2013-05-11 22:57:46.000000000 +0200 +++ b/arch/powerpc/configs/mpc83xx_defconfig 2013-07-22 14:05:36.299620445 +0200 @@ -11,6 +11,7 @@ CONFIG_PARTITION_ADVANCED=y # CONFIG_PPC_CHRP is not set # CONFIG_PPC_PMAC is not set CONFIG_PPC_83xx=y +CONFIG_XM1700E=y CONFIG_MPC831x_RDB=y CONFIG_MPC832x_MDS=y CONFIG_MPC832x_RDB=y diff -rupN a/arch/powerpc/platforms/83xx/Kconfig b/arch/powerpc/platforms/83xx/Kconfig --- a/arch/powerpc/platforms/83xx/Kconfig 2014-09-23 14:45:19.963328793 +0200 +++ b/arch/powerpc/platforms/83xx/Kconfig 2014-09-23 15:46:31.466386679 +0200 @@ -9,6 +9,15 @@ menuconfig PPC_83xx if PPC_83xx +config XM1700E + bool "SEAL/Xmodus XM1700E" + select DEFAULT_UIMAGE + select PPC_MPC830x + select PPC_MPC8306 + select QUICC_ENGINE + help + This option enables support for the XM1700E board. + config MPC830x_RDB bool "Freescale MPC830x RDB and derivatives" select DEFAULT_UIMAGE @@ -124,6 +133,13 @@ config KMETER1 endif +config PPC_MPC830x + bool + select ARCH_WANT_OPTIONAL_GPIOLIB + +config PPC_MPC8306 + bool + # used for usb & gpio config PPC_MPC831x bool diff -rupN a/arch/powerpc/platforms/83xx/Makefile b/arch/powerpc/platforms/83xx/Makefile --- a/arch/powerpc/platforms/83xx/Makefile 2013-05-11 22:57:46.000000000 +0200 +++ b/arch/powerpc/platforms/83xx/Makefile 2013-07-22 14:04:25.595618764 +0200 @@ -4,6 +4,7 @@ obj-y := misc.o usb.o obj-$(CONFIG_SUSPEND) += suspend.o suspend-asm.o obj-$(CONFIG_MCU_MPC8349EMITX) += mcu_mpc8349emitx.o +obj-$(CONFIG_XM1700E) += xm1700e.o obj-$(CONFIG_MPC830x_RDB) += mpc830x_rdb.o obj-$(CONFIG_MPC831x_RDB) += mpc831x_rdb.o obj-$(CONFIG_MPC832x_RDB) += mpc832x_rdb.o diff -rupN a/arch/powerpc/platforms/83xx/mpc83xx.h b/arch/powerpc/platforms/83xx/mpc83xx.h --- a/arch/powerpc/platforms/83xx/mpc83xx.h 2013-05-11 22:57:46.000000000 +0200 +++ b/arch/powerpc/platforms/83xx/mpc83xx.h 2013-07-22 14:04:25.595618764 +0200 @@ -32,6 +32,8 @@ #define MPC837X_SICRL_USB_ULPI 0x50000000 #define MPC837X_SICRL_USBB_MASK 0x30000000 #define MPC837X_SICRL_SD 0x20000000 +#define MPC8306_SICRL_USB_MASK 0x003C0000 +#define MPC8306_SICRL_USB_ULPI 0x00000000 /* system i/o configuration register high */ #define MPC83XX_SICRH_OFFS 0x118 @@ -44,6 +46,8 @@ #define MPC8315_SICRH_USB_ULPI 0x00000000 #define MPC837X_SICRH_SPI_MASK 0x00000003 #define MPC837X_SICRH_SD 0x00000001 +#define MPC8306_SICRH_USB_MASK 0x0F00F300 +#define MPC8306_SICRH_USB_ULPI 0x00000000 /* USB Control Register */ #define FSL_USB2_CONTROL_OFFS 0x500 diff -rupN a/arch/powerpc/platforms/83xx/usb.c b/arch/powerpc/platforms/83xx/usb.c --- a/arch/powerpc/platforms/83xx/usb.c 2013-05-11 22:57:46.000000000 +0200 +++ b/arch/powerpc/platforms/83xx/usb.c 2013-07-22 14:04:25.595618764 +0200 @@ -99,7 +99,7 @@ int mpc834x_usb_cfg(void) } #endif /* CONFIG_PPC_MPC834x */ -#ifdef CONFIG_PPC_MPC831x +#if defined(CONFIG_PPC_MPC831x) || defined(CONFIG_PPC_MPC8306) int mpc831x_usb_cfg(void) { u32 temp; @@ -128,7 +128,8 @@ int mpc831x_usb_cfg(void) /* Configure clock */ immr_node = of_get_parent(np); if (immr_node && (of_device_is_compatible(immr_node, "fsl,mpc8315-immr") || - of_device_is_compatible(immr_node, "fsl,mpc8308-immr"))) + of_device_is_compatible(immr_node, "fsl,mpc8308-immr") || + of_device_is_compatible(immr_node, "fsl,mpc8306-immr"))) clrsetbits_be32(immap + MPC83XX_SCCR_OFFS, MPC8315_SCCR_USB_MASK, MPC8315_SCCR_USB_DRCM_01); @@ -150,6 +151,13 @@ int mpc831x_usb_cfg(void) clrsetbits_be32(immap + MPC83XX_SICRH_OFFS, MPC8315_SICRH_USB_MASK, MPC8315_SICRH_USB_ULPI); + } else if (of_device_is_compatible(immr_node, "fsl,mpc8306-immr")) { + clrsetbits_be32(immap + MPC83XX_SICRL_OFFS, + MPC8306_SICRL_USB_MASK, + MPC8306_SICRL_USB_ULPI); + clrsetbits_be32(immap + MPC83XX_SICRH_OFFS, + MPC8306_SICRH_USB_MASK, + MPC8306_SICRH_USB_ULPI); } else { clrsetbits_be32(immap + MPC83XX_SICRL_OFFS, MPC831X_SICRL_USB_MASK, diff -rupN a/arch/powerpc/platforms/83xx/xm1700e.c b/arch/powerpc/platforms/83xx/xm1700e.c --- a/arch/powerpc/platforms/83xx/xm1700e.c 1970-01-01 01:00:00.000000000 +0100 +++ b/arch/powerpc/platforms/83xx/xm1700e.c 2013-07-22 14:04:25.595618764 +0200 @@ -0,0 +1,123 @@ +/* + * arch/powerpc/platforms/83xx/xm1700e.c + * + * Description: XM1700E board specific routines. + * + * Copyright (C) 2011 Freescale Semiconductor, Inc. All rights reserved. + * Copyright (C) 2013 SEAL AG. All rights reserved. + * + * 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/pci.h> +#include <linux/of_platform.h> +#include <linux/of_device.h> +#include <linux/fsl_devices.h> +#include <linux/leds.h> +#include <asm/io.h> +#include <asm/time.h> +#include <asm/ipic.h> +#include <asm/udbg.h> +#include <asm/qe.h> +#include <asm/qe_ic.h> +#include <sysdev/fsl_pci.h> +#include <sysdev/fsl_soc.h> +#include <linux/platform_device.h> +#include <sysdev/simple_gpio.h> +#include "mpc83xx.h" + +/* + * Setup the architecture + */ +static void __init xm1700e_setup_arch(void) +{ + if (ppc_md.progress) + ppc_md.progress("xm1700e_setup_arch()", 0); + + mpc831x_usb_cfg(); + +#ifdef CONFIG_QUICC_ENGINE + qe_reset(); +#endif /* CONFIG_QUICC_ENGINE */ + +} + +static void __init xm1700e_init_IRQ(void) +{ + struct device_node *np; + + np = of_find_node_by_type(NULL, "ipic"); + if (!np) + return; + + ipic_init(np, 0); + + /* Initialize the default interrupt mapping priorities, + * in case the boot rom changed something on us. + */ + ipic_set_default_priority(); + +#ifdef CONFIG_QUICC_ENGINE + np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic"); + if (!np) { + np = of_find_node_by_type(NULL, "qeic"); + if (!np) + return; + } + qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic); + of_node_put(np); +#endif /* CONFIG_QUICC_ENGINE */ +} + +/* + * Called very early, MMU is off, device-tree isn't unflattened + */ +static int __init xm1700e_probe(void) +{ + unsigned long root = of_get_flat_dt_root(); + + return of_flat_dt_is_compatible(root, "seal,xm1700e"); +} + +static struct of_device_id __initdata of_bus_ids[] = { + { .compatible = "simple-bus" }, + { .compatible = "fsl,qe" }, + {}, +}; + +static int __init declare_of_platform_devices(void) +{ + u8 __iomem *latch; + struct device_node *np; + + of_platform_bus_probe(NULL, of_bus_ids, NULL); + + np = of_find_compatible_node(NULL, NULL, "seal,xm1700-bcsr"); + if (np) + { + latch = of_iomap(np, 0); + of_node_put(np); + if (latch) + { + simple_gpiochip_init("seal,xm1700-bcsr-gpio"); + setbits8(&latch[13], 0x07); // Turn on USB, LEDs off + } + } + return 0; +} +machine_device_initcall(xm1700e, declare_of_platform_devices); + +define_machine(xm1700e) { + .name = "XM1700E", + .probe = xm1700e_probe, + .setup_arch = xm1700e_setup_arch, + .init_IRQ = xm1700e_init_IRQ, + .get_irq = ipic_get_irq, + .restart = mpc83xx_restart, + .time_init = mpc83xx_time_init, + .calibrate_decr = generic_calibrate_decr, + .progress = udbg_progress, +}; diff -rupN a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig --- a/arch/powerpc/platforms/Kconfig 2013-05-11 22:57:46.000000000 +0200 +++ b/arch/powerpc/platforms/Kconfig 2013-07-22 14:04:25.595618764 +0200 @@ -300,6 +300,13 @@ config QUICC_ENGINE Selecting this option means that you wish to build a kernel for a machine with a QE coprocessor. +config QE_830x + bool "QE 830x support" + depends on QUICC_ENGINE + default y if PPC_MPC830x + help + The QUICC Engine (QE) in 8306 does not support certain range of snum thread. + config QE_GPIO bool "QE GPIO support" depends on QUICC_ENGINE diff -rupN a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c --- a/arch/powerpc/sysdev/qe_lib/qe.c 2013-05-11 22:57:46.000000000 +0200 +++ b/arch/powerpc/sysdev/qe_lib/qe.c 2013-07-22 14:04:25.595618764 +0200 @@ -279,12 +279,15 @@ static void qe_snums_init(void) 0xF4, 0xF5, 0xFC, 0xFD, }; static const u8 snum_init_46[] = { +#if !defined(CONFIG_QE_830x) 0x04, 0x05, 0x0C, 0x0D, 0x14, 0x15, 0x1C, 0x1D, - 0x24, 0x25, 0x2C, 0x2D, 0x34, 0x35, 0x88, 0x89, - 0x98, 0x99, 0xA8, 0xA9, 0xB8, 0xB9, 0xC8, 0xC9, - 0xD8, 0xD9, 0xE8, 0xE9, 0x08, 0x09, 0x18, 0x19, - 0x28, 0x29, 0x38, 0x39, 0x48, 0x49, 0x58, 0x59, - 0x68, 0x69, 0x78, 0x79, 0x80, 0x81, + 0x24, 0x25, 0x2C, 0x2D, 0x34, 0x35, +#endif + 0x88, 0x89, 0x98, 0x99, 0xA8, 0xA9, 0xB8, 0xB9, + 0xC8, 0xC9, 0xD8, 0xD9, 0xE8, 0xE9, 0x08, 0x09, + 0x18, 0x19, 0x28, 0x29, 0x38, 0x39, 0x48, 0x49, + 0x58, 0x59, 0x68, 0x69, 0x78, 0x79, 0x80, 0x81, + }; static const u8 *snum_init;
_______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel