[PATCH] ARM i.MX6: set imx6 silicon revision
Sascha Hauer
s.hauer at pengutronix.de
Wed May 15 02:51:19 EDT 2013
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 |
More information about the barebox
mailing list