Adds the at91 Propox (http://www.propox.com) MMnet1000 series support. Tested 
on MMnet1002 board version with Samsung NAND flash.

Signed-off-by: Przemyslaw Rudy <[email protected]>


---

Index: target/linux/at91/MMnet1000/config-default
===================================================================
--- target/linux/at91/MMnet1000/config-default  (revision 0)
+++ target/linux/at91/MMnet1000/config-default  (revision 0)
@@ -0,0 +1,83 @@
+CONFIG_EXPERIMENTAL=y
+CONFIG_SYSVIPC=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_SLAB=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_ARCH_AT91=y
+CONFIG_ARCH_AT91SAM9260=y
+CONFIG_MACH_MMNET1000=y
+CONFIG_AT91_PROGRAMMABLE_CLOCKS=y
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE=""
+CONFIG_FPE_NWFPE=y
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_BOOTP=y
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_ATMEL_SSC=y
+CONFIG_SCSI=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_SCSI_MULTI_LUN=y
+CONFIG_NETDEVICES=y
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+CONFIG_MACB=y
+CONFIG_SERIAL_ATMEL=y
+CONFIG_SERIAL_ATMEL_CONSOLE=y
+CONFIG_I2C=m
+CONFIG_I2C_AT91=m
+CONFIG_I2C_CHARDEV=m
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+CONFIG_AT91SAM9X_WATCHDOG=y
+CONFIG_USB=y
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_MON=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_STORAGE=y
+CONFIG_USB_STORAGE_DEBUG=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_AT91=m
+CONFIG_USB_ZERO=m
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_FILE_STORAGE=m
+CONFIG_USB_G_SERIAL=m
+CONFIG_LEDS_GPIO=m
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_AT91SAM9=y
+CONFIG_EXT2_FS=y
+CONFIG_INOTIFY=y
+CONFIG_VFAT_FS=y
+CONFIG_TMPFS=y
+CONFIG_CRAMFS=y
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_CODEPAGE_850=y
+CONFIG_NLS_ISO8859_1=y
+CONFIG_MMC=m
+CONFIG_MMC_BLOCK=m
+CONFIG_MMC_AT91=m
+CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y
+CONFIG_MTD_NAND_ATMEL=y
+CONFIG_MTD_NAND_ECC=y
+CONFIG_MTD_NAND_IDS=y
+CONFIG_MTD_NAND_PLATFORM=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_UBI_BEB_RESERVE=1
+CONFIG_MTD_UBI_WL_THRESHOLD=256
+CONFIG_MTD_UBI=y
+CONFIG_RTC_DRV_AT91SAM9_GPBR=0
+CONFIG_RTC_DRV_AT91SAM9_RTT=0
+CONFIG_SPI_ATMEL=m
+CONFIG_UBIFS_FS_ADVANCED_COMPR=y
+CONFIG_UBIFS_FS_LZO=y
+CONFIG_UBIFS_FS_XATTR=y
+CONFIG_UBIFS_FS=y
+CONFIG_LZO_DECOMPRESS=y
Index: target/linux/at91/MMnet1000/target.mk
===================================================================
--- target/linux/at91/MMnet1000/target.mk       (revision 0)
+++ target/linux/at91/MMnet1000/target.mk       (revision 0)
@@ -0,0 +1,6 @@
+BOARDNAME:=MMnet1000
+
+define Target/Description
+       Build firmware images for MMnet1000 board
+endef
+
Index: target/linux/at91/files/arch/arm/mach-at91/board-mmnet1000.c
===================================================================
--- target/linux/at91/files/arch/arm/mach-at91/board-mmnet1000.c        
(revision 0)
+++ target/linux/at91/files/arch/arm/mach-at91/board-mmnet1000.c        
(revision 0)
@@ -0,0 +1,239 @@
+/*
+ * linux/arch/arm/mach-at91/board-mmnet1000.c
+ *
+ *  Copyright (C) 2005 SAN People
+ *  Copyright (C) 2006 Atmel
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Based on board-sam9260ek.c and original changes by Propox.
+ */
+
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/at73c213.h>
+#include <linux/clk.h>
+#include <linux/i2c/at24.h>
+#include <linux/gpio_keys.h>
+#include <linux/input.h>
+
+#include <asm/setup.h>
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <mach/hardware.h>
+#include <mach/board.h>
+#include <mach/gpio.h>
+
+#include "generic.h"
+
+
+static void __init mmnet_map_io(void)
+{
+       /* Initialize processor: 18.432 MHz crystal */
+       at91sam9260_initialize(18432000);
+
+       /* DBGU on ttyS0. (Rx & Tx only) */
+       at91_register_uart(0, 0, 0);
+
+       /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */
+       at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | 
ATMEL_UART_RTS
+                          | ATMEL_UART_DTR | ATMEL_UART_DSR | ATMEL_UART_DCD
+                          | ATMEL_UART_RI);
+
+       /* USART1 on ttyS2. (Rx, Tx, RTS, CTS) */
+       at91_register_uart(AT91SAM9260_ID_US1, 2, ATMEL_UART_CTS | 
ATMEL_UART_RTS);
+       /* USART2 on ttyS2. (Rx, Tx, RTS, CTS)
+        * CTS2: conflict with MMCDB1 used by 4-bit MMC if 
mmnet_mmc_data.wire4=1
+        * RTS2: conflict with MMCDB2 used by 4-bit MMC if 
mmnet_mmc_data.wire4=1
+        */
+       at91_register_uart(AT91SAM9260_ID_US2, 3, 0 /* ATMEL_UART_CTS | 
ATMEL_UART_RTS */);
+       /* USART3 on ttyS2. (Rx, Tx, RTS, CTS)
+        * RTS3: conflict with MMC detect on PC8 - not used by default
+        */
+       at91_register_uart(AT91SAM9260_ID_US3, 4, 0 /* ATMEL_UART_CTS | 
ATMEL_UART_RTS */);
+       /* USART4 on ttyS2. (Rx, Tx) */
+       at91_register_uart(AT91SAM9260_ID_US4, 5, 0);
+       /* USART5 on ttyS2. (Rx, Tx) */
+       at91_register_uart(AT91SAM9260_ID_US5, 6, 0);
+
+       /* set serial console to ttyS0 (ie, DBGU) */
+       at91_set_serial_console(0);
+}
+
+static void __init mmnet_init_irq(void)
+{
+       at91sam9260_init_interrupts(NULL);
+}
+
+
+/*
+ * USB Host port
+ */
+static struct at91_usbh_data __initdata mmnet_usbh_data = {
+       .ports          = 2,
+};
+
+/*
+ * USB Device port
+ */
+static struct at91_udc_data __initdata mmnet_udc_data = {
+       .vbus_pin       = AT91_PIN_PC5,
+       .pullup_pin     = 0,            /* pull-up driven by UDC */
+};
+
+/*
+ * SPI devices.
+ *
+ * No SPI devices by default, note SPI0 shares lines with MMC on MMnet1002 
board.
+ *
+ * at91sam9260_devices.c notes:
+ * 1. Original at91sam9260_devices.c uses:
+ * spi0_standard_cs[4] = { AT91_PIN_PA3, AT91_PIN_PC11, AT91_PIN_PC16, 
AT91_PIN_PC17 };
+ * spi1_standard_cs[4] = { AT91_PIN_PB3, AT91_PIN_PC5, AT91_PIN_PC4, 
AT91_PIN_PC3 };
+ *
+ * 2. OpwnWrt 805-free_some_portc_pins.patch changes it to:
+ * spi0_standard_cs[4] = { AT91_PIN_PA3, AT91_PIN_PC11, AT91_PIN_PC16, 
AT91_PIN_PC17 };
+ * spi1_standard_cs[2] = { AT91_PIN_PB3, AT91_PIN_PC5 };
+ *
+ * 3. Whilst MMnet1000 board uses:
+ * spi0_standard_cs[2] = { AT91_PIN_PA3, AT91_PIN_PC11 };
+ * spi1_standard_cs[4] = { AT91_PIN_PB3, AT91_PIN_PC5, AT91_PIN_PC4, 
AT91_PIN_PC3 };
+ */
+
+/*
+ * MACB Ethernet device
+ */
+static struct at91_eth_data __initdata mmnet_macb_data = {
+       .phy_irq_pin    = AT91_PIN_PA7,
+       .is_rmii        = 0,
+};
+
+
+/*
+ * NAND flash
+ */
+static struct mtd_partition __initdata mmnet_nand_partition[] = {
+       {
+               .name   = "bootstrap",
+               .offset = 0,
+               .size   = SZ_256K,
+       },
+       {
+               .name   = "u-boot",
+               .offset = MTDPART_OFS_NXTBLK,
+               .size   = SZ_256K,
+       },
+       {
+               .name   = "u-boot environment",
+               .offset = MTDPART_OFS_NXTBLK,
+               .size   = SZ_1M + SZ_512K,
+       },
+       {
+               .name   = "kernel",
+               .offset = MTDPART_OFS_NXTBLK,
+               .size   = SZ_8M - SZ_2M,
+       },
+       {
+               .name   = "filesystems",
+               .offset = MTDPART_OFS_NXTBLK,
+               .size   = MTDPART_SIZ_FULL,
+       },
+};
+
+static struct mtd_partition * __init nand_partitions(int size, int 
*num_partitions)
+{
+       *num_partitions = ARRAY_SIZE(mmnet_nand_partition);
+       return mmnet_nand_partition;
+}
+
+static struct atmel_nand_data __initdata mmnet_nand_data = {
+       .ale            = 21,
+       .cle            = 22,
+//     .det_pin        = ... not connected
+       .rdy_pin        = AT91_PIN_PC13,
+       .enable_pin     = AT91_PIN_PC14,
+       .partition_info = nand_partitions,
+       .bus_width_16   = 0,
+};
+
+
+/*
+ * MCI (SD/MMC)
+ */
+static struct at91_mmc_data __initdata mmnet_mmc_data = {
+       .slot_b         = 1,
+       .wire4          = 1, /* wire4=1: conflict with CTS2/RTS2 */
+//     .det_pin        = ... not connected
+//     .wp_pin         = ... not connected
+//     .vcc_pin        = ... not connected
+};
+
+
+/*
+ * LEDs
+ */
+static struct gpio_led mmnet_leds[] = {
+       {       /* "user" led, green */
+               .name                   = "usr",
+               .gpio                   = AT91_PIN_PC15,
+               .active_low             = 1,
+               .default_trigger        = "heartbeat",
+       }
+};
+
+static void __init mmnet_add_device_buttons(void) {}
+
+
+static void __init mmnet_board_init(void)
+{
+       /* Serial */
+       at91_add_device_serial();
+       /* USB Host */
+       at91_add_device_usbh(&mmnet_usbh_data);
+       /* USB Device */
+       at91_add_device_udc(&mmnet_udc_data);
+       /* SPI */
+       at91_add_device_spi(NULL, 0); /* SPI0 shares MMC lines */
+       /* NAND */
+       at91_add_device_nand(&mmnet_nand_data);
+       /* Ethernet */
+       at91_add_device_eth(&mmnet_macb_data);
+       /* MMC */
+       at91_add_device_mmc(0, &mmnet_mmc_data); /* shares SPI0 lines, for 
wire4=1: conflict with CTS2/RTS2 */
+       /* I2C */
+       at91_add_device_i2c(NULL, 0);
+       /* LEDs */
+       at91_gpio_leds(mmnet_leds, ARRAY_SIZE(mmnet_leds));
+       /* Push Buttons */
+       mmnet_add_device_buttons();
+}
+
+MACHINE_START(MMNET1000, "Propox MMnet1000")
+       /* Maintainer: Propox */
+       .boot_params    = AT91_SDRAM_BASE + 0x100,
+       .timer          = &at91sam926x_timer,
+       .map_io         = mmnet_map_io,
+       .init_irq       = mmnet_init_irq,
+       .init_machine   = mmnet_board_init,
+MACHINE_END
Index: target/linux/at91/patches/902-MMnet1000.patch
===================================================================
--- target/linux/at91/patches/902-MMnet1000.patch       (revision 0)
+++ target/linux/at91/patches/902-MMnet1000.patch       (revision 0)
@@ -0,0 +1,26 @@
+--- a/arch/arm/mach-at91/Kconfig
++++ b/arch/arm/mach-at91/Kconfig
+@@ -252,6 +252,13 @@ config MACH_CPU9260
+         Select this if you are using a Eukrea Electromatique's
+         CPU9260 Board <http://www.eukrea.com/>
+ 
++config MACH_MMNET1000
++      bool "MMnet1000 board board"
++      depends on ARCH_AT91SAM9260
++      help
++        Select this if you are using a MMnet1000 series board
++        <http://www.propox.com/>
++
+ config MACH_FLEXIBITY
+       bool "Flexibity Connect board"
+       help
+--- a/arch/arm/mach-at91/Makefile
++++ b/arch/arm/mach-at91/Makefile
+@@ -46,6 +46,7 @@ obj-$(CONFIG_MACH_USB_A9260) += board-us
+ obj-$(CONFIG_MACH_QIL_A9260)  += board-qil-a9260.o
+ obj-$(CONFIG_MACH_AFEB9260)   += board-afeb-9260v1.o
+ obj-$(CONFIG_MACH_CPU9260)    += board-cpu9krea.o
++obj-$(CONFIG_MACH_MMNET1000)  += board-mmnet1000.o
+ obj-$(CONFIG_MACH_FLEXIBITY)  += board-flexibity.o
+ 
+ # AT91SAM9261 board-specific support
Index: target/linux/at91/Makefile
===================================================================
--- target/linux/at91/Makefile  (revision 27611)
+++ target/linux/at91/Makefile  (working copy)
@@ -12,7 +12,7 @@
 BOARDNAME:=Atmel AT91
 FEATURES:=squashfs jffs2 targz
 CFLAGS:=-Os -pipe -march=armv5te -mtune=arm926ej-s -fno-caller-saves
-SUBTARGETS:=netus tqma9263 flexibity
+SUBTARGETS:=netus tqma9263 flexibity MMnet1000
 
 LINUX_VERSION:=2.6.38.8
 DEVICE_TYPE=

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

Reply via email to