diff options
author | Frank Li <Frank.Li@freescale.com> | 2010-05-24 17:27:34 +0800 |
---|---|---|
committer | Frank Li <Frank.Li@freescale.com> | 2010-05-24 17:28:27 +0800 |
commit | 3c63e4d425cf3ca7cb33354fdf122795c819ba8d (patch) | |
tree | 1213ed1b8b30dee08edf1403b37d770743011753 | |
parent | 71d6a65d50ffd598508eb4492d3e12950f0460e6 (diff) |
ENGR00123744-2 iMX23 enable unique id support
Add opt uuid support
Signed-off-by: Frank Li <Frank.Li@freescale.com>
-rw-r--r-- | arch/arm/mach-mx23/Kconfig | 10 | ||||
-rw-r--r-- | arch/arm/mach-mx23/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-mx23/otp.c | 11 | ||||
-rw-r--r-- | arch/arm/plat-mxs/Makefile | 2 |
4 files changed, 20 insertions, 4 deletions
diff --git a/arch/arm/mach-mx23/Kconfig b/arch/arm/mach-mx23/Kconfig index 452b62ff8147..28009b0d62cb 100644 --- a/arch/arm/mach-mx23/Kconfig +++ b/arch/arm/mach-mx23/Kconfig @@ -8,6 +8,16 @@ config MACH_MX23EVK endchoice + +config MXS_UNIQUE_ID + bool "Support for UniqueID on boot media" + default y + +config MXS_UNIQUE_ID_OTP + bool "UniqueID on OTP" + depends on MXS_UNIQUE_ID + default y + config VECTORS_PHY_ADDR int "vectors address" default 0 diff --git a/arch/arm/mach-mx23/Makefile b/arch/arm/mach-mx23/Makefile index 622981c9572d..a5e278190326 100644 --- a/arch/arm/mach-mx23/Makefile +++ b/arch/arm/mach-mx23/Makefile @@ -7,6 +7,7 @@ obj-y += pinctrl.o clock.o device.o serial.o power.o pm.o sleep.o bus_freq.o obj-$(CONFIG_MACH_MX23EVK) += mx23evk.o mx23evk_pins.o obj-$(CONFIG_GENERIC_GPIO) += gpio.o obj-$(CONFIG_MXS_RAM_FREQ_SCALING) +=emi.o +obj-$(CONFIG_MXS_UNIQUE_ID_OTP) += otp.o # USB support ifneq ($(strip $(CONFIG_USB_GADGET_ARC) $(CONFIG_USB_EHCI_ARC_OTG)),) diff --git a/arch/arm/mach-mx23/otp.c b/arch/arm/mach-mx23/otp.c index e9ae4a7d8858..7bec45f3754c 100644 --- a/arch/arm/mach-mx23/otp.c +++ b/arch/arm/mach-mx23/otp.c @@ -25,11 +25,12 @@ #include <linux/mutex.h> #include <linux/clk.h> #include <linux/err.h> +#include <linux/io.h> #include <mach/unique-id.h> #include <mach/regs-ocotp.h> #include <mach/regs-power.h> -#include <mach/platform.h> +#include <mach/mx23.h> static DEFINE_MUTEX(otp_mutex); static unsigned otp_mode; @@ -40,6 +41,8 @@ static int otp_full; /* = 0. By default, show/set only customer bits */ #define OTP_USER_OFFSET 0 #define OTP_USER_SIZE 4 +#define REGS_OCOTP_BASE (IO_ADDRESS(OCOTP_PHYS_ADDR)) +#define BF(value, field) (((value) << BP_##field) & BM_##field) /** * otp_wait_busy - wait for completion of operation * @@ -91,7 +94,7 @@ static int otp_open(int mode) } /* 2. Set RD_BANK_OPEN */ - stmp3xxx_setl(BM_OCOTP_CTRL_RD_BANK_OPEN, REGS_OCOTP_BASE + HW_OCOTP_CTRL); + __raw_writel(BM_OCOTP_CTRL_RD_BANK_OPEN, REGS_OCOTP_BASE + HW_OCOTP_CTRL_SET); udelay(10); otp_wait_busy(0); @@ -163,7 +166,7 @@ static void otp_close(void) if (otp_mode == O_RDONLY) { /* 5. clear RD_BANK_OPEN */ - stmp3xxx_clearl(BM_OCOTP_CTRL_RD_BANK_OPEN, REGS_OCOTP_BASE + HW_OCOTP_CTRL); + __raw_writel(BM_OCOTP_CTRL_RD_BANK_OPEN, REGS_OCOTP_BASE + HW_OCOTP_CTRL_CLR); } else if (otp_mode == O_WRONLY) { @@ -171,7 +174,7 @@ static void otp_close(void) clk_set_rate(hclk, otp_hclk_saved); __raw_writel(otp_voltage_saved, REGS_POWER_BASE + HW_POWER_VDDIOCTRL); otp_wait_busy(0); - stmp3xxx_setl(BM_OCOTP_CTRL_RELOAD_SHADOWS, REGS_OCOTP_BASE + HW_OCOTP_CTRL); + __raw_writel(BM_OCOTP_CTRL_RELOAD_SHADOWS, REGS_OCOTP_BASE + HW_OCOTP_CTRL_SET); otp_wait_busy(BM_OCOTP_CTRL_RELOAD_SHADOWS); } diff --git a/arch/arm/plat-mxs/Makefile b/arch/arm/plat-mxs/Makefile index 2c271285bdfd..e252630479d9 100644 --- a/arch/arm/plat-mxs/Makefile +++ b/arch/arm/plat-mxs/Makefile @@ -8,6 +8,8 @@ obj-$(CONFIG_MXS_TIMER_WITH_MACH) += timer-match.o obj-$(CONFIG_IRAM_ALLOC) += iram.o obj-$(CONFIG_GENERIC_GPIO) += gpio.o +obj-$(CONFIG_MXS_UNIQUE_ID) += unique-id.o + obj-$(CONFIG_MXS_ICOLL) += icoll.o obj-$(CONFIG_MXS_DMA_ENGINE) += dmaengine.o dma-apbh.o dma-apbx.o |