Hi,

some small nit-picks

On 30 May 2012 10:08, Daniel Golle <[email protected]> wrote:
> This adds support for the Allnet ALL6000 board to the Kernel.
> See
> http://www.allnet.de/entwicklungsplatformen.html?&L=0
>
> Signed-off-by: Daniel Golle <[email protected]>
>
> diff --git a/target/linux/kirkwood/patches-3.3/300-all6000.patch 
> b/target/linux/kirkwood/patches-3.3/300-all6000.patch
> new file mode 100644
> index 0000000..571e301
> --- /dev/null
> +++ b/target/linux/kirkwood/patches-3.3/300-all6000.patch
> @@ -0,0 +1,201 @@
> +--- a/arch/arm/mach-kirkwood/Kconfig
> ++++ b/arch/arm/mach-kirkwood/Kconfig
> +@@ -148,6 +148,11 @@ config MACH_NSA310
> +         Say 'Y' here if you want your kernel to support the
> +         ZyXEL NSA-310 board.
> +
> ++config MACH_ALL6000
> ++      bool "Allnet ALL6000"
> ++      help
> ++        Say 'Y' here if you want your kernel to support the
> ++        Allnet ALL6000 board.
> + endmenu
> +
> + endif
> +--- a/arch/arm/mach-kirkwood/Makefile
> ++++ b/arch/arm/mach-kirkwood/Makefile
> +@@ -21,5 +21,6 @@ obj-$(CONFIG_MACH_NET5BIG_V2)                += netxbi
> + obj-$(CONFIG_MACH_T5325)              += t5325-setup.o
> + obj-$(CONFIG_MACH_NAS6210)            += nas6210-setup.o
> + obj-$(CONFIG_MACH_NSA310)             += nsa-310-setup.o
> ++obj-$(CONFIG_MACH_ALL6000)            += all6000-setup.o
> +
> + obj-$(CONFIG_CPU_IDLE)                        += cpuidle.o
> +--- /dev/null
> ++++ b/arch/arm/mach-kirkwood/all6000-setup.c
> +@@ -0,0 +1,175 @@
> ++/*
> ++ * arch/arm/mach-kirkwood/all6000-setup.c
> ++ *
> ++ * ALL6000 Board Setup
> ++ *
> ++ * Copyright (C) 2012 Daniel Golle <[email protected]>
> ++ *
> ++ * This file is licensed under the terms of the GNU General Public
> ++ * License version 2.  This program is licensed "as is" without any
> ++ * warranty of any kind, whether express or implied.
> ++ */
> ++
> ++#include <linux/kernel.h>
> ++#include <linux/init.h>
> ++#include <linux/version.h>
> ++#include <linux/platform_device.h>
> ++#include <linux/mtd/nand.h>
> ++#include <linux/mtd/partitions.h>
> ++#include <linux/ata_platform.h>
> ++#include <linux/mv643xx_eth.h>
> ++#include <linux/i2c.h>
> ++#include <linux/gpio.h>
> ++#include <asm/mach-types.h>
> ++#include <asm/mach/arch.h>
> ++#include <mach/kirkwood.h>
> ++#include <plat/mvsdio.h>
> ++#include "common.h"
> ++#include "mpp.h"
> ++
> ++/* for the PCIe reset workaround */
> ++#include <plat/pcie.h>
> ++
> ++static struct mtd_partition all6000_nand_parts[] = {
> ++      {
> ++              .name           = "uboot",
> ++              .offset         = 0,
> ++              .size           = 0x80000,
> ++              .mask_flags     = MTD_WRITEABLE
> ++      }, {
> ++              .name           = "uboot-env",
> ++              .offset         = 0x80000,
> ++              .size           = 0x20000,
> ++      }, {
> ++              .name           = "ubi0",
> ++              .offset         = 0x100000,
> ++              .size           = MTDPART_SIZ_FULL
> ++      },
> ++};
> ++
> ++/* PHY addresses from u-boot mii info */
> ++static struct mv643xx_eth_platform_data all6000_ge00_data = {
> ++      .phy_addr       = MV643XX_ETH_PHY_ADDR(11),
> ++};
> ++
> ++static struct mv643xx_eth_platform_data all6000_ge01_data = {
> ++      .phy_addr       = MV643XX_ETH_PHY_ADDR(8),
> ++};
> ++
> ++static struct mv_sata_platform_data all6000_sata_data = {
> ++      .n_ports        = 2,
> ++};
> ++
> ++static struct mvsdio_platform_data all6000_mvsdio_data = {
> ++      .gpio_card_detect = 28,
> ++      .gpio_write_protect = 38, /* microSD => n.c.? */
> ++};
> ++
> ++static unsigned int all6000_mpp_config[] __initdata = {
> ++      MPP0_NF_IO2,
> ++      MPP1_NF_IO3,
> ++      MPP2_NF_IO4,
> ++      MPP3_NF_IO5,
> ++      MPP4_NF_IO6,
> ++      MPP5_NF_IO7,
> ++      MPP6_SYSRST_OUTn,
> ++      MPP8_TW0_SDA,
> ++      MPP9_TW0_SCK,
> ++      MPP10_UART0_TXD,
> ++      MPP11_UART0_RXD,
> ++      MPP12_SD_CLK,
> ++      MPP13_SD_CMD,
> ++      MPP14_SD_D0,
> ++      MPP15_SD_D1,
> ++      MPP16_SD_D2,
> ++      MPP17_SD_D3,
> ++      MPP18_NF_IO0,
> ++      MPP19_NF_IO1,
> ++      MPP20_GE1_TXD0,
> ++      MPP21_GE1_TXD1,
> ++      MPP22_GE1_TXD2,
> ++      MPP23_GE1_TXD3,
> ++      MPP24_GE1_RXD0,
> ++      MPP25_GE1_RXD1,
> ++      MPP26_GE1_RXD2,
> ++      MPP27_GE1_RXD3,
> ++      MPP28_GPIO,     /* SD Status */
> ++      MPP29_GPIO,     /* USB Power Enable */
> ++      MPP30_GE1_RXCTL,
> ++      MPP31_GE1_RXCLK,
> ++      MPP32_GE1_TCLKOUT,
> ++      MPP33_GE1_TXCTL,
> ++      MPP34_SATA1_ACTn,
> ++      MPP35_SATA0_ACTn,
> ++      MPP36_AU_SPDIFI,
> ++      MPP37_AU_SPDIFO,
> ++      MPP38_GPIO,     /* SD Sw Wp */
> ++      MPP39_TDM_SPI_CS0,
> ++      MPP40_TDM_SPI_SCK,
> ++      MPP41_TDM_SPI_MISO,
> ++      MPP42_TDM_SPI_MOSI,
> ++      MPP43_TDM_CODEC_INTn,
> ++      MPP44_TDM_CODEC_RSTn,
> ++      MPP45_TDM_PCLK,
> ++//    MPP46_TDM_FS
> ++      MPP46_GPIO,     /* HDD PWR CTRL */
> ++//    MPP47_TDM_DRX
> ++      MPP47_GPIO,     /* FAN PWR CTRL */
> ++      MPP48_TDM_DTX,
> ++      MPP49_GPIO,     /* USB FLAGA */
> ++      0
> ++};
> ++
> ++
> ++static struct i2c_board_info __initdata all6000_i2c_info[] = {
> ++      {
> ++              I2C_BOARD_INFO("ALL6000", 0x0e),
> ++      },
> ++};
> ++
> ++static int __init all6000_pci_init(void)
> ++{
> ++      orion_pcie_reset((void __iomem *)PCIE_VIRT_BASE);
> ++      kirkwood_pcie_init(KW_PCIE0);
> ++      return 0;
> ++};
> ++subsys_initcall(all6000_pci_init);
> ++
> ++static void __init all6000_init(void)
> ++{
> ++      kirkwood_init();
> ++      kirkwood_mpp_conf(all6000_mpp_config);
> ++
> ++      kirkwood_uart0_init();
> ++      kirkwood_nand_init(ARRAY_AND_SIZE(all6000_nand_parts), 25);
> ++      kirkwood_sdio_init(&all6000_mvsdio_data);
> ++
> ++      if (gpio_request(29, "USB Power Enable") != 0 ||
> ++          gpio_direction_output(29, 1) != 0)

you can drop the != 0 checks.

> ++              printk(KERN_ERR "can't set up GPIO 29 (USB Power Enable)\n");

maybe pr_err()?
> ++
> ++      kirkwood_ehci_init();
> ++      kirkwood_ge00_init(&all6000_ge00_data);
> ++      kirkwood_ge01_init(&all6000_ge01_data);
> ++
> ++      kirkwood_sata_init(&all6000_sata_data);
> ++
> ++      i2c_register_board_info(0, all6000_i2c_info,
> ++              ARRAY_SIZE(all6000_i2c_info));
> ++
> ++      kirkwood_i2c_init();
> ++
> ++}
> ++
> ++MACHINE_START(NAXY1200, "Allnet ALL6000")
> ++      /* Maintainer: Daniel Golle <[email protected]> */
> ++      .atag_offset    = 0x100,
> ++      .init_machine   = all6000_init,
> ++      .map_io         = kirkwood_map_io,
> ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)
> ++      .init_early     = kirkwood_init_early,
> ++#endif

>= 2.6.39 is always true.

> ++      .init_irq       = kirkwood_init_irq,
> ++      .timer          = &kirkwood_timer,
> ++       .restart        = kirkwood_restart,
> ++MACHINE_END


Jonas
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to