{"id":810397,"url":"http://patchwork.ozlabs.org/api/patches/810397/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20170906052343.17989-12-wenyou.yang@microchip.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170906052343.17989-12-wenyou.yang@microchip.com>","list_archive_url":null,"date":"2017-09-06T05:23:42","name":"[U-Boot,v4,11/12] ARM: at91: Get the Chip ID of SAMA5D2 SiP","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"c943e8b5e795de049ec317fe490d002f54497b0e","submitter":{"id":69532,"url":"http://patchwork.ozlabs.org/api/people/69532/?format=json","name":"Wenyou Yang","email":"Wenyou.Yang@microchip.com"},"delegate":{"id":3651,"url":"http://patchwork.ozlabs.org/api/users/3651/?format=json","username":"trini","first_name":"Tom","last_name":"Rini","email":"trini@ti.com"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20170906052343.17989-12-wenyou.yang@microchip.com/mbox/","series":[{"id":1695,"url":"http://patchwork.ozlabs.org/api/series/1695/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=1695","date":"2017-09-06T05:23:31","name":"board: atmel: Add new board SAMA5D27-SOM1-EK board.","version":4,"mbox":"http://patchwork.ozlabs.org/series/1695/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/810397/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/810397/checks/","tags":{},"related":[],"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xnByX4fqMz9t2R\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  6 Sep 2017 15:31:16 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 26E9FC21E6E; Wed,  6 Sep 2017 05:27:45 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 5E36CC21E6E;\n\tWed,  6 Sep 2017 05:27:32 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 537A4C21DC5; Wed,  6 Sep 2017 05:26:03 +0000 (UTC)","from eusmtp01.atmel.com (eusmtp01.atmel.com [212.144.249.242])\n\tby lists.denx.de (Postfix) with ESMTPS id 85CADC21E01\n\tfor <u-boot@lists.denx.de>; Wed,  6 Sep 2017 05:26:00 +0000 (UTC)","from apsmtp01.atmel.com (10.168.254.31) by eusmtp01.atmel.com\n\t(10.145.145.30) with Microsoft SMTP Server id 14.3.235.1;\n\tWed, 6 Sep 2017 07:25:17 +0200","from shaarm01.corp.atmel.com (10.168.254.13) by apsmtp01.atmel.com\n\t(10.168.254.31) with Microsoft SMTP Server id 14.3.235.1;\n\tWed, 6 Sep 2017 13:29:37 +0800"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED\n\tautolearn=unavailable autolearn_force=no version=3.4.0","From":"Wenyou Yang <wenyou.yang@microchip.com>","To":"U-Boot Mailing List <u-boot@lists.denx.de>","Date":"Wed, 6 Sep 2017 13:23:42 +0800","Message-ID":"<20170906052343.17989-12-wenyou.yang@microchip.com>","X-Mailer":"git-send-email 2.13.0","In-Reply-To":"<20170906052343.17989-1-wenyou.yang@microchip.com>","References":"<20170906052343.17989-1-wenyou.yang@microchip.com>","MIME-Version":"1.0","Cc":"Marek Vasut <marex@denx.de>, Tom Rini <trini@konsulko.com>","Subject":"[U-Boot] [PATCH v4 11/12] ARM: at91: Get the Chip ID of SAMA5D2 SiP","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"},"content":"From: Wenyou Yang <wenyou.yang@atmel.com>\n\nThe SAMA5D2 SiP(System in Package) has different Chip IDs in the\nCHIPID and CHIP_EXID registers.\n\nSigned-off-by: Wenyou Yang <wenyou.yang@microchip.com>\nReviewed-by: Simon Glass <sjg@chromium.org>\n---\n\nChanges in v4: None\nChanges in v3: None\nChanges in v2: None\n\n arch/arm/mach-at91/armv7/sama5d2_devices.c | 26 ++++++++++++++++++++++++--\n arch/arm/mach-at91/include/mach/sama5d2.h  |  7 ++++++-\n 2 files changed, 30 insertions(+), 3 deletions(-)","diff":"diff --git a/arch/arm/mach-at91/armv7/sama5d2_devices.c b/arch/arm/mach-at91/armv7/sama5d2_devices.c\nindex 978eac29bd..de1d9b5bfb 100644\n--- a/arch/arm/mach-at91/armv7/sama5d2_devices.c\n+++ b/arch/arm/mach-at91/armv7/sama5d2_devices.c\n@@ -10,11 +10,20 @@\n #include <asm/arch/clk.h>\n #include <asm/arch/sama5d2.h>\n \n-char *get_cpu_name()\n+int cpu_is_sama5d2(void)\n {\n+\tunsigned int chip_id = get_chip_id();\n+\n+\treturn ((chip_id == ARCH_ID_SAMA5D2) ||\n+\t\t(chip_id == ARCH_ID_SAMA5D2_SIP)) ? 1 : 0;\n+}\n+\n+char *get_cpu_name(void)\n+{\n+\tunsigned int chip_id = get_chip_id();\n \tunsigned int extension_id = get_extension_chip_id();\n \n-\tif (cpu_is_sama5d2()) {\n+\tif (chip_id == ARCH_ID_SAMA5D2) {\n \t\tswitch (extension_id) {\n \t\tcase ARCH_EXID_SAMA5D21CU:\n \t\t\treturn \"SAMA5D21\";\n@@ -41,6 +50,19 @@ char *get_cpu_name()\n \t\t}\n \t}\n \n+\tif ((chip_id == ARCH_ID_SAMA5D2) || (chip_id == ARCH_ID_SAMA5D2_SIP)) {\n+\t\tswitch (extension_id) {\n+\t\tcase ARCH_EXID_SAMA5D225C_D1M:\n+\t\t\treturn \"SAMA5D225 128M bits DDR2 SDRAM\";\n+\t\tcase ARCH_EXID_SAMA5D27C_D5M:\n+\t\t\treturn \"SAMA5D27 512M bits DDR2 SDRAM\";\n+\t\tcase ARCH_EXID_SAMA5D27C_D1G:\n+\t\t\treturn \"SAMA5D27 1G bits DDR2 SDRAM\";\n+\t\tcase ARCH_EXID_SAMA5D28C_D1G:\n+\t\t\treturn \"SAMA5D28 1G bits DDR2 SDRAM\";\n+\t\t}\n+\t}\n+\n \treturn \"Unknown CPU type\";\n }\n \ndiff --git a/arch/arm/mach-at91/include/mach/sama5d2.h b/arch/arm/mach-at91/include/mach/sama5d2.h\nindex 25c85411e5..49283ed86b 100644\n--- a/arch/arm/mach-at91/include/mach/sama5d2.h\n+++ b/arch/arm/mach-at91/include/mach/sama5d2.h\n@@ -222,7 +222,11 @@\n #define ARCH_EXID_SAMA5D28CU\t0x00000010\n #define ARCH_EXID_SAMA5D28CN\t0x00000020\n \n-#define cpu_is_sama5d2()\t(get_chip_id() == ARCH_ID_SAMA5D2)\n+#define ARCH_ID_SAMA5D2_SIP\t\t0x8a5c08c2\n+#define ARCH_EXID_SAMA5D225C_D1M\t0x00000053\n+#define ARCH_EXID_SAMA5D27C_D5M\t\t0x00000032\n+#define ARCH_EXID_SAMA5D27C_D1G\t\t0x00000033\n+#define ARCH_EXID_SAMA5D28C_D1G\t\t0x00000013\n \n /* PIT Timer(PIT_PIIR) */\n #define CONFIG_SYS_TIMER_COUNTER\t0xf804803c\n@@ -233,6 +237,7 @@\n #ifndef __ASSEMBLY__\n unsigned int get_chip_id(void);\n unsigned int get_extension_chip_id(void);\n+int cpu_is_sama5d2(void);\n unsigned int has_lcdc(void);\n char *get_cpu_name(void);\n #endif\n","prefixes":["U-Boot","v4","11/12"]}