From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Mon, 09 Jan 2012 16:24:40 -0700 Subject: [U-Boot] [PATCH 05/14] tegra: Add tegra_get_chip_type() to detect SKU In-Reply-To: <1324927987-13100-6-git-send-email-sjg@chromium.org> References: <1324927987-13100-1-git-send-email-sjg@chromium.org> <1324927987-13100-6-git-send-email-sjg@chromium.org> Message-ID: <4F0B7738.70008@nvidia.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 12/26/2011 12:32 PM, Simon Glass wrote: > We want to know which type of chip we are running on - the Tegra > family has several SKUs. This can be determined by reading a > fuse register, so add this function to ap20. ... > diff --git a/arch/arm/cpu/armv7/tegra2/ap20.c b/arch/arm/cpu/armv7/tegra2/ap20.c ... > +int tegra_get_chip_type(void) > +{ > + struct fuse_regs *fuse = (struct fuse_regs *)TEGRA2_FUSE_BASE; > + uint tegra_sku_id; > + > + tegra_sku_id = readl(&fuse->sku_info) & 0xff; > + > + switch (tegra_sku_id) { I think this should read/validate/switch-on the SoC ID field too; I assume the SKU IDs can only be interpreted relative to some specific SoC ID. Chip ID is bits 15:8 of the register APB_MISC + 0x804, and has value 0x20 for Tegra20, 0x30 for Tegra30. -- nvpublic