mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: "Fricke, Silvio" <SFricke@data-modul.com>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: Re: [PATCH] ARM i.MX6: set imx6 silicon revision
Date: Wed, 15 May 2013 08:51:19 +0200	[thread overview]
Message-ID: <20130515065119.GD32299@pengutronix.de> (raw)
In-Reply-To: <CB1254936A837D40B8C8611AEC83D6910686D1BD@MS-DM-M01.DATA-MODUL.com>

Hi Silvio,

On Tue, May 14, 2013 at 05:52:01PM +0000, Fricke, Silvio wrote:
>  static int imx6_init(void)
>  {
> +       u32 rev;
> +       u32 mx6_silicon_revision;
> +
>         imx6_boot_save_loc((void *)MX6_SRC_BASE_ADDR);
> 
>         add_generic_device("imx-iomuxv3", 0, NULL, MX6_IOMUXC_BASE_ADDR, 0x1000, IORESOURCE_MEM, NULL);
> @@ -70,6 +76,26 @@ static int imx6_init(void)
>         add_generic_device("imx21-wdt", 0, NULL, MX6_WDOG1_BASE_ADDR, 0x4000, IORESOURCE_MEM, NULL);
>         add_generic_device("imx6-usb-misc", 0, NULL, MX6_USBOH3_USB_BASE_ADDR + 0x800, 0x100, IORESOURCE_MEM, NULL);
> 
> +       rev = readl(MX6_ANATOP_BASE_ADDR + SI_REV);
> +       switch (rev & 0xff) {
> +       case 0x00:
> +               mx6_silicon_revision = IMX_CHIP_REV_1_0;
> +               break;
> +
> +       case 0x01:
> +               mx6_silicon_revision = IMX_CHIP_REV_1_1;
> +               break;
> +
> +       case 0x02:
> +               mx6_silicon_revision = IMX_CHIP_REV_1_2;
> +               break;
> +
> +       default:
> +               mx6_silicon_revision = IMX_CHIP_REV_UNKNOWN;
> +       }
> +
> +       imx_set_silicon_revision("i.MX6", mx6_silicon_revision);

You should call imx_set_silicon_revision before registering all the
devices. That way the drivers could use this information should they
ever have to.

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-5555 |

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

      reply	other threads:[~2013-05-15  6:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-14 17:52 Fricke, Silvio
2013-05-15  6:51 ` Sascha Hauer [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=20130515065119.GD32299@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=SFricke@data-modul.com \
    --cc=barebox@lists.infradead.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