public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Patrick Wildt <patrick@blueri.se>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] imx: add Boundary Devices Nitrogen8M board support
Date: Thu, 3 Oct 2019 15:39:15 +0200	[thread overview]
Message-ID: <20191003133915.GA50422@nox.fritz.box> (raw)
In-Reply-To: <CAOMZO5AK8sy+gf0xnKiHQU79fzmFAyhWy+2P0c2HB0EZANeMug@mail.gmail.com>

On Thu, Oct 03, 2019 at 10:27:12AM -0300, Fabio Estevam wrote:
> Hi Patrick,
> 
> [Adding Troy, NXP U-Boot folks and Stefano]
> 
> Thanks for your contribution.

Thanks for looking at it!

> On Tue, Oct 1, 2019 at 4:15 PM Patrick Wildt <patrick@blueri.se> wrote:
> >
> > This adds basic support for the Nitrogen8M board.  It's based on
> > the NXP i.MX8MQ and provides 2GB of memory.  This code has been
> > based on the i.MX8M EVK board support, and Boundary Devices' git
> > repository.  So far the eMMC and onboard Ethernet can be used to
> > boot, with more device support yet to be implemented.  Please
> > note that this only supports the 2G version, with 1 rank bit,
> > which is Boundary Devices' "nitrogen8m" defconfig as well.
> >
> > Signed-off-by: Patrick Wildt <patrick@blueri.se>
> >
> 
> > +/ {
> > +       model = "Boundary Devices i.MX8MQ Nitrogen8M";
> > +       compatible = "boundary,imx8mq-nitrogen8m", "fsl,imx8mq";
> > +
> > +       chosen {
> > +               bootargs = "console=ttymxc0,115200 earlycon=ec_imx6q,0x30860000,115200";
> > +       };
> 
> This earlycon part should be removed.

Sure, ok.

> > +               /* P1 400mts 1D */
> > +               .drate = 400,
> > +               .fw_type = FW_1D_IMAGE,
> > +               .fsp_cfg = lpddr4_fsp1_cfg,
> > +               .fsp_cfg_num = ARRAY_SIZE(lpddr4_fsp1_cfg),
> > +       },
> > +#if 0
> 
> No if 0 please.

That was taken from Boundary Devices directly, I'll get rid of it.

> > +static int setup_fec(void)
> > +{
> > +       struct iomuxc_gpr_base_regs *gpr =
> > +               (struct iomuxc_gpr_base_regs *)IOMUXC_GPR_BASE_ADDR;
> > +
> > +       /* Pull PHY into reset */
> > +       gpio_request(IMX_GPIO_NR(1, 9), "fec1_rst");
> > +       gpio_direction_output(IMX_GPIO_NR(1, 9), 0);
> > +
> > +       /* Set bootstrap pins for AR8035 */
> > +       gpio_request(IMX_GPIO_NR(1, 26), "fec1_rd0");
> > +       gpio_direction_output(IMX_GPIO_NR(1, 26), 0);
> > +       gpio_request(IMX_GPIO_NR(1, 27), "fec1_rd1");
> > +       gpio_direction_output(IMX_GPIO_NR(1, 27), 0);
> > +       gpio_request(IMX_GPIO_NR(1, 28), "fec1_rd2");
> > +       gpio_direction_output(IMX_GPIO_NR(1, 28), 0);
> > +       gpio_request(IMX_GPIO_NR(1, 29), "fec1_rd3");
> > +       gpio_direction_output(IMX_GPIO_NR(1, 29), 1);
> > +       gpio_request(IMX_GPIO_NR(1, 24), "fec1_rx_ctl");
> > +       gpio_direction_output(IMX_GPIO_NR(1, 24), 0);
> > +       gpio_request(IMX_GPIO_NR(1, 25), "fec1_rxc");
> > +       gpio_direction_output(IMX_GPIO_NR(1, 25), 1);
> > +       imx_iomux_v3_setup_multiple_pads(fec1_strap_pads,
> > +                                        ARRAY_SIZE(fec1_strap_pads));
> 
> There is DM support from the FEC, so no need to have all this board code.

I should have added a better comment for this whole block I think,
sorry.  This does not bootrstrap the FEC, but it bootstrap the Phy.
The thing is that Boundary Devices configures the Phy by pulling the
Ethernet TX/RX pins to specific modes.  When the Phy is pulled from
reset, it will sample those pins and configure itself based on the
information.  I don't think the FEC driver takes care of it, and I
highly doubt it is supposed to take care of it.

> > +
> > +       /*
> > +        * 9e (1e = 30) default .9 V
> > +        * 0.6V to 1.23V in 10 MV steps
> 
> These commands look too cryptic.

I agree.  This code is taken from Boundary devices.  I will try to
find the datasheet for the controller and come up with something
nicer.

> > +        */
> > +
> > +       /* Enable I2C1A, ARM/DRAM */
> > +       i2c_write(I2C_MUX_ADDR, 1, 1, NULL, 0);
> > +       /*
> > +        * .6 + .40 = 1.00
> > +        */
> > +       val8 = 0x80 + 40;
> 
> Please add defines for these values.

Thanks!
Patrick

  reply	other threads:[~2019-10-03 13:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-01 19:14 [U-Boot] [PATCH] imx: add Boundary Devices Nitrogen8M board support Patrick Wildt
2019-10-03 13:27 ` Fabio Estevam
2019-10-03 13:39   ` Patrick Wildt [this message]
2019-10-03 19:51   ` [U-Boot] [PATCH v2] " Patrick Wildt
2019-10-03 20:33     ` Fabio Estevam

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=20191003133915.GA50422@nox.fritz.box \
    --to=patrick@blueri.se \
    --cc=u-boot@lists.denx.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