Re: [PATCH 3/5] ARM: zynq: add driver for Zynq uarts

2013-03-03 Thread Jean-Christophe PLAGNIOL-VILLARD
On 18:48 Sat 02 Mar , Josh Cartwright wrote:
 
 Simple UART driver for Zynq SoCs, based loosely on the u-boot driver.
 
 Signed-off-by: Josh Cartwright jo...@eso.teric.us
 ---
  drivers/serial/Kconfig   |   6 ++
  drivers/serial/Makefile  |   1 +
  drivers/serial/serial_zynq.c | 144 
 +++
  3 files changed, 151 insertions(+)
  create mode 100644 drivers/serial/serial_zynq.c
 
 diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
 index f61d670..608b616 100644
 --- a/drivers/serial/Kconfig
 +++ b/drivers/serial/Kconfig
 @@ -113,4 +113,10 @@ config DRIVER_SERIAL_OMAP4_USBBOOT
   help
 Enable this to get console support over the usb bus used to boot an 
 OMAP4
  
 +config DRIVER_SERIAL_ZYNQ
 + bool driver for Zynq uarts
 + default n
 + help
 +   Say Y here to get console out support with the Zynq uarts
 +
  endmenu
 diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
 index 893e282..883394f 100644
 --- a/drivers/serial/Makefile
 +++ b/drivers/serial/Makefile
 @@ -21,3 +21,4 @@ obj-$(CONFIG_DRIVER_SERIAL_ALTERA)  += 
 serial_altera.o
  obj-$(CONFIG_DRIVER_SERIAL_ALTERA_JTAG)  += serial_altera_jtag.o
  obj-$(CONFIG_DRIVER_SERIAL_PXA)  += serial_pxa.o
  obj-$(CONFIG_DRIVER_SERIAL_OMAP4_USBBOOT)+= serial_omap4_usbboot.o
 +obj-$(CONFIG_DRIVER_SERIAL_ZYNQ) += serial_zynq.o
 diff --git a/drivers/serial/serial_zynq.c b/drivers/serial/serial_zynq.c
 new file mode 100644
 index 000..ec93b58
 --- /dev/null
 +++ b/drivers/serial/serial_zynq.c
 @@ -0,0 +1,144 @@
 +/*
 + * (C) Copyright 2013 Josh Cartwright
 + *
 + * Based very loosely on u-boot drivers/serial/serial_zynq.c.
 + *
 + * Copyright (C) 2012 Michal Simek mon...@monstr.eu
 + * Copyright (C) 2011-2012 Xilinx, Inc. All rights reserved.
 + *
 + * See file CREDITS for list of people who contributed to this
 + * project.
 + *
 + * 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 io.h
 +#include init.h
 +#include driver.h
 +#include xfuncs.h
 +#include console.h
 +#include malloc.h
 +
 +#include linux/clk.h
 +
 +#define UART_CR  0x
 +#define UART_CR_TXEN (14)
 +#define UART_CR_RXEN (12)
 +#define UART_CR_TXRST(11)
 +#define UART_CR_RXRST(10)
 +
 +#define UART_SR  0x002C
 +#define UART_SR_TXFULL   (14)
 +#define UART_SR_TXEMPTY  (13)
 +#define UART_SR_RXFULL   (12)
 +#define UART_SR_RXEMPTY  (11)
 +
 +#define UART_FIFO0x0030
 +
 +struct zynq_serial_device {
 + struct console_device cdev;
 + struct clk *clk;
 + void __iomem *regs;
 +};
 +
 +#define to_zynq_device(p) container_of(p, struct zynq_serial_device, cdev)
 +
 +static void zynq_serial_init_device(struct zynq_serial_device *dev)
 +{
 + writel(UART_CR_TXEN | UART_CR_RXEN | UART_CR_TXEN | UART_CR_RXEN,
 +dev-regs + UART_CR);
 +}
 +
 +static int zynq_serial_tstc(struct console_device *cdev)
 +{
 + struct zynq_serial_device *zynq = to_zynq_device(cdev);
 +
 + return !(readl(zynq-regs + UART_SR)  UART_SR_RXEMPTY);
 +}
 +
 +static void zynq_serial_putc(struct console_device *cdev, char c)
 +{
 + struct zynq_serial_device *zynq = to_zynq_device(cdev);
 +
 + while (readl(zynq-regs + UART_SR)  UART_SR_TXFULL);
 +
 + writel(c, zynq-regs + UART_FIFO);
 +}
 +
 +static int zynq_serial_getc(struct console_device *cdev)
 +{
 + struct zynq_serial_device *zynq = to_zynq_device(cdev);
 +
 + return readl(zynq-regs + UART_FIFO);
 +}
 +
 +static void zynq_serial_flush(struct console_device *cdev)
 +{
 + struct zynq_serial_device *zynq = to_zynq_device(cdev);
 +
 + while (!(readl(zynq-regs + UART_SR)  UART_SR_TXEMPTY));
 +}
 +
 +static int zynq_serial_probe(struct device_d *dev)
 +{
 + struct zynq_serial_device *priv;
 + struct console_device *cdev;
 + int err;
 +
 + priv = xzalloc(sizeof(*priv));
 + cdev = priv-cdev;
 +
 + priv-regs  = dev_request_mem_region(dev, 0);
 + cdev-dev   = dev;
 + cdev-f_caps= CONSOLE_STDIN | CONSOLE_STDOUT | CONSOLE_STDERR;
 + cdev-tstc  = zynq_serial_tstc;
 + cdev-putc  = zynq_serial_putc;
 + cdev-getc  = zynq_serial_getc;
 + 

Re: [PATCH 3/5] ARM: zynq: add driver for Zynq uarts

2013-03-03 Thread Jean-Christophe PLAGNIOL-VILLARD
On 18:48 Sat 02 Mar , Josh Cartwright wrote:
 
 Simple UART driver for Zynq SoCs, based loosely on the u-boot driver.
 
 Signed-off-by: Josh Cartwright jo...@eso.teric.us
 ---
  drivers/serial/Kconfig   |   6 ++
  drivers/serial/Makefile  |   1 +
  drivers/serial/serial_zynq.c | 144 
 +++
  3 files changed, 151 insertions(+)
  create mode 100644 drivers/serial/serial_zynq.c
 
 diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
 index f61d670..608b616 100644
 --- a/drivers/serial/Kconfig
 +++ b/drivers/serial/Kconfig
 @@ -113,4 +113,10 @@ config DRIVER_SERIAL_OMAP4_USBBOOT
   help
 Enable this to get console support over the usb bus used to boot an 
 OMAP4
  
 +config DRIVER_SERIAL_ZYNQ
 + bool driver for Zynq uarts
 + default n
 + help
 +   Say Y here to get console out support with the Zynq uarts
 +
  endmenu
 diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
 index 893e282..883394f 100644
 --- a/drivers/serial/Makefile
 +++ b/drivers/serial/Makefile
 @@ -21,3 +21,4 @@ obj-$(CONFIG_DRIVER_SERIAL_ALTERA)  += 
 serial_altera.o
  obj-$(CONFIG_DRIVER_SERIAL_ALTERA_JTAG)  += serial_altera_jtag.o
  obj-$(CONFIG_DRIVER_SERIAL_PXA)  += serial_pxa.o
  obj-$(CONFIG_DRIVER_SERIAL_OMAP4_USBBOOT)+= serial_omap4_usbboot.o
 +obj-$(CONFIG_DRIVER_SERIAL_ZYNQ) += serial_zynq.o
 diff --git a/drivers/serial/serial_zynq.c b/drivers/serial/serial_zynq.c
 new file mode 100644
 index 000..ec93b58
 --- /dev/null
 +++ b/drivers/serial/serial_zynq.c
 @@ -0,0 +1,144 @@
 +/*
 + * (C) Copyright 2013 Josh Cartwright
 + *
 + * Based very loosely on u-boot drivers/serial/serial_zynq.c.
 + *
 + * Copyright (C) 2012 Michal Simek mon...@monstr.eu
 + * Copyright (C) 2011-2012 Xilinx, Inc. All rights reserved.
 + *
 + * See file CREDITS for list of people who contributed to this
 + * project.
 + *
 + * 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 io.h
 +#include init.h
 +#include driver.h
 +#include xfuncs.h
 +#include console.h
 +#include malloc.h
 +
 +#include linux/clk.h
 +
 +#define UART_CR  0x
 +#define UART_CR_TXEN (14)
 +#define UART_CR_RXEN (12)
 +#define UART_CR_TXRST(11)
 +#define UART_CR_RXRST(10)
 +
 +#define UART_SR  0x002C
 +#define UART_SR_TXFULL   (14)
 +#define UART_SR_TXEMPTY  (13)
 +#define UART_SR_RXFULL   (12)
 +#define UART_SR_RXEMPTY  (11)
 +
 +#define UART_FIFO0x0030
 +
 +struct zynq_serial_device {
 + struct console_device cdev;
 + struct clk *clk;
 + void __iomem *regs;
 +};
 +
 +#define to_zynq_device(p) container_of(p, struct zynq_serial_device, cdev)
 +
 +static void zynq_serial_init_device(struct zynq_serial_device *dev)
 +{
 + writel(UART_CR_TXEN | UART_CR_RXEN | UART_CR_TXEN | UART_CR_RXEN,
 +dev-regs + UART_CR);
 +}
 +
 +static int zynq_serial_tstc(struct console_device *cdev)
 +{
 + struct zynq_serial_device *zynq = to_zynq_device(cdev);
 +
 + return !(readl(zynq-regs + UART_SR)  UART_SR_RXEMPTY);
 +}
 +
 +static void zynq_serial_putc(struct console_device *cdev, char c)
 +{
 + struct zynq_serial_device *zynq = to_zynq_device(cdev);
 +
 + while (readl(zynq-regs + UART_SR)  UART_SR_TXFULL);
 +
 + writel(c, zynq-regs + UART_FIFO);
 +}
 +
 +static int zynq_serial_getc(struct console_device *cdev)
 +{
 + struct zynq_serial_device *zynq = to_zynq_device(cdev);
 +
 + return readl(zynq-regs + UART_FIFO);
 +}
 +
 +static void zynq_serial_flush(struct console_device *cdev)
 +{
 + struct zynq_serial_device *zynq = to_zynq_device(cdev);
 +
 + while (!(readl(zynq-regs + UART_SR)  UART_SR_TXEMPTY));
 +}
 +
 +static int zynq_serial_probe(struct device_d *dev)
 +{
 + struct zynq_serial_device *priv;
 + struct console_device *cdev;
 + int err;
 +
 + priv = xzalloc(sizeof(*priv));
 + cdev = priv-cdev;
 +
 + priv-regs  = dev_request_mem_region(dev, 0);
 + cdev-dev   = dev;
 + cdev-f_caps= CONSOLE_STDIN | CONSOLE_STDOUT | CONSOLE_STDERR;
 + cdev-tstc  = zynq_serial_tstc;
 + cdev-putc  = zynq_serial_putc;
 + cdev-getc  = zynq_serial_getc;
 + 

Re: [PATCH 5/5] ARM: zynq: add support for zc702 development board

2013-03-03 Thread Jean-Christophe PLAGNIOL-VILLARD
On 18:48 Sat 02 Mar , Josh Cartwright wrote:
 
 Signed-off-by: Josh Cartwright jo...@eso.teric.us
 ---
  arch/arm/Makefile |  2 +
  arch/arm/boards/zynq-zc702/Makefile   |  1 +
  arch/arm/boards/zynq-zc702/config.h   |  0
  arch/arm/boards/zynq-zc702/devices.c  | 70 
 +++
  arch/arm/boards/zynq-zc702/lowlevel.c | 28 ++
  arch/arm/mach-zynq/Kconfig| 19 ++
  6 files changed, 120 insertions(+)
  create mode 100644 arch/arm/boards/zynq-zc702/Makefile
  create mode 100644 arch/arm/boards/zynq-zc702/config.h
  create mode 100644 arch/arm/boards/zynq-zc702/devices.c
  create mode 100644 arch/arm/boards/zynq-zc702/lowlevel.c
 
 diff --git a/arch/arm/Makefile b/arch/arm/Makefile
 index fcb2969..9073a55 100644
 --- a/arch/arm/Makefile
 +++ b/arch/arm/Makefile
 @@ -64,6 +64,7 @@ machine-$(CONFIG_ARCH_PXA)  := pxa
  machine-$(CONFIG_ARCH_SAMSUNG)   := samsung
  machine-$(CONFIG_ARCH_VERSATILE) := versatile
  machine-$(CONFIG_ARCH_TEGRA) := tegra
 +machine-$(CONFIG_ARCH_ZYNQ)  := zynq
  
  # Board directory name.  This list is sorted alphanumerically
  # by CONFIG_* macro name.
 @@ -157,6 +158,7 @@ board-$(CONFIG_MACH_SABRELITE):= 
 freescale-mx6-sabrelite
  board-$(CONFIG_MACH_TX53):= karo-tx53
  board-$(CONFIG_MACH_GUF_VINCELL) := guf-vincell
  board-$(CONFIG_MACH_EFIKA_MX_SMARTBOOK)  := efika-mx-smartbook
 +board-$(CONFIG_MACH_ZYNQ_ZC702)  := zynq-zc702
  
  machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y))
  
 diff --git a/arch/arm/boards/zynq-zc702/Makefile 
 b/arch/arm/boards/zynq-zc702/Makefile
 new file mode 100644
 index 000..385bd9f
 --- /dev/null
 +++ b/arch/arm/boards/zynq-zc702/Makefile
 @@ -0,0 +1 @@
 +obj-y += lowlevel.o devices.o
 diff --git a/arch/arm/boards/zynq-zc702/config.h 
 b/arch/arm/boards/zynq-zc702/config.h
 new file mode 100644
 index 000..e69de29
 diff --git a/arch/arm/boards/zynq-zc702/devices.c 
 b/arch/arm/boards/zynq-zc702/devices.c
 new file mode 100644
 index 000..b9ec9f3
 --- /dev/null
 +++ b/arch/arm/boards/zynq-zc702/devices.c
 @@ -0,0 +1,70 @@
 +/*
 + * Copyright (c) 2013 Josh Cartwright jo...@eso.teric.us
 + *
 + * This program is free software; you can redistribute it and/or modify it
 + * under the terms and conditions of the GNU General Public License,
 + * version 2, as published by the Free Software Foundation.
 + *
 + * This program is distributed in the hope 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, see http://www.gnu.org/licenses/.
 + */
 +#include common.h
 +#include driver.h
 +#include init.h
 +#include sizes.h
 +
 +#include asm/memory.h
 +
 +static struct resource smp_twd_resource = {
 + .name   = smp_twd_base,
 + .start  = 0xF8F00600,
 + .end= 0xF8F00610,
 + .flags  = IORESOURCE_MEM,
 +};
 +
 +static struct device_d zynq_smp_twd = {
 + .id = DEVICE_ID_DYNAMIC,
 + .name   = smp_twd,
 + .num_resources  = 1,
 + .resource   = smp_twd_resource,
 +};
 +
 +static struct resource zynq_serial_resource = {
 + .name   = zynq_serial_base,
 + .start  = 0xE0001000,
 + .end= 0xE0001048,
 + .flags  = IORESOURCE_MEM,
 +};
 +
 +static struct device_d zynq_serial = {
 + .id = DEVICE_ID_DYNAMIC,
 + .name   = zynq_serial,
 + .num_resources  = 1,
 + .resource   = zynq_serial_resource,
 +};

