mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Trent Piepho <tpiepho@kymetacorp.com>
To: Tim Sander <tim@krieglstein.org>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>,
	Steffen Trumtrar <s.trumtrar@pengutronix.de>
Subject: Re: [PATCH v3] Terasic DE0-Nano-SoC: add support
Date: Mon, 1 Feb 2016 19:31:53 +0000	[thread overview]
Message-ID: <1454355135.18531.23.camel@rtred1test09.kymeta.local> (raw)
In-Reply-To: <1657046.j4o6hCTdX5@dabox>

On Mon, 2016-02-01 at 15:07 +0100, Tim Sander wrote:
> v3: forgot to amend my changes in v2.
> 
> +
> +static int socfpga_console_init(void)
> +{
> +       if (!of_machine_is_compatible("altr,socfpga-cyclone5"))
> +               return 0;

Seems like this should be a board specific check instead of a generic
one, since it's programming board specific phy timing values to a board
specific PHY.

> +
> +       if (IS_ENABLED(CONFIG_PHYLIB))
> +               phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK, phy_fixup);
> +
> +       return 0;
> +}

> +
> +static inline void ledon(int led)
> +{
> +       u32 val;
> +
> +       val = readl(0xFF709000);
> +       val |= 1 << (led + 24);
> +       writel(val, 0xFF709000);

There a macro CYCLONE5_GPIO1_BASE that could be used instead of
0xFF709000.

> +
> +       val = readl(0xFF709004);
> +       val |= 1 << (led + 24);
> +       writel(val, 0xFF709004);
> +}
> +
> +static inline void ledoff(int led)
> +{
> +       u32 val;
> +
> +       val = readl(0xFF709000);
> +       val &= ~(1 << (led + 24));
> +       writel(val, 0xFF709000);
> +
> +       val = readl(0xFF709004);
> +       val &= ~(1 << (led + 24));
> +       writel(val, 0xFF709004);
> +}


> +#include <arm/socfpga_cyclone5_de0_nano_soc.dts>
> +#include "socfpga.dtsi"
> +
> +/ {
> +       model = "Terasic DE0-Nano-SoC (Atlas)";
> +       compatible = "altr,socfpga-cyclone5", "altr,socfpga";

Wouldn't the right thing to do here be to have a compatible entry for
this board type?  Like the existing "terasic,sockit" or something more
specific.
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2016-02-01 19:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-01 11:23 [PATCH] Terasic DE0 NANO-SoC: " Tim Sander
2016-02-01 12:06 ` Steffen Trumtrar
2016-02-01 12:48   ` Antony Pavlov
2016-02-01 12:51     ` Tim Sander
2016-02-01 13:03       ` Steffen Trumtrar
2016-02-01 13:26         ` Tim Sander
2016-02-01 13:45           ` Steffen Trumtrar
2016-02-01 14:04             ` [PATCH v2] Terasic DE0-Nano-SoC: " Tim Sander
2016-02-01 14:07               ` [PATCH v3] " Tim Sander
2016-02-01 19:31                 ` Trent Piepho [this message]
2016-02-02 13:48                   ` Tim Sander
2016-02-02 14:15                     ` 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=1454355135.18531.23.camel@rtred1test09.kymeta.local \
    --to=tpiepho@kymetacorp.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.trumtrar@pengutronix.de \
    --cc=tim@krieglstein.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