Added initial support for Phytec phyCORE-AM335x. Signed-off-by: Teresa Gámez <t.gamez@xxxxxxxxx> --- arch/arm/Makefile | 1 + arch/arm/boards/pcm051/Makefile | 1 + arch/arm/boards/pcm051/board.c | 72 ++++++++++++ arch/arm/boards/pcm051/config.h | 21 ++++ arch/arm/boards/pcm051/env/boot/disk | 10 ++ arch/arm/boards/pcm051/env/init/automount | 32 +++++ arch/arm/boards/pcm051/env/init/bootargs-base | 9 ++ arch/arm/boards/pcm051/env/init/general | 15 +++ arch/arm/boards/pcm051/env/init/hostname | 8 ++ arch/arm/boards/pcm051/env/network/eth0 | 15 +++ arch/arm/configs/pcm051_defconfig | 151 +++++++++++++++++++++++++ arch/arm/mach-omap/Kconfig | 10 ++ 12 files changed, 345 insertions(+), 0 deletions(-) create mode 100644 arch/arm/boards/pcm051/Makefile create mode 100644 arch/arm/boards/pcm051/board.c create mode 100644 arch/arm/boards/pcm051/config.h create mode 100644 arch/arm/boards/pcm051/env/boot/disk create mode 100644 arch/arm/boards/pcm051/env/init/automount create mode 100644 arch/arm/boards/pcm051/env/init/bootargs-base create mode 100644 arch/arm/boards/pcm051/env/init/general create mode 100644 arch/arm/boards/pcm051/env/init/hostname create mode 100644 arch/arm/boards/pcm051/env/network/eth0 create mode 100644 arch/arm/configs/pcm051_defconfig diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 8e660be..ccb4805 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -108,6 +108,7 @@ board-$(CONFIG_MACH_PCM027) := pcm027 board-$(CONFIG_MACH_PCM037) := pcm037 board-$(CONFIG_MACH_PCM038) := pcm038 board-$(CONFIG_MACH_PCM043) := pcm043 +board-$(CONFIG_MACH_PCM051) := pcm051 board-$(CONFIG_MACH_PM9261) := pm9261 board-$(CONFIG_MACH_PM9263) := pm9263 board-$(CONFIG_MACH_PM9G45) := pm9g45 diff --git a/arch/arm/boards/pcm051/Makefile b/arch/arm/boards/pcm051/Makefile new file mode 100644 index 0000000..dcfc293 --- /dev/null +++ b/arch/arm/boards/pcm051/Makefile @@ -0,0 +1 @@ +obj-y += board.o diff --git a/arch/arm/boards/pcm051/board.c b/arch/arm/boards/pcm051/board.c new file mode 100644 index 0000000..7cb85f1 --- /dev/null +++ b/arch/arm/boards/pcm051/board.c @@ -0,0 +1,72 @@ +/* + * pcm051 - phyCORE-AM335x Board Initalization Code + * + * Copyright (C) 2012 Teresa Gámez, Phytec Messtechnik GmbH + * + * Based on arch/arm/boards/omap/board-beagle.c + * + * 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 + */ + +#include <common.h> +#include <init.h> +#include <sizes.h> +#include <ns16550.h> +#include <asm/armlinux.h> +#include <generated/mach-types.h> +#include <mach/silicon.h> + +static struct NS16550_plat serial_plat = { + .clock = 48000000, /* 48MHz (APLL96/2) */ + .shift = 2, +}; + +/** + * @brief UART serial port initialization + * arch + * + * @return result of device registration + */ +static int pcm051_console_init(void) +{ + /* Register the serial port */ + add_ns16550_device(DEVICE_ID_DYNAMIC, AM33XX_UART0_BASE, 1024, + IORESOURCE_MEM_8BIT, &serial_plat); + + return 0; +} +console_initcall(pcm051_console_init); + +static int pcm051_mem_init(void) +{ + arm_add_mem_device("ram0", AM33XX_DRAM_ADDR_SPACE_START, SZ_512M); + + return 0; +} +mem_initcall(pcm051_mem_init); + +static int pcm051_devices_init(void) +{ + add_generic_device("omap-hsmmc", DEVICE_ID_DYNAMIC, NULL, + (AM33XX_MMCHS0_BASE + 0x100), SZ_4K, + IORESOURCE_MEM, NULL); + + armlinux_set_bootparams((void *)(AM33XX_DRAM_ADDR_SPACE_START + 0x100)); + armlinux_set_architecture(MACH_TYPE_PCM051); + + return 0; +} +device_initcall(pcm051_devices_init); diff --git a/arch/arm/boards/pcm051/config.h b/arch/arm/boards/pcm051/config.h new file mode 100644 index 0000000..8b2b876 --- /dev/null +++ b/arch/arm/boards/pcm051/config.h @@ -0,0 +1,21 @@ +/** + * 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 + */ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#endif /* __CONFIG_H */ diff --git a/arch/arm/boards/pcm051/env/boot/disk b/arch/arm/boards/pcm051/env/boot/disk new file mode 100644 index 0000000..c627991 --- /dev/null +++ b/arch/arm/boards/pcm051/env/boot/disk @@ -0,0 +1,10 @@ +#!/bin/sh + +if [ "$1" = menu ]; then + boot-menu-add-entry "$0" "SD Card" + exit +fi + +global.bootm.image="/mnt/fat/linuximage" +#global.bootm.oftree="/env/oftree" +bootargs-root-disk -p mmcblk0p2 -t ext3 diff --git a/arch/arm/boards/pcm051/env/init/automount b/arch/arm/boards/pcm051/env/init/automount new file mode 100644 index 0000000..644a793 --- /dev/null +++ b/arch/arm/boards/pcm051/env/init/automount @@ -0,0 +1,32 @@ +#!/bin/sh + +if [ "$1" = menu ]; then + init-menu-add-entry "$0" "Automountpoints" + exit +fi + +# automount server returned from dhcp server + +#mkdir -p /mnt/tftp-dhcp +#automount /mnt/tftp-dhcp 'ifup eth0 && mount $eth0.serverip tftp /mnt/tftp-dhcp' + +# automount nfs server example + +#nfshost=somehost +#mkdir -p /mnt/${nfshost} +#automount /mnt/$nfshost "ifup eth0 && mount ${nfshost}:/tftpboot nfs /mnt/${nfshost}" + +# static tftp server example + +#mkdir -p /mnt/tftp +#automount -d /mnt/tftp 'ifup eth0 && mount $serverip tftp /mnt/tftp' + +# FAT on usb disk example + +#mkdir -p /mnt/fat +#automount -d /mnt/fat 'usb && [ -e /dev/disk0.0 ] && mount /dev/disk0.0 /mnt/fat' + +# FAT on mmc card + +mkdir -p /mnt/fat +automount -d /mnt/fat '[ -e /dev/disk0.0 ] && mount /dev/disk0.0 /mnt/fat' diff --git a/arch/arm/boards/pcm051/env/init/bootargs-base b/arch/arm/boards/pcm051/env/init/bootargs-base new file mode 100644 index 0000000..b3139b9 --- /dev/null +++ b/arch/arm/boards/pcm051/env/init/bootargs-base @@ -0,0 +1,9 @@ +#!/bin/sh + +if [ "$1" = menu ]; then + init-menu-add-entry "$0" "Base bootargs" + exit +fi + +global.linux.bootargs.base="console=ttyO0,115200" +bootargs-ip diff --git a/arch/arm/boards/pcm051/env/init/general b/arch/arm/boards/pcm051/env/init/general new file mode 100644 index 0000000..743c864 --- /dev/null +++ b/arch/arm/boards/pcm051/env/init/general @@ -0,0 +1,15 @@ +#!/bin/sh + +if [ "$1" = menu ]; then + init-menu-add-entry "$0" "general config settings" + exit +fi + +# user (used for network filenames) +global.user= + +# timeout in seconds before the default boot entry is started +global.autoboot_timeout=3 + +# default boot entry (one of /env/boot/*) +global.boot.default=disk diff --git a/arch/arm/boards/pcm051/env/init/hostname b/arch/arm/boards/pcm051/env/init/hostname new file mode 100644 index 0000000..3ea1e0a --- /dev/null +++ b/arch/arm/boards/pcm051/env/init/hostname @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ "$1" = menu ]; then + init-menu-add-entry "$0" "hostname" + exit +fi + +global.hostname=pcm051 diff --git a/arch/arm/boards/pcm051/env/network/eth0 b/arch/arm/boards/pcm051/env/network/eth0 new file mode 100644 index 0000000..818b9f1 --- /dev/null +++ b/arch/arm/boards/pcm051/env/network/eth0 @@ -0,0 +1,15 @@ +#!/bin/sh + +# ip setting (static/dhcp) +ip=dhcp + +# static setup used if ip=static +#ipaddr= +#netmask= +#gateway= +#serverip= + +# MAC address if needed +#ethaddr=xx:xx:xx:xx:xx:xx + +# put code to discover eth0 (i.e. 'usb') to /env/network/eth0-discover diff --git a/arch/arm/configs/pcm051_defconfig b/arch/arm/configs/pcm051_defconfig new file mode 100644 index 0000000..6788e61 --- /dev/null +++ b/arch/arm/configs/pcm051_defconfig @@ -0,0 +1,151 @@ +CONFIG_GENERIC_LINKER_SCRIPT=y +CONFIG_ARM=y +CONFIG_ARM_LINUX=y +CONFIG_ARCH_OMAP=y +CONFIG_CPU_32=y +CONFIG_CPU_V7=y +CONFIG_CPU_32v7=y +CONFIG_BOARDINFO="Phytec phyCORE-AM335x" +CONFIG_ARCH_AM33XX=y +CONFIG_OMAP_CLOCK_ALL=y +CONFIG_OMAP_CLOCK_SOURCE_DMTIMER0=y +CONFIG_OMAP_BUILD_IFT=y +CONFIG_MACH_PCM051=y +CONFIG_AEABI=y +CONFIG_CMD_ARM_CPUINFO=y +CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y +CONFIG_ARM_EXCEPTIONS=y +CONFIG_ARM_UNWIND=y +CONFIG_DEFCONFIG_LIST="$ARCH_DEFCONFIG" +CONFIG_GREGORIAN_CALENDER=y +CONFIG_HAS_KALLSYMS=y +CONFIG_HAS_MODULES=y +CONFIG_CMD_MEMORY=y +CONFIG_ENV_HANDLING=y +CONFIG_GENERIC_GPIO=y +CONFIG_BLOCK=y +CONFIG_BLOCK_WRITE=y +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_ENVIRONMENT_VARIABLES=y +CONFIG_HAVE_CONFIGURABLE_TEXT_BASE=y +CONFIG_TEXT_BASE=0x81000000 +CONFIG_HAVE_CONFIGURABLE_MEMORY_LAYOUT=y +CONFIG_MEMORY_LAYOUT_DEFAULT=y +CONFIG_STACK_SIZE=0x8000 +CONFIG_MALLOC_SIZE=0x400000 +CONFIG_MALLOC_DLMALLOC=y +CONFIG_PROMPT="phyCORE-AM335x >" +CONFIG_BAUDRATE=115200 +CONFIG_LONGHELP=y +CONFIG_CBSIZE=1024 +CONFIG_MAXARGS=16 +CONFIG_SHELL_HUSH=y +CONFIG_GLOB=y +CONFIG_PROMPT_HUSH_PS2="> " +CONFIG_HUSH_FANCY_PROMPT=y +CONFIG_HUSH_GETOPT=y +CONFIG_CMDLINE_EDITING=y +CONFIG_AUTO_COMPLETE=y +CONFIG_MENU=y +CONFIG_DYNAMIC_CRC_TABLE=y +CONFIG_ERRNO_MESSAGES=y +CONFIG_TIMESTAMP=y +CONFIG_CONSOLE_FULL=y +CONFIG_CONSOLE_ACTIVATE_FIRST=y +CONFIG_PARTITION=y +CONFIG_PARTITION_DISK=y +CONFIG_PARTITION_DISK_DOS=y +CONFIG_DEFAULT_ENVIRONMENT=y +CONFIG_HAVE_DEFAULT_ENVIRONMENT_NEW=y +CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y +CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/pcm051/env" +CONFIG_COMMAND_SUPPORT=y +CONFIG_CMD_EDIT=y +CONFIG_CMD_SLEEP=y +CONFIG_CMD_SAVEENV=y +CONFIG_CMD_LOADENV=y +CONFIG_CMD_EXPORT=y +CONFIG_CMD_PRINTENV=y +CONFIG_CMD_READLINE=y +CONFIG_CMD_TRUE=y +CONFIG_CMD_FALSE=y +CONFIG_CMD_MENU=y +CONFIG_CMD_MENU_MANAGEMENT=y +CONFIG_CMD_TIME=y +CONFIG_CMD_LS=y +CONFIG_CMD_RM=y +CONFIG_CMD_CAT=y +CONFIG_CMD_MKDIR=y +CONFIG_CMD_RMDIR=y +CONFIG_CMD_CP=y +CONFIG_CMD_PWD=y +CONFIG_CMD_CD=y +CONFIG_CMD_MOUNT=y +CONFIG_CMD_UMOUNT=y +CONFIG_CMD_NAND=y +CONFIG_CMD_CLEAR=y +CONFIG_CMD_ECHO=y +CONFIG_CMD_ECHO_E=y +CONFIG_CMD_LOADB=y +CONFIG_CMD_MEMINFO=y +CONFIG_CMD_IOMEM=y +CONFIG_CMD_CRC=y +CONFIG_CMD_CRC_CMP=y +CONFIG_CMD_DIGEST=y +CONFIG_CMD_MD5SUM=y +CONFIG_CMD_SHA1SUM=y +CONFIG_CMD_SHA256SUM=y +CONFIG_CMD_SHA224SUM=y +CONFIG_CMD_FLASH=y +CONFIG_CMD_UBI=y +CONFIG_CMD_BOOTM=y +CONFIG_CMD_BOOTM_SHOW_TYPE=y +CONFIG_CMD_IMINFO=y +CONFIG_CMD_BOOTZ=n +CONFIG_CMD_BOOTU=n +CONFIG_CMD_RESET=y +CONFIG_CMD_GO=y +CONFIG_CMD_TIMEOUT=y +CONFIG_CMD_PARTITION=y +CONFIG_CMD_TEST=y +CONFIG_CMD_VERSION=y +CONFIG_CMD_HELP=y +CONFIG_CMD_MAGICVAR=y +CONFIG_CMD_MAGICVAR_HELP=y +CONFIG_CMD_DEVINFO=y +CONFIG_CMD_UNCOMPRESS=y +CONFIG_DRIVER_SERIAL_NS16550=y +CONFIG_DRIVER_SERIAL_NS16550_OMAP_EXTENSIONS=y +CONFIG_MIIDEV=y +CONFIG_DRIVER_NET_SMC911X=y +CONFIG_DRIVER_NET_SMC911X_ADDRESS_SHIFT=0 +CONFIG_SPI=n +CONFIG_UBI=y +CONFIG_DISK=y +CONFIG_DISK_WRITE=y +CONFIG_MCI=y +CONFIG_MCI_INFO=y +CONFIG_MCI_WRITE=y +CONFIG_MCI_OMAP_HSMMC=y +CONFIG_MCI_STARTUP=y +CONFIG_FS_CRAMFS=y +CONFIG_FS_RAMFS=y +CONFIG_FS_DEVFS=y +CONFIG_FS_FAT=y +CONFIG_FS_FAT_WRITE=y +CONFIG_FS_FAT_LFN=y +CONFIG_PARTITION_NEED_MTD=y +CONFIG_ZLIB=y +CONFIG_BZLIB=y +CONFIG_PROCESS_ESCAPE_SEQUENCE=y +CONFIG_LZO_DECOMPRESS=y +CONFIG_FDT=y +CONFIG_OFTREE=y +CONFIG_CRC32=y +CONFIG_CRC16=y +CONFIG_DIGEST=y +CONFIG_MD5=y +CONFIG_SHA1=y +CONFIG_SHA224=y +CONFIG_SHA256=y diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig index b3f121f..b4f1a23 100644 --- a/arch/arm/mach-omap/Kconfig +++ b/arch/arm/mach-omap/Kconfig @@ -115,6 +115,7 @@ config BOARDINFO default "Phytec phyCORE pcm049" if MACH_PCM049 default "Phytec phyCARD-A-L1" if MACH_PCAAL1 default "Phytec phyCARD-A-XL2" if MACH_PCAAXL2 + default "Phytec phyCORE-AM335x" if MACH_PCM051 choice prompt "Select OMAP board" @@ -175,6 +176,15 @@ config MACH_PCAAXL2 help Say Y here if you are using a phyCARD-A-XL1 PCA-A-XL1 +config MACH_PCM051 + bool "Phytec phyCORE pcm051" + select OMAP_CLOCK_ALL + select HAVE_NOSHELL + select HAVE_DEFAULT_ENVIRONMENT_NEW + depends on ARCH_AM33XX + help + Say Y here if you are using Phytecs phyCORE pcm051 board + endchoice if MACH_OMAP3EVM -- 1.7.0.4 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox