mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Lars Pedersen <lapeddk@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: Getting serial console output on new imx7d tqma7 board UART4
Date: Tue, 4 Aug 2020 18:15:13 +0200	[thread overview]
Message-ID: <c726160f-1221-b26e-ccc1-0122f2ac7973@pengutronix.de> (raw)
In-Reply-To: <CAKd8=Gsyqhy-bzTdSQTfd8z6=JtkkhP1m00yoC=3uLRr4q1-xg@mail.gmail.com>

Hello Lars,

On 8/4/20 3:07 PM, Lars Pedersen wrote:
> I just go an MCIMX7SABRE board and it now trying to start barebox from
> the external SD card, which I guess should be possible right?
> 
> I have taken barebox 2020.07.0 and copied the imx_v7_defconfig and
> deselected all boards except the "NXP i.MX7 SabreSD board"
> 
> After compilation i copy the image using:
> 
> sudo dd if=barebox-freescale-mx7-sabresd.img of=/dev/sdb bs=1024 skip=1 seek=1
> sync> 
> But still no boot screen for that either. :/
> 
> Shouldn't this work out of the box??

Works for me.

imx_v7_defconfig
OSELAS.Toolchain-2019.09.1
Image written to SD card (offset 0) and booted from.

Can you try with same toolchain? If that works, it
might be a compiler issue? What are you using?

