mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: "Teresa Gámez" <t.gamez@phytec.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 3/3] pcm051: Add inital support
Date: Thu, 20 Sep 2012 20:34:28 +0200	[thread overview]
Message-ID: <20120920183428.GH26553@game.jcrosoft.org> (raw)
In-Reply-To: <1348149724-28468-3-git-send-email-t.gamez@phytec.de>

On 16:02 Thu 20 Sep     , Teresa Gámez wrote:
> Added initial support for Phytec phyCORE-AM335x.
> 
> Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
> ---
>  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
use savedefconfig to generate it

Best Regards,
J.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2012-09-20 18:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-20 14:02 [PATCH 1/3] Add support for creating barebox.img file Teresa Gámez
2012-09-20 14:02 ` [PATCH 2/3] ARM OMAP AM33XX: create new ARCH for AM33xx Teresa Gámez
2012-09-20 18:38   ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-20 19:26   ` Jan Luebbe
2012-09-24 15:24     ` [PATCH] WIP beaglebone: add first-stage supprort for AM335x and board Jan Luebbe
2012-09-20 14:02 ` [PATCH 3/3] pcm051: Add inital support Teresa Gámez
2012-09-20 18:34   ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2012-09-21  6:37     ` Sascha Hauer
2012-09-21  6:46       ` Teresa Gamez
2012-09-20 18:31 ` [PATCH 1/3] Add support for creating barebox.img file Jean-Christophe PLAGNIOL-VILLARD
2012-09-20 19:13 ` [PATCH] Makefile: add target to produce a SPL compatible uImage Jan Luebbe
2012-09-20 19:31   ` Jan Luebbe
2012-09-24 12:37   ` Teresa Gamez
2012-09-24 12:49     ` Jan Lübbe
2012-09-25 12:29       ` Teresa Gamez
2012-09-25 12:35         ` Jan Lübbe
2012-09-25 12:28   ` Jan Lübbe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120920183428.GH26553@game.jcrosoft.org \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    --cc=t.gamez@phytec.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox