mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: "Uwe Kleine-König" <uwe@kleine-koenig.org>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Subject: Re: [PATCH] ARM: imx: add support for Udoo Neo full
Date: Fri, 30 Jun 2017 12:46:27 -0700	[thread overview]
Message-ID: <CAHQ1cqEyQDYuAabcsifWfW5FD=6PGADzhW2NGt_YfnxTr33dXA@mail.gmail.com> (raw)
In-Reply-To: <20170627190317.19253-1-uwe@kleine-koenig.org>

On Tue, Jun 27, 2017 at 12:03 PM, Uwe Kleine-König
<uwe@kleine-koenig.org> wrote:
> From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> Hello,
>
> note that this patch only makes the machine work if you don't choose
> CONSOLE_ACTIVATE_NONE or apply these patches:
>
>         of_device_is_stdout_path: simplify
>         of_device_is_stdout_path: split off options and support aliases
>
> that currently sit in next as 0e193b668479 and 23522645b3b3. That's
> because the (upstream) dts has:
>
>         stdout-path = "serial0:115200n8";
>
> in /chosen that of_device_is_stdout_path doesn't understand without
> these.
>
> Best regards
> Uwe
>
>  arch/arm/boards/Makefile                           |   1 +
>  arch/arm/boards/udoo-neo/Makefile                  |   2 +
>  arch/arm/boards/udoo-neo/board.c                   |  27 +++++
>  .../flash-header-mx6sx-udoo-neo_full.imxcfg        | 124 +++++++++++++++++++++
>  arch/arm/boards/udoo-neo/lowlevel.c                |  39 +++++++
>  arch/arm/dts/Makefile                              |   1 +
>  arch/arm/dts/imx6sx-udoo-neo-full.dts              |   4 +
>  arch/arm/mach-imx/Kconfig                          |   4 +
>  arch/arm/mach-imx/include/mach/esdctl.h            |   1 +
>  images/Makefile.imx                                |   5 +
>  10 files changed, 208 insertions(+)
>  create mode 100644 arch/arm/boards/udoo-neo/Makefile
>  create mode 100644 arch/arm/boards/udoo-neo/board.c
>  create mode 100644 arch/arm/boards/udoo-neo/flash-header-mx6sx-udoo-neo_full.imxcfg
>  create mode 100644 arch/arm/boards/udoo-neo/lowlevel.c
>  create mode 100644 arch/arm/dts/imx6sx-udoo-neo-full.dts
>
> diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
> index 0ecfb3e4b398..98f923a134a0 100644
> --- a/arch/arm/boards/Makefile
> +++ b/arch/arm/boards/Makefile
> @@ -130,6 +130,7 @@ obj-$(CONFIG_MACH_TX51)                             += karo-tx51/
>  obj-$(CONFIG_MACH_TX53)                                += karo-tx53/
>  obj-$(CONFIG_MACH_TX6X)                                += karo-tx6x/
>  obj-$(CONFIG_MACH_UDOO)                                += udoo/
> +obj-$(CONFIG_MACH_UDOO_NEO)                    += udoo-neo/
>  obj-$(CONFIG_MACH_USB_A9260)                   += usb-a926x/
>  obj-$(CONFIG_MACH_USB_A9263)                   += usb-a926x/
>  obj-$(CONFIG_MACH_USB_A9G20)                   += usb-a926x/
> diff --git a/arch/arm/boards/udoo-neo/Makefile b/arch/arm/boards/udoo-neo/Makefile
> new file mode 100644
> index 000000000000..01c7a259e9a5
> --- /dev/null
> +++ b/arch/arm/boards/udoo-neo/Makefile
> @@ -0,0 +1,2 @@
> +obj-y += board.o
> +lwl-y += lowlevel.o
> diff --git a/arch/arm/boards/udoo-neo/board.c b/arch/arm/boards/udoo-neo/board.c
> new file mode 100644
> index 000000000000..9bf480305d70
> --- /dev/null
> +++ b/arch/arm/boards/udoo-neo/board.c
> @@ -0,0 +1,27 @@
> +/*
> + * Copyright (C) 2014 Pengutronix, Sascha Hauer
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * version 2, as published by the Free Software Foundation.
> + *
> + * 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.
> + */
> +
> +#include <common.h>
> +#include <init.h>
> +#include <linux/clk.h>
> +
> +static int imx6sx_udoneo_coredevices_init(void)
> +{
> +       if (!of_machine_is_compatible("fsl,imx6sx-udoo-neo"))
> +               return 0;
> +
> +       barebox_set_hostname("mx6sx-udooneo");
> +
> +       return 0;
> +}
> +coredevice_initcall(imx6sx_udoneo_coredevices_init);
> diff --git a/arch/arm/boards/udoo-neo/flash-header-mx6sx-udoo-neo_full.imxcfg b/arch/arm/boards/udoo-neo/flash-header-mx6sx-udoo-neo_full.imxcfg
> new file mode 100644
> index 000000000000..176aff49b3ec
> --- /dev/null
> +++ b/arch/arm/boards/udoo-neo/flash-header-mx6sx-udoo-neo_full.imxcfg
> @@ -0,0 +1,124 @@
> +loadaddr 0x80000000
> +soc imx6
> +dcdofs 0x400
> +
> +/* Enable all clocks */
> +wm 32 0x020c4068 0xffffffff
> +wm 32 0x020c406c 0xffffffff
> +wm 32 0x020c4070 0xffffffff
> +wm 32 0x020c4074 0xffffffff
> +wm 32 0x020c4078 0xffffffff
> +wm 32 0x020c407c 0xffffffff
> +wm 32 0x020c4080 0xffffffff
> +wm 32 0x020c4084 0xffffffff
> +/********************************************/
> +
> +/* IOMUX */
> +/* DDR IO TYPE */
> +wm 32 0x020e0618 0x000c0000
> +wm 32 0x020e05fc 0x00000000
> +/********************************************/
> +
> +/* CLOCK */
> +wm 32 0x020e032c 0x00000030
> +/********************************************/
> +
> +/* ADDRESS */
> +wm 32 0x020e0300 0x00000020
> +wm 32 0x020e02fc 0x00000020
> +wm 32 0x020e05f4 0x00000020
> +/********************************************/
> +
> +/* CONTROL */
> +wm 32 0x020e0340 0x00000020
> +
> +wm 32 0x020e0320 0x00000000
> +wm 32 0x020e0310 0x00000020
> +wm 32 0x020e0314 0x00000020
> +wm 32 0x020e0614 0x00000020
> +/********************************************/
> +
> +/* DATA STROBE */
> +wm 32 0x020e05f8 0x00020000
> +wm 32 0x020e0330 0x00000028
> +wm 32 0x020e0334 0x00000028
> +wm 32 0x020e0338 0x00000028
> +wm 32 0x020e033c 0x00000028
> +/********************************************/
> +
> +/* DATA */
> +wm 32 0x020e0608 0x00020000
> +wm 32 0x020e060c 0x00000028
> +wm 32 0x020e0610 0x00000028
> +wm 32 0x020e061c 0x00000028
> +wm 32 0x020e0620 0x00000028
> +wm 32 0x020e02ec 0x00000028
> +wm 32 0x020e02f0 0x00000028
> +wm 32 0x020e02f4 0x00000028
> +wm 32 0x020e02f8 0x00000028
> +/********************************************/
> +
> +/* Calibrations */
> +/* ZQ */
> +wm 32 0x021b0800 0xa1390003
> +/********************************************/
> +
> +/* write leveling */
> +wm 32 0x021b080c 0x001E0022
> +wm 32 0x021b0810 0x001C0019
> +/********************************************/
> +
> +/* DQS Read Gate */
> +wm 32 0x021b083c 0x41540150
> +wm 32 0x021b0840 0x01440138
> +/********************************************/
> +
> +/* Read/Write Delay */
> +wm 32 0x021b0848 0x403E4644
> +wm 32 0x021b0850 0x3C3A4038
> +/********************************************/
> +
> +/* read data bit delay */
> +wm 32 0x021b081c 0x33333333
> +wm 32 0x021b0820 0x33333333
> +wm 32 0x021b0824 0x33333333
> +wm 32 0x021b0828 0x33333333
> +/********************************************/
> +
> +/* Complete calibration by forced measurment */
> +wm 32 0x021b08b8 0x00000800
> +/********************************************/
> +
> +/* MMDC init */
> +/* in DDR3, 64-bit mode, only MMDC0 is initiated */
> +wm 32 0x021b0004 0x0002002d
> +wm 32 0x021b0008 0x00333030
> +wm 32 0x021b000c 0x676b52f3
> +wm 32 0x021b0010 0xb66d8b63
> +wm 32 0x021b0014 0x01ff00db
> +wm 32 0x021b0018 0x00011740
> +wm 32 0x021b001c 0x00008000
> +wm 32 0x021b002c 0x000026d2
> +wm 32 0x021b0030 0x006b1023
> +wm 32 0x021b0040 0x0000005f
> +wm 32 0x021b0000 0x83190000
> +/********************************************/
> +
> +/* Initialize MT41K256M16HA-125 */
> +/* MR2 */
> +wm 32 0x021b001c 0x04008032
> +/* MR3 */
> +wm 32 0x021b001c 0x00008033
> +/* MR1 */
> +wm 32 0x021b001c 0x00048031
> +/* MR0 */
> +wm 32 0x021b001c 0x05208030
> +/* DDR device ZQ calibration */
> +wm 32 0x021b001c 0x04008040
> +/********************************************/
> +
> +/* final DDR setup, before operation start */
> +wm 32 0x021b0020 0x00000800
> +wm 32 0x021b0818 0x00011117
> +wm 32 0x021b001c 0x00000000
> +/********************************************/
> diff --git a/arch/arm/boards/udoo-neo/lowlevel.c b/arch/arm/boards/udoo-neo/lowlevel.c
> new file mode 100644
> index 000000000000..e78c2685fd78
> --- /dev/null
> +++ b/arch/arm/boards/udoo-neo/lowlevel.c
> @@ -0,0 +1,39 @@
> +#include <debug_ll.h>
> +#include <common.h>
> +#include <linux/sizes.h>
> +#include <mach/generic.h>
> +#include <asm/barebox-arm-head.h>
> +#include <asm/barebox-arm.h>
> +#include <mach/esdctl.h>
> +
> +static inline void setup_uart(void)
> +{
> +       void __iomem *iomuxbase = (void *)MX6_IOMUXC_BASE_ADDR;
> +
> +       imx6_ungate_all_peripherals();
> +
> +       writel(0x0, iomuxbase + 0x24);
> +       writel(0x1b0b1, iomuxbase + 0x036C);
> +       writel(0x0, iomuxbase + 0x28);
> +       writel(0x1b0b1, iomuxbase + 0x0370);

You can use "imx_setup_pad()" from <mach/iomux-v3.h> and avoid having
to use those magic numbers. See
arch/arm/boards/freescale-mx6-sabresd/lowlevel.c for example.

Thanks,
Andrey Smirnov

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

      parent reply	other threads:[~2017-06-30 19:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-27 19:03 Uwe Kleine-König
2017-06-27 19:40 ` Stefan Lengfeld
2017-06-28  8:16   ` Uwe Kleine-König
2017-06-30  6:35   ` Sascha Hauer
2017-06-30  9:06     ` Uwe Kleine-König
2017-06-30  9:28       ` Sascha Hauer
2017-06-30 19:46 ` Andrey Smirnov [this message]

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='CAHQ1cqEyQDYuAabcsifWfW5FD=6PGADzhW2NGt_YfnxTr33dXA@mail.gmail.com' \
    --to=andrew.smirnov@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=uwe@kleine-koenig.org \
    /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