use generic code to register the devices
 +
 +static int zc702_console_init(void)
 +{
 + platform_device_register(zynq_serial);
 + return 0;
 +}
 +console_initcall(zc702_console_init);
 +
 +static int zc702_mem_init(void)
 +{
 + arm_add_mem_device(ram0, 0, SZ_128M);
 + return 0;
 +}
 +mem_initcall(zc702_mem_init);
 +
 +static int zc702_twd_init(void)
 +{
 + platform_device_register(zynq_smp_twd);
 + return 0;
 +}
 +coredevice_initcall(zc702_twd_init);
 diff --git a/arch/arm/boards/zynq-zc702/lowlevel.c 
 b/arch/arm/boards/zynq-zc702/lowlevel.c
 new file mode 100644
 index 000..662d969
 --- /dev/null
 +++ b/arch/arm/boards/zynq-zc702/lowlevel.c
 @@ -0,0 +1,28 @@
 +/*
 + * Copyright (c) 2013 Josh Cartwright jo...@eso.teric.us
 + *
 + * This program is free software; you can redistribute it and/or modify it
 + * under the terms and conditions of the GNU General Public License,
 + * version 2, as published by the Free Software Foundation.
 + *
 + * This program is distributed in the hope 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 

Re: [PATCH] ARM: cfa10036: Remove the boot partition and boot from ext

2013-03-03 Thread Sascha Hauer
On Wed, Feb 27, 2013 at 11:03:07AM +0100, Maxime Ripard wrote:
 Support for ext filesystems has been introduced recently. We can now
 boot directly from our rootfs, loading the kernel and device tree
 images from /boot.
 
 Signed-off-by: Maxime Ripard maxime.rip...@free-electrons.com

Applied, thanks

Sascha

 ---
  arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3 |6 +++---
  arch/arm/configs/cfa10036_defconfig |1 +
  2 files changed, 4 insertions(+), 3 deletions(-)
 
 diff --git a/arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3 
 b/arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3
 index 439d174..4d830ed 100644
 --- a/arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3
 +++ b/arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3
 @@ -5,6 +5,6 @@ if [ $1 = menu ]; then
   exit
  fi
  
 -global.bootm.image=/mnt/disk0.2/zImage-${global.hostname}
 -global.bootm.oftree=/mnt/disk0.2/oftree-${global.board.variant}
 -global.linux.bootargs.dyn.root=root=/dev/mmcblk0p4 rootfstype=ext3 rootwait
 +global.bootm.image=/mnt/disk0.2/boot/zImage-${global.hostname}
 +global.bootm.oftree=/mnt/disk0.2/boot/oftree-${global.board.variant}
 +global.linux.bootargs.dyn.root=root=/dev/mmcblk0p3 rootfstype=ext3 rootwait
 diff --git a/arch/arm/configs/cfa10036_defconfig 
 b/arch/arm/configs/cfa10036_defconfig
 index c55d50d..277a3ec 100644
 --- a/arch/arm/configs/cfa10036_defconfig
 +++ b/arch/arm/configs/cfa10036_defconfig
 @@ -39,5 +39,6 @@ CONFIG_I2C=y
  CONFIG_MCI=y
  CONFIG_MCI_STARTUP=y
  CONFIG_MCI_MXS=y
 +CONFIG_FS_EXT4=y
  CONFIG_FS_FAT=y
  CONFIG_FS_FAT_LFN=y
 -- 
 1.7.10.4
 
 
 ___
 barebox mailing list
 barebox@lists.infradead.org
 http://lists.infradead.org/mailman/listinfo/barebox
 

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

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


Re: UBOOT2 JMP

2013-03-03 Thread Sascha Hauer
On Tue, Feb 26, 2013 at 09:11:53PM -0600, Nathan wrote:
 “UBOOT2 JMP ” is what displays during bootup using VirtualBox.

There may be something broken on x86 support.

 This is after compiling with:
 export ARCH=x86
 make generic_defconfig
 make
 fdisk /dev/sdb...partition...mkfs.ext2 /dev/sdb1
 ./scripts/setupmbr/setupmbr –s 32 –m ./barebox.bin –d /dev/sdb
 
 I think there may be something I’m missing after “setupmbr” or I need
 to change a config value after setting “generic_defconfig”.  My end
 goal is to use barebox on my ODroid. I was “somewhat” familiar with
 syslinux but learned it doesn’t support ARM. I learned that Samsung
 Exynos in the ODroid uses UBoot and that barebox is the next evolution
 of uboot. I’m hoping it will be forward compatible (uboot in SoC calls
 barebox in MBR of SD which calls my linux kernel in SD partition).

When you want to use barebox on the ODroid, why do you build it for x86
then? You have to build for ARM. Unfortunately the Exynos is not
yet supported, so you would have to do the porting effort yourself.

Sascha

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

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


Re: [PATCH 3/5] ARM: zynq: add driver for Zynq uarts

2013-03-03 Thread Josh Cartwright
On Sun, Mar 03, 2013 at 11:16:49AM +0400, Antony Pavlov wrote:
 On 3 March 2013 04:48, Josh Cartwright jo...@eso.teric.us wrote:
  Simple UART driver for Zynq SoCs, based loosely on the u-boot driver.
 
  Signed-off-by: Josh Cartwright jo...@eso.teric.us
  ---
   drivers/serial/Kconfig   |   6 ++
   drivers/serial/Makefile  |   1 +
   drivers/serial/serial_zynq.c | 144 
  +++
   3 files changed, 151 insertions(+)
   create mode 100644 drivers/serial/serial_zynq.c
 
  diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
  index f61d670..608b616 100644
  --- a/drivers/serial/Kconfig
  +++ b/drivers/serial/Kconfig
  @@ -113,4 +113,10 @@ config DRIVER_SERIAL_OMAP4_USBBOOT
  help
Enable this to get console support over the usb bus used to boot 
  an OMAP4
 
  +config DRIVER_SERIAL_ZYNQ
  +   bool driver for Zynq uarts
  +   default n
  +   help
  + Say Y here to get console out support with the Zynq uarts
  +
   endmenu
  diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
  index 893e282..883394f 100644
  --- a/drivers/serial/Makefile
  +++ b/drivers/serial/Makefile
  @@ -21,3 +21,4 @@ obj-$(CONFIG_DRIVER_SERIAL_ALTERA)+= 
  serial_altera.o
   obj-$(CONFIG_DRIVER_SERIAL_ALTERA_JTAG)+= 
  serial_altera_jtag.o
   obj-$(CONFIG_DRIVER_SERIAL_PXA)+= serial_pxa.o
   obj-$(CONFIG_DRIVER_SERIAL_OMAP4_USBBOOT)  += serial_omap4_usbboot.o
  +obj-$(CONFIG_DRIVER_SERIAL_ZYNQ)   += serial_zynq.o
  diff --git a/drivers/serial/serial_zynq.c b/drivers/serial/serial_zynq.c
  new file mode 100644
  index 000..ec93b58
  --- /dev/null
  +++ b/drivers/serial/serial_zynq.c
  @@ -0,0 +1,144 @@
  +/*
  + * (C) Copyright 2013 Josh Cartwright
  + *
  + * Based very loosely on u-boot drivers/serial/serial_zynq.c.
  + *
  + * Copyright (C) 2012 Michal Simek mon...@monstr.eu
  + * Copyright (C) 2011-2012 Xilinx, Inc. All rights reserved.
  + *
  + * See file CREDITS for list of people who contributed to this
  + * project.
  + *
  + * 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 io.h
  +#include init.h
  +#include driver.h
  +#include xfuncs.h
  +#include console.h
  +#include malloc.h
  +
  +#include linux/clk.h
  +
  +#define UART_CR0x
  +#define UART_CR_TXEN   (14)
  +#define UART_CR_RXEN   (12)
  +#define UART_CR_TXRST  (11)
  +#define UART_CR_RXRST  (10)
  +
  +#define UART_SR0x002C
  +#define UART_SR_TXFULL (14)
  +#define UART_SR_TXEMPTY(13)
  +#define UART_SR_RXFULL (12)
  +#define UART_SR_RXEMPTY(11)
  +
  +#define UART_FIFO  0x0030
  +
  +struct zynq_serial_device {
  +   struct console_device cdev;
  +   struct clk *clk;
  +   void __iomem *regs;
  +};
  +
  +#define to_zynq_device(p) container_of(p, struct zynq_serial_device, cdev)
  +
  +static void zynq_serial_init_device(struct zynq_serial_device *dev)
  +{
  +   writel(UART_CR_TXEN | UART_CR_RXEN | UART_CR_TXEN | UART_CR_RXEN,
 
 
 IMHO there are too many 'UART_CR_TXEN' and 'UART_CR_RXEN' here.

Yes indeed, thanks.

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


Re: [PATCH 0/5] Zynq support for barebox

2013-03-03 Thread Steffen Trumtrar
Hi!

On Sat, Mar 02, 2013 at 07:20:12PM -0600, Josh Cartwright wrote:
 In San Francisco a couple weeks ago (ELC2013), Thomas Petazzoni
 informally mentioned barebox in passing, so I decided to toy with it a
 bit...
 
 This patchset adds basic support for the Zynq SoC to barebox.  So far,
 it's only been tested as a 'secondary' bootloader (after u-boot).  Also
 added is support for the zc702 development board.
 

I have some patches laying around, that have support for booting first stage
from a SD-Card on a ZedBoard. I didn't send them as of yet, because I'm not
completely satisfied with them in one or two places. (The clocksource seems to
be inverse to what barebox expects, which would be a quick fix, and barebox 
boots
uuultra slow, if I do everything according to the TRM)
At the moment, I do not have access to the board though. But I hope I can get a
hand on it in the next days.
What I do not have atm is the clkdev stuff, that you already have.

Regards,
Steffen

 The first two patches are simple typos I found getting acclimated to the
 barebox source.
 
 Josh Cartwright (5):
   trivial: doc: fix typos in mach-arm.dox
   defaultenv: fixed mismatched braces in bin/boot
   ARM: zynq: add driver for Zynq uarts
   ARM: zynq: add support for Zynq 7000 SoC
   ARM: zynq: add support for zc702 development board
 
  arch/arm/Kconfig   |   9 +
  arch/arm/Makefile  |   2 +
  arch/arm/boards/zynq-zc702/Makefile|   1 +
  arch/arm/boards/zynq-zc702/config.h|   0
  arch/arm/boards/zynq-zc702/devices.c   |  70 ++
  arch/arm/boards/zynq-zc702/lowlevel.c  |  28 +++
  arch/arm/mach-arm.dox  |   4 +-
  arch/arm/mach-zynq/Kconfig |  22 ++
  arch/arm/mach-zynq/Makefile|   1 +
  arch/arm/mach-zynq/clocks.c| 341 
 +
  arch/arm/mach-zynq/include/mach/clkdev.h   |   7 +
  arch/arm/mach-zynq/include/mach/debug_ll.h |  21 ++
  arch/arm/mach-zynq/include/mach/slcr.h |  26 +++
  arch/arm/mach-zynq/reset.c |  28 +++
  defaultenv/bin/boot|   2 +-
  drivers/serial/Kconfig |   6 +
  drivers/serial/Makefile|   1 +
  drivers/serial/serial_zynq.c   | 144 
  18 files changed, 710 insertions(+), 3 deletions(-)
  create mode 100644 arch/arm/boards/zynq-zc702/Makefile
  create mode 100644 arch/arm/boards/zynq-zc702/config.h
  create mode 100644 arch/arm/boards/zynq-zc702/devices.c
  create mode 100644 arch/arm/boards/zynq-zc702/lowlevel.c
  create mode 100644 arch/arm/mach-zynq/Kconfig
  create mode 100644 arch/arm/mach-zynq/Makefile
  create mode 100644 arch/arm/mach-zynq/clocks.c
  create mode 100644 arch/arm/mach-zynq/include/mach/clkdev.h
  create mode 100644 arch/arm/mach-zynq/include/mach/debug_ll.h
  create mode 100644 arch/arm/mach-zynq/include/mach/slcr.h
  create mode 100644 arch/arm/mach-zynq/reset.c
  create mode 100644 drivers/serial/serial_zynq.c
 
 -- 
 1.8.1.2
 
 
 ___
 barebox mailing list
 barebox@lists.infradead.org
 http://lists.infradead.org/mailman/listinfo/barebox
 

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

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


Re: [PATCH v2 0/2] add mxs application uart driver

2013-03-03 Thread Sascha Hauer
On Thu, Feb 28, 2013 at 05:22:08PM +0100, Marc Kleine-Budde wrote:
 Hello,
 
 this series adds support for the mxs application uart driver. Lifted from 
 TQS's
 u-boot patches.
 
 regards,
 Marc
 
 changes since v1:
 - fix comments (auart_serial_getc(), auart_serial_setbaudrate())
 - use auart_serial_setbaudrate
 
 Both suggested by Sascha.

Applied, thanks

Sascha

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

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


Re: [PATCH 1/1] of: add do_fixup_by_compatible with u32 and string version

2013-03-03 Thread Sascha Hauer
On Mon, Feb 18, 2013 at 06:44:33PM +0100, Jean-Christophe PLAGNIOL-VILLARD 
wrote:
 On 09:59 Mon 18 Feb , Sascha Hauer wrote:
  On Sat, Feb 16, 2013 at 07:18:39PM +0100, Jean-Christophe PLAGNIOL-VILLARD 
  wrote:
   Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com
   ---
common/oftree.c |   27 +++
include/of.h|6 ++
2 files changed, 33 insertions(+)
   
   diff --git a/common/oftree.c b/common/oftree.c
   index 6b20cdb..82e5ddd 100644
   --- a/common/oftree.c
   +++ b/common/oftree.c
   @@ -229,6 +229,33 @@ void do_fixup_by_path_u32(struct fdt_header *fdt, 
   const char *path,
 do_fixup_by_path(fdt, path, prop, val, sizeof(val), create);
}

   +void do_fixup_by_compatible(struct fdt_header *fdt, const char 
   *compatible,
   + const char *prop, const void *val, int len, int create)
   +{
   + int off = -1;
   +
   + off = fdt_node_offset_by_compatible(fdt, -1, compatible);
   + while (off != -FDT_ERR_NOTFOUND) {
   + if (create || (fdt_get_property(fdt, off, prop, 0) != NULL))
   + fdt_setprop(fdt, off, prop, val, len);
   + off = fdt_node_offset_by_compatible(fdt, off, compatible);
   + }
   +}
  
  IMO we shouldn't increase the dependency on libfdt. The fdt format is a
  nice storage format, but it sucks for modifying the tree.
  I created some patches to get rid of libfdt entirely yesterday. They are
  not complete yet, but removing libfdt has some nice effects:
  
  - Smaller binaries
  - No more parallel universes of fdt and internal trees. This currently 
  makes the
devicetree code messy
  - I trimmed down the overhead of unflattening/flattening significantly.
It still adds some overhead to do it, but manipulating the tree is a
factor of 50 faster which means once you have multiple manipulations
of the tree it reduces the overhead to a net win.
 ok will this be availlable for next release ok ohterwise can we have this
 patch first so we can have the fixuo support for highbank

I applied this one and the highbank patches using it. I have to rework
My devicetree series anyway, so it will be too late to merge this to
-next before the march release.

Sascha

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

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