Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: tegra: add function to read chipid

Add function to read chip id from APB MISC registers. This function
will also get called from clock driver to flush write operations on
apb bus.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>

authored by

Prashant Gaikwad and committed by
Stephen Warren
c7736edf 24e30c94

+29 -1
+7 -1
arch/arm/mach-tegra/fuse.c
··· 20 20 #include <linux/kernel.h> 21 21 #include <linux/io.h> 22 22 #include <linux/export.h> 23 + #include <linux/tegra-soc.h> 23 24 24 25 #include "fuse.h" 25 26 #include "iomap.h" ··· 106 105 tegra_core_process_id = (reg >> 12) & 3; 107 106 } 108 107 108 + u32 tegra_read_chipid(void) 109 + { 110 + return readl_relaxed(IO_ADDRESS(TEGRA_APB_MISC_BASE) + 0x804); 111 + } 112 + 109 113 void tegra_init_fuse(void) 110 114 { 111 115 u32 id; ··· 125 119 reg = tegra_apb_readl(TEGRA_APB_MISC_BASE + STRAP_OPT); 126 120 tegra_bct_strapping = (reg & RAM_ID_MASK) >> RAM_CODE_SHIFT; 127 121 128 - id = readl_relaxed(IO_ADDRESS(TEGRA_APB_MISC_BASE) + 0x804); 122 + id = tegra_read_chipid(); 129 123 tegra_chip_id = (id >> 8) & 0xff; 130 124 131 125 switch (tegra_chip_id) {
+22
include/linux/tegra-soc.h
··· 1 + /* 2 + * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved. 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms and conditions of the GNU General Public License, 6 + * version 2, as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope it will be useful, but WITHOUT 9 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 11 + * more details. 12 + * 13 + * You should have received a copy of the GNU General Public License 14 + * along with this program. If not, see <http://www.gnu.org/licenses/>. 15 + */ 16 + 17 + #ifndef __LINUX_TEGRA_SOC_H_ 18 + #define __LINUX_TEGRA_SOC_H_ 19 + 20 + u32 tegra_read_chipid(void); 21 + 22 + #endif /* __LINUX_TEGRA_SOC_H_ */