From 679813af1de2458fa349b9773f0bfcbb93216fee Mon Sep 17 00:00:00 2001 From: nakasima Date: Thu, 27 Dec 2007 08:36:40 +0000 Subject: [PATCH] =?UTF-8?q?TwlSDK=E5=86=85=E3=81=AE=E9=8D=B5=E3=82=92?= =?UTF-8?q?=E4=BD=BF=E3=81=A3=E3=81=A6=E3=81=84=E3=82=8B=E6=99=82=E3=81=AF?= =?UTF-8?q?=E9=87=8F=E7=94=A3=E7=94=A8CPU=E3=81=A7=E3=81=AF=E3=83=96?= =?UTF-8?q?=E3=83=BC=E3=83=88=E7=A6=81=E6=AD=A2=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@415 b08762b0-b915-fc4b-9d8c-17b2551a87ff --- build/buildtools/commondefs | 5 +++++ build/libraries/os/common/os_boot.c | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/build/buildtools/commondefs b/build/buildtools/commondefs index e5c82932..98c45b61 100644 --- a/build/buildtools/commondefs +++ b/build/buildtools/commondefs @@ -18,6 +18,7 @@ ifndef TWL_IPL_COMMONDEFS_ TWL_IPL_COMMONDEFS_ = TRUE +FIRM_USE_TWLSDK_KEYS = TRUE ifeq ($(TARGET_FIRM),SYSTEMMENU) include $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs.sysmenu @@ -25,6 +26,10 @@ else include $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs.firm endif +ifdef FIRM_USE_TWLSDK_KEYS +MACRO_FLAGS += -DFIRM_USE_TWLSDK_KEYS=$(FIRM_USE_TWLSDK_KEYS) +endif + #---------------------------------------------------------------------------- endif # TWL_IPL_COMMONDEFS_ #----- End of commondefs ----- diff --git a/build/libraries/os/common/os_boot.c b/build/libraries/os/common/os_boot.c index e4b2195d..dc7f9911 100644 --- a/build/libraries/os/common/os_boot.c +++ b/build/libraries/os/common/os_boot.c @@ -76,6 +76,19 @@ void OS_BootWithRomHeaderFromFIRM( ROM_Header* rom_header ) // post clear mem_list[i++] = NULL; SDK_ASSERT(i <= sizeof(mem_list)/sizeof(mem_list[0])); + +#ifdef FIRM_USE_TWLSDK_KEYS + // TwlSDK内の鍵を使っている時は量産用CPUではブートしない +#ifdef SDK_ARM9 + if ( ! ((*(u8*)OS_CHIPTYPE_DEBUGGER_ADDR & OS_CHIPTYPE_DEBUGGER_MASK)) ) +#else // SDK_ARM7 + if ( ! ((*(u8*)HWi_WSYS08_ADDR & HWi_WSYS08_OP_OPT_MASK)) ) +#endif // SDK_ARM7 + { + OS_Terminate(); + } +#endif // FIRM_USE_SDK_KEYS + REBOOT_Execute(entry, wram_reg, mem_list, code_buf, stack_top, target, scfg, jtag); OS_Terminate(); }