> 
> /Lars Pedersen
> 
> On Mon, 3 Aug 2020 at 12:10, Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
>>
>> Hi,
>>
>> On 7/29/20 6:52 PM, Lars Pedersen wrote:
>>> I have spent the last couple of days trying to port our bootloader
>>> from u-boot to barebox 2020.07 but have yet to get any console output.
>>> Our product is based on tqma7d i.MX7 dual core cpu and uses UART4 for
>>> serial console and boots from internal eMMC.
>>>
>>> I created a new board inspired from "NXP i.MX7 SabreSD board" and
>>> tried to only add the basic in the first step to get a console output
>>> working. The image is built using ptxdist and the imx_v7_defconfig
>>> where the new board is selected. The image is flashed with "dd
>>> if=barebox-image of=/dev/mmcblk0 bs=1024 skip=1 seek=1 conv=fsync".
>>> The device works using u-boot 2020.07 with the same device trees but
>>> we thought it was time to try out barebox since u-boot felt a little
>>> bloated :)
>>>
>>> So can anyone be of assistance and tell me what I'm missing?
>>
>> When I looked through your patch the first time, I just looked
>> for stuff that would cause it to not boot. Some more comments
>> inline that are unrelated to your boot problems.
>>
>>>
>>> /Lars Pedersen
>>>
>>> From: Lars Pedersen <laa@kamstrup.com>
>>> Date: Tue, 28 Jul 2020 08:57:57 +0000
>>> Subject: [PATCH] Add kamstrup imx7d dev board
>>>
>>> ---
>>>  arch/arm/boards/Makefile                           |   1 +
>>>  arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile     |   2 +
>>>  arch/arm/boards/kamstrup-imx7d-tqma7d/board.c      |  19 ++
>>>  .../flash-header-kamstrup-imx7d-tqma7d.imxcfg      |  79 ++++++
>>>  arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c   |  35 +++
>>>  arch/arm/dts/Makefile                              |   1 +
>>>  arch/arm/dts/imx7d-flex-concentrator-mfg.dts       |  11 +
>>>  arch/arm/mach-imx/Kconfig                          |   5 +
>>>  drivers/regulator/Kconfig                          |   2 +-
>>>  dts/src/arm/imx7d-flex-concentrator-mfg.dts        |  25 ++
>>>  dts/src/arm/imx7d-flex-concentrator.dts            | 313 +++++++++++++++++++++
>>>  images/Makefile.imx                                |   5 +
>>>  12 files changed, 497 insertions(+), 1 deletion(-)
>>>  create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
>>>  create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
>>>  create mode 100644
>>> arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
>>>  create mode 100644 arch/arm/boards/kamstrup-imx7d-tqma7d/lowlevel.c
>>>  create mode 100644 arch/arm/dts/imx7d-flex-concentrator-mfg.dts
>>>  create mode 100644 dts/src/arm/imx7d-flex-concentrator-mfg.dts
>>>  create mode 100644 dts/src/arm/imx7d-flex-concentrator.dts
>>>
>>> diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
>>> index e9e9163d589b..58bb4cf2adab 100644
>>> --- a/arch/arm/boards/Makefile
>>> +++ b/arch/arm/boards/Makefile
>>> @@ -64,6 +64,7 @@ obj-$(CONFIG_MACH_HIGHBANK)            += highbank/
>>>  obj-$(CONFIG_MACH_IMX21ADS)            += freescale-mx21-ads/
>>>  obj-$(CONFIG_MACH_IMX233_OLINUXINO)        += imx233-olinuxino/
>>>  obj-$(CONFIG_MACH_IMX27ADS)            += freescale-mx27-ads/
>>> +obj-$(CONFIG_MACH_KAMSTRUP_IMX7D_TQMA7D)    += kamstrup-imx7d-tqma7d/
>>>  obj-$(CONFIG_MACH_KINDLE3)            += kindle3/
>>>  obj-$(CONFIG_MACH_KONTRON_SAMX6I)        += kontron-samx6i/
>>>  obj-$(CONFIG_MACH_LENOVO_IX4_300D)        += lenovo-ix4-300d/
>>> diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
>>> b/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
>>> new file mode 100644
>>> index 000000000000..01c7a259e9a5
>>> --- /dev/null
>>> +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/Makefile
>>> @@ -0,0 +1,2 @@
>>> +obj-y += board.o
>>> +lwl-y += lowlevel.o
>>> diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
>>> b/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
>>> new file mode 100644
>>> index 000000000000..b3ffa851f3e6
>>> --- /dev/null
>>> +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/board.c
>>> @@ -0,0 +1,19 @@
>>> +// SPDX-License-Identifier: GPL-2.0-or-later
>>> +// SPDX-FileCopyrightText: 2020 Kamstrup A/S
>>> +
>>> +/* Author: Lars Pedersen <lapeddk@gmail.com> */
>>> +
>>> +#include <common.h>
>>> +#include <init.h>
>>> +#include <io.h>
>>> +#include <mach/imx7-regs.h>
>>> +#include <mfd/imx7-iomuxc-gpr.h>
>>> +
>>> +static int kamstrup_mx7_tqma7d_coredevices_init(void)
>>> +{
>>> +    if (!of_machine_is_compatible("kam,imx7d-flex-concentrator"))
>>> +        return 0;
>>> +
>>> +    return 0;
>>> +}
>>
>> Function serves no purpose. If you don't have baord code, drop it altogether.
>>
> 
> I'll do a cleanup when I have it working :D
> 
>>> +coredevice_initcall(kamstrup_mx7_tqma7d_coredevices_init);
>>> diff --git a/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
>>> b/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
>>> new file mode 100644
>>> index 000000000000..7656619c1b2e
>>> --- /dev/null
>>> +++ b/arch/arm/boards/kamstrup-imx7d-tqma7d/flash-header-kamstrup-imx7d-tqma7d.imxcfg
>>> @@ -0,0 +1,79 @@
>>> +soc imx7
>>> +loadaddr 0x80000000
>>> +dcdofs 0x400
>>
>> Called ivtofs now in barebox next branch now.
>>
> 
> Okay thanks.
> 
>>> diff --git a/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
>>> b/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
>>> new file mode 100644
>>> index 000000000000..746e36a70f4c
>>> --- /dev/null
>>> +++ b/arch/arm/dts/imx7d-flex-concentrator-mfg.dts
>>> @@ -0,0 +1,11 @@
>>> +/*
>>> + * The code contained herein is licensed under the GNU General Public
>>> + * License. You may obtain a copy of the GNU General Public License
>>> + * Version 2 or later at the following locations:
>>> + *
>>> + * http://www.opensource.org/licenses/gpl-license.html
>>> + * http://www.gnu.org/copyleft/gpl.html
>>> + */
>>> +
>>> +#include <arm/imx7d-flex-concentrator-mfg.dts>
>>> +
>>> diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
>>> index 6dd5cb2aca15..d0a9332c7a24 100644
>>> --- a/arch/arm/mach-imx/Kconfig
>>> +++ b/arch/arm/mach-imx/Kconfig
>>> @@ -492,6 +492,11 @@ config MACH_ZII_IMX7D_DEV
>>>      select ARCH_IMX7
>>>      select ARM_USE_COMPRESSED_DTB
>>>
>>> +config MACH_KAMSTRUP_IMX7D_TQMA7D
>>> +    bool "Kamstrup TQMa7D based devices"
>>> +    select ARCH_IMX7
>>> +    select ARM_USE_COMPRESSED_DTB
>>> +
>>>  config MACH_PHYTEC_PHYCORE_IMX7
>>>      bool "Phytec phyCORE i.MX7"
>>>      select ARCH_IMX7
>>> diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
>>> index 1ce057180a01..b0bdc48399e3 100644
>>> --- a/drivers/regulator/Kconfig
>>> +++ b/drivers/regulator/Kconfig
>>> @@ -19,7 +19,7 @@ config REGULATOR_BCM283X
>>>  config REGULATOR_PFUZE
>>>      bool "Freescale PFUZE100/200/3000 regulator driver"
>>>      depends on I2C
>>> -    depends on ARCH_IMX6 || ARCH_IMX8MQ
>>> +    depends on ARCH_IMX6 || ARCH_IMX7 || ARCH_IMX8MQ
>>>
>>>  config REGULATOR_STM32_PWR
>>>      bool "STMicroelectronics STM32 PWR"
>>> diff --git a/dts/src/arm/imx7d-flex-concentrator-mfg.dts
>>> b/dts/src/arm/imx7d-flex-concentrator-mfg.dts
>>> new file mode 100644
>>> index 000000000000..789f0837058f
>>> --- /dev/null
>>> +++ b/dts/src/arm/imx7d-flex-concentrator-mfg.dts
>>
>> Perfectly fine for your patch stack in BSP, but if you want to upstream
>> it, you need to either:
>>
>> 1) upstream your device tree to Linux. dts/ is a sync with Linux and
>>    shortly after, it will be imported into barebox
>> 2) put your device tree in arch/arm/dts
>>
> The dts will upstreamed soon. Hopefully :D
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

  reply	other threads:[~2020-08-04 16:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-29 16:52 Lars Pedersen
2020-07-29 17:22 ` Ahmad Fatoum
2020-07-30  6:58   ` Lars Pedersen
2020-07-30  7:25     ` Ahmad Fatoum
2020-07-30 10:16       ` Lars Pedersen
2020-07-30 13:55         ` Ahmad Fatoum
2020-08-03  7:56           ` Lars Pedersen
2020-08-03 21:51         ` Sascha Hauer
2020-08-04 12:53           ` Lars Pedersen
2020-08-03 10:10 ` Ahmad Fatoum
2020-08-04 13:07   ` Lars Pedersen
2020-08-04 16:15     ` Ahmad Fatoum [this message]
2020-08-04 19:21       ` Lars Pedersen
2020-08-05  8:49         ` Ahmad Fatoum
2020-08-05  9:37           ` Lars Pedersen
2020-08-05  9:48             ` Ahmad Fatoum
2020-08-05 11:12               ` Lars Pedersen
2020-08-05 12:30                 ` Ahmad Fatoum
2020-08-05 15:00                   ` Lars Pedersen
2020-08-10  8:00                     ` Sascha Hauer

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=c726160f-1221-b26e-ccc1-0122f2ac7973@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=lapeddk@gmail.com \
    /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