Message ID | 20201008085941.3600-1-biju.das.jz@bp.renesas.com |
---|---|
State | Superseded |
Delegated to: | Marek Vasut |
Headers | show |
Series | [v5,1/2] arm: rmobile: Add RZ/G2[HMNE] SoC support | expand |
On 10/8/20 10:59 AM, Biju Das wrote: [...] > +static const struct udevice_id tfa_cpu_info[] = { > + { .compatible = "renesas,r8a774a1", .data = RMOBILE_CPU_TYPE_R8A774A1 }, > + { .compatible = "renesas,r8a774b1", .data = RMOBILE_CPU_TYPE_R8A774B1 }, > + { .compatible = "renesas,r8a774c0", .data = RMOBILE_CPU_TYPE_R8A774C0 }, > + { .compatible = "renesas,r8a774e1", .data = RMOBILE_CPU_TYPE_R8A774E1 }, > + { }, > +}; > + > +static const u32 get_cpu_type(u32 soc_id) > +{ > + const struct udevice_id *of_match = tfa_cpu_info; > + int i; Isn't there already a function in U-Boot which can match on a table of OF compatible strings ? I suspect when drivers match on their table of OF compatible strings, somesuch function must be used. > + for (i = 0; i < ARRAY_SIZE(tfa_cpu_info); i++) { > + if (soc_id == (of_match->data & PRODUCT_MASK) && > + of_machine_is_compatible(of_match->compatible)) > + return of_match->data; > + of_match++; > + } > + > + return soc_id; > +} > + > static u32 rmobile_get_prr(void) > { > #ifdef CONFIG_RCAR_GEN3 > @@ -23,7 +48,9 @@ static u32 rmobile_get_prr(void) > > u32 rmobile_get_cpu_type(void) > { > - return (rmobile_get_prr() & 0x00007F00) >> 8; > + const u32 soc_id = (rmobile_get_prr() & 0x00007F00) >> 8; The soc_id = ... can be inlined into get_cpu_type(). However, you might want to cache the result of rmobile_get_cpu_type() , because doing OF match every time this is called is expensive. > + > + return get_cpu_type(soc_id); > } [...] > +/* CPU IDs */ > +#define RMOBILE_CPU_TYPE_SH73A0 (SOC_ID_SH73A0) > +#define RMOBILE_CPU_TYPE_R8A7740 (SOC_ID_R8A7740) > +#define RMOBILE_CPU_TYPE_R8A774A1 (SOC_ID_R8A774A1 | RZG_CPU_MASK) > +#define RMOBILE_CPU_TYPE_R8A774B1 (SOC_ID_R8A774B1 | RZG_CPU_MASK) > +#define RMOBILE_CPU_TYPE_R8A774C0 (SOC_ID_R8A774C0 | RZG_CPU_MASK) > +#define RMOBILE_CPU_TYPE_R8A774E1 (SOC_ID_R8A774E1 | RZG_CPU_MASK) > +#define RMOBILE_CPU_TYPE_R8A7790 (SOC_ID_R8A7790) > +#define RMOBILE_CPU_TYPE_R8A7791 (SOC_ID_R8A7791) > +#define RMOBILE_CPU_TYPE_R8A7792 (SOC_ID_R8A7792) > +#define RMOBILE_CPU_TYPE_R8A7793 (SOC_ID_R8A7793) > +#define RMOBILE_CPU_TYPE_R8A7794 (SOC_ID_R8A7794) > +#define RMOBILE_CPU_TYPE_R8A7795 (SOC_ID_R8A7795) > +#define RMOBILE_CPU_TYPE_R8A7796 (SOC_ID_R8A7796) > +#define RMOBILE_CPU_TYPE_R8A77965 (SOC_ID_R8A77965) > +#define RMOBILE_CPU_TYPE_R8A77970 (SOC_ID_R8A77970) > +#define RMOBILE_CPU_TYPE_R8A77980 (SOC_ID_R8A77980) > +#define RMOBILE_CPU_TYPE_R8A77990 (SOC_ID_R8A77990) > +#define RMOBILE_CPU_TYPE_R8A77995 (SOC_ID_R8A77995) The () parentheses are not needed. Also, is there any need for this renaming of SOC_ID_R8... to RMOBILE_CPU... ? > +/* RZ/G CPU Identification Mask */ > +#define RZG_CPU_MASK 0x1000 This mask should have a comment which explicitly states that it is not related to the PRR register content.
Hi Marek, > Subject: Re: [PATCH v5 1/2] arm: rmobile: Add RZ/G2[HMNE] SoC support > > On 10/8/20 10:59 AM, Biju Das wrote: > > [...] > > > +static const struct udevice_id tfa_cpu_info[] = { > > + { .compatible = "renesas,r8a774a1", .data = > RMOBILE_CPU_TYPE_R8A774A1 }, > > + { .compatible = "renesas,r8a774b1", .data = > RMOBILE_CPU_TYPE_R8A774B1 }, > > + { .compatible = "renesas,r8a774c0", .data = > RMOBILE_CPU_TYPE_R8A774C0 }, > > + { .compatible = "renesas,r8a774e1", .data = > RMOBILE_CPU_TYPE_R8A774E1 }, > > + { }, > > +}; > > + > > +static const u32 get_cpu_type(u32 soc_id) { > > + const struct udevice_id *of_match = tfa_cpu_info; > > + int i; > > Isn't there already a function in U-Boot which can match on a table of OF > compatible strings ? I suspect when drivers match on their table of OF > compatible strings, somesuch function must be used. of_match function for matching device compatible string. But it doesn't match SoC compatible string. So I added a helper function is of_match_node[1] to search from rootnode to find the soc compatible string. [1] http://patchwork.ozlabs.org/project/uboot/patch/20201030140303.11773-1-biju.das.jz@bp.renesas.com/ Apart from this, This helper function can be used to replace the below codes in u-boot tree [2] [3] [2] https://elixir.bootlin.com/u-boot/latest/source/drivers/serial/serial_uniphier.c#L129 [3] https://elixir.bootlin.com/u-boot/latest/source/drivers/usb/phy/rockchip_usb2_phy.c#L77 > > + for (i = 0; i < ARRAY_SIZE(tfa_cpu_info); i++) { > > + if (soc_id == (of_match->data & PRODUCT_MASK) && > > + of_machine_is_compatible(of_match->compatible)) > > + return of_match->data; > > + of_match++; > > + } > > + > > + return soc_id; > > +} > > + > > static u32 rmobile_get_prr(void) > > { > > #ifdef CONFIG_RCAR_GEN3 > > @@ -23,7 +48,9 @@ static u32 rmobile_get_prr(void) > > > > u32 rmobile_get_cpu_type(void) > > { > > - return (rmobile_get_prr() & 0x00007F00) >> 8; > > + const u32 soc_id = (rmobile_get_prr() & 0x00007F00) >> 8; > > The soc_id = ... can be inlined into get_cpu_type(). > > However, you might want to cache the result of rmobile_get_cpu_type() , > because doing OF match every time this is called is expensive. I agree calling OF match is expensive. So I have ported Renesas SoC identification driver from Linux to u-boot which will cache the family type, soc_id and revision. I already sent a patch for supporting soc_id in UCLASS_SOC in ML[4] [4] http://patchwork.ozlabs.org/project/uboot/patch/20201030140724.12773-1-biju.das.jz@bp.renesas.com/ On the next version, I will send Renesas SoC identification driver, which supports caching family type which can be used to provide unique identification for CPU type. > > + > > + return get_cpu_type(soc_id); > > } > > [...] > > > +/* CPU IDs */ > > +#define RMOBILE_CPU_TYPE_SH73A0 (SOC_ID_SH73A0) > > +#define RMOBILE_CPU_TYPE_R8A7740 (SOC_ID_R8A7740) > > +#define RMOBILE_CPU_TYPE_R8A774A1 (SOC_ID_R8A774A1 | > RZG_CPU_MASK) > > +#define RMOBILE_CPU_TYPE_R8A774B1 (SOC_ID_R8A774B1 | > RZG_CPU_MASK) > > +#define RMOBILE_CPU_TYPE_R8A774C0 (SOC_ID_R8A774C0 | > RZG_CPU_MASK) > > +#define RMOBILE_CPU_TYPE_R8A774E1 (SOC_ID_R8A774E1 | > RZG_CPU_MASK) > > +#define RMOBILE_CPU_TYPE_R8A7790 (SOC_ID_R8A7790) > > +#define RMOBILE_CPU_TYPE_R8A7791 (SOC_ID_R8A7791) > > +#define RMOBILE_CPU_TYPE_R8A7792 (SOC_ID_R8A7792) > > +#define RMOBILE_CPU_TYPE_R8A7793 (SOC_ID_R8A7793) > > +#define RMOBILE_CPU_TYPE_R8A7794 (SOC_ID_R8A7794) > > +#define RMOBILE_CPU_TYPE_R8A7795 (SOC_ID_R8A7795) > > +#define RMOBILE_CPU_TYPE_R8A7796 (SOC_ID_R8A7796) > > +#define RMOBILE_CPU_TYPE_R8A77965 (SOC_ID_R8A77965) > > +#define RMOBILE_CPU_TYPE_R8A77970 (SOC_ID_R8A77970) > > +#define RMOBILE_CPU_TYPE_R8A77980 (SOC_ID_R8A77980) > > +#define RMOBILE_CPU_TYPE_R8A77990 (SOC_ID_R8A77990) > > +#define RMOBILE_CPU_TYPE_R8A77995 (SOC_ID_R8A77995) > > The () parentheses are not needed. Also, is there any need for this renaming > of SOC_ID_R8... to RMOBILE_CPU... ? OK, will take out parenthesis. RMOBILE_CPU_TYPE is unique, where SOC_ID_XXXX is not unique. > > +/* RZ/G CPU Identification Mask */ > > +#define RZG_CPU_MASK 0x1000 > > This mask should have a comment which explicitly states that it is not related > to the PRR register content. Ok. Agreed. Thanks and regards, Biju
On 11/1/20 8:26 PM, Biju Das wrote: > Hi Marek, Hi, [...] >>> @@ -23,7 +48,9 @@ static u32 rmobile_get_prr(void) >>> >>> u32 rmobile_get_cpu_type(void) >>> { >>> - return (rmobile_get_prr() & 0x00007F00) >> 8; >>> + const u32 soc_id = (rmobile_get_prr() & 0x00007F00) >> 8; >> >> The soc_id = ... can be inlined into get_cpu_type(). >> >> However, you might want to cache the result of rmobile_get_cpu_type() , >> because doing OF match every time this is called is expensive. > > I agree calling OF match is expensive. So I have ported Renesas SoC identification driver from Linux to u-boot > which will cache the family type, soc_id and revision. I already sent a patch for supporting soc_id in UCLASS_SOC in ML[4] > [4] http://patchwork.ozlabs.org/project/uboot/patch/20201030140724.12773-1-biju.das.jz@bp.renesas.com/ > > On the next version, I will send Renesas SoC identification driver, which supports caching family type which > can be used to provide unique identification for CPU type. Please make sure to check it on RCar2 as well, those use SPL and the SPL size is quite limited. [...]
Hi Marek, > Subject: Re: [PATCH v5 1/2] arm: rmobile: Add RZ/G2[HMNE] SoC support > > On 11/1/20 8:26 PM, Biju Das wrote: > > Hi Marek, > > Hi, > > [...] > > >>> @@ -23,7 +48,9 @@ static u32 rmobile_get_prr(void) > >>> > >>> u32 rmobile_get_cpu_type(void) > >>> { > >>> - return (rmobile_get_prr() & 0x00007F00) >> 8; > >>> + const u32 soc_id = (rmobile_get_prr() & 0x00007F00) >> 8; > >> > >> The soc_id = ... can be inlined into get_cpu_type(). > >> > >> However, you might want to cache the result of rmobile_get_cpu_type() > >> , because doing OF match every time this is called is expensive. > > > > I agree calling OF match is expensive. So I have ported Renesas SoC > > identification driver from Linux to u-boot which will cache the > > family type, soc_id and revision. I already sent a patch for > > supporting soc_id in UCLASS_SOC in ML[4] [4] > > > https://jpn01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpatch > > work.ozlabs.org%2Fproject%2Fuboot%2Fpatch%2F20201030140724.12773- > 1-bij > > > u.das.jz%40bp.renesas.com%2F&data=04%7C01%7Cbiju.das.jz%40bp.r > enes > > > as.com%7C23804e7d89d0437047b308d87f654edd%7C53d82571da1947e49cb4 > 625a16 > > > 6a4a2a%7C0%7C1%7C637399420383910105%7CUnknown%7CTWFpbGZsb3d8 > eyJWIjoiMC > > > 4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000& > amp;sd > > > ata=%2Bu6HZyimz2%2Froy%2FEfTAzAxXupL0hDSBGUqT4%2B%2F2lVJ8%3D& > amp;reser > > ved=0 > > > > On the next version, I will send Renesas SoC identification driver, > > which supports caching family type which can be used to provide unique > identification for CPU type. > > Please make sure to check it on RCar2 as well, those use SPL and the SPL size > is quite limited. Currently SoC identification driver is enabled only for RZ/G2 boards and support is added to both R-Car Gen3 and RZ/G2 devices. For the disabled case, the UCLASS-SOC class functions are inlined to "NULL" for soc_device_match and rest of the api's it is "-ENOSYS". I agree, in future we need to add support for RCar2 as well, since we are going to add u-boot support for RZ/G1 devices. Please find the size details related to R-Car Gen2(by adding support for R-Car M2-W and RZ/G1M SoC). There is increase of 944 bytes, for R-Car Gen2 device, if we enable Renesas SoC identification driver for Gen2 devices. Current u-boot-sh/master ----------------------------------- $ ls -al u-boot.bin -rw-r--r-- 1 biju biju 523001 Nov 3 09:16 u-boot.bin Current u-boot-sh/master + SoC renesas driver (R-Car M2-W enabled only case) -------------------------------------------------------------------------------------------- $ ls -al u-boot.bin -rw-r--r-- 1 biju biju 523945 Nov 3 09:47 u-boot.bin If you agree, we will add support for Gen2 to SoC identification driver later. Currently there is no users for using it. Please let me know. Regards, Biju
On 11/3/20 11:06 AM, Biju Das wrote: > Hi Marek, Hi, [...] >>> On the next version, I will send Renesas SoC identification driver, >>> which supports caching family type which can be used to provide unique >> identification for CPU type. >> >> Please make sure to check it on RCar2 as well, those use SPL and the SPL size >> is quite limited. > > Currently SoC identification driver is enabled only for RZ/G2 boards and support is added to both R-Car Gen3 and RZ/G2 devices. > > For the disabled case, the UCLASS-SOC class functions are inlined to "NULL" for soc_device_match and rest of the api's it is "-ENOSYS". > > I agree, in future we need to add support for RCar2 as well, since we are going to add u-boot support for RZ/G1 devices. > Please find the size details related to R-Car Gen2(by adding support for R-Car M2-W and RZ/G1M SoC). > > There is increase of 944 bytes, for R-Car Gen2 device, if we enable Renesas SoC identification driver for Gen2 devices. > > Current u-boot-sh/master > ----------------------------------- > $ ls -al u-boot.bin > -rw-r--r-- 1 biju biju 523001 Nov 3 09:16 u-boot.bin > > Current u-boot-sh/master + SoC renesas driver (R-Car M2-W enabled only case) > -------------------------------------------------------------------------------------------- > $ ls -al u-boot.bin > -rw-r--r-- 1 biju biju 523945 Nov 3 09:47 u-boot.bin > > If you agree, we will add support for Gen2 to SoC identification driver later. Currently there is no users for using it. > Please let me know. The problem on Gen2 isn't the size of u-boot.bin , but of spl/u-boot-spl.bin . That one is severely limited and I don't think it's realistic to add any sort of SoC identification driver into it. In fact, I think even the DM is somehow reduced in there.
Hi Marek, > On 11/3/20 11:06 AM, Biju Das wrote: > > Hi Marek, > > Hi, > > [...] > > >>> On the next version, I will send Renesas SoC identification driver, > >>> which supports caching family type which can be used to provide > >>> unique > >> identification for CPU type. > >> > >> Please make sure to check it on RCar2 as well, those use SPL and the > >> SPL size is quite limited. > > > > Currently SoC identification driver is enabled only for RZ/G2 boards and > support is added to both R-Car Gen3 and RZ/G2 devices. > > > > For the disabled case, the UCLASS-SOC class functions are inlined to "NULL" > for soc_device_match and rest of the api's it is "-ENOSYS". > > > > I agree, in future we need to add support for RCar2 as well, since we are > going to add u-boot support for RZ/G1 devices. > > Please find the size details related to R-Car Gen2(by adding support for R- > Car M2-W and RZ/G1M SoC). > > > > There is increase of 944 bytes, for R-Car Gen2 device, if we enable Renesas > SoC identification driver for Gen2 devices. > > > > Current u-boot-sh/master > > ----------------------------------- > > $ ls -al u-boot.bin > > -rw-r--r-- 1 biju biju 523001 Nov 3 09:16 u-boot.bin > > > > Current u-boot-sh/master + SoC renesas driver (R-Car M2-W enabled only > > case) > > ---------------------------------------------------------------------- > > ---------------------- > > $ ls -al u-boot.bin > > -rw-r--r-- 1 biju biju 523945 Nov 3 09:47 u-boot.bin > > > > If you agree, we will add support for Gen2 to SoC identification driver later. > Currently there is no users for using it. > > Please let me know. > > The problem on Gen2 isn't the size of u-boot.bin , but of spl/u-boot-spl.bin . > That one is severely limited and I don't think it's realistic to add any sort of > SoC identification driver into it. In fact, I think even the DM is somehow > reduced in there. Yes, I agree there is size constraint for Gen2 for spl/u-boot-spl.bin. Even in Gen3, we don't compile core/pinctrl driver for SPL. See, from drivers/Makefile. obj-$(CONFIG_$(SPL_TPL_)DM) obj-$(CONFIG_$(SPL_TPL_)PINCTRL) += pinctrl/ if we enable this, then we get linker error related to region .sram overflow messages. Please let me know, shall I post a patch series with SoC Identification and SDHI quirks or still have some open points? Regards, Biju
Hi Marek, > -----Original Message----- > From: Marek Vasut <marek.vasut@gmail.com> > Sent: 04 November 2020 19:24 > To: Biju Das <biju.das.jz@bp.renesas.com>; Nobuhiro Iwamatsu > <iwamatsu@nigauri.org> > Cc: u-boot@lists.denx.de; Chris Paterson <Chris.Paterson2@renesas.com>; > Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com> > Subject: Re: [PATCH v5 1/2] arm: rmobile: Add RZ/G2[HMNE] SoC support > > On 11/3/20 11:06 AM, Biju Das wrote: > > Hi Marek, > > Hi, > > [...] > > >>> On the next version, I will send Renesas SoC identification driver, > >>> which supports caching family type which can be used to provide > >>> unique > >> identification for CPU type. > >> > >> Please make sure to check it on RCar2 as well, those use SPL and the > >> SPL size is quite limited. > > > > Currently SoC identification driver is enabled only for RZ/G2 boards and > support is added to both R-Car Gen3 and RZ/G2 devices. > > > > For the disabled case, the UCLASS-SOC class functions are inlined to > "NULL" for soc_device_match and rest of the api's it is "-ENOSYS". > > > > I agree, in future we need to add support for RCar2 as well, since we > are going to add u-boot support for RZ/G1 devices. > > Please find the size details related to R-Car Gen2(by adding support for > R-Car M2-W and RZ/G1M SoC). > > > > There is increase of 944 bytes, for R-Car Gen2 device, if we enable > Renesas SoC identification driver for Gen2 devices. > > > > Current u-boot-sh/master > > ----------------------------------- > > $ ls -al u-boot.bin > > -rw-r--r-- 1 biju biju 523001 Nov 3 09:16 u-boot.bin > > > > Current u-boot-sh/master + SoC renesas driver (R-Car M2-W enabled only > > case) > > ---------------------------------------------------------------------- > > ---------------------- > > $ ls -al u-boot.bin > > -rw-r--r-- 1 biju biju 523945 Nov 3 09:47 u-boot.bin > > > > If you agree, we will add support for Gen2 to SoC identification driver > later. Currently there is no users for using it. > > Please let me know. > > The problem on Gen2 isn't the size of u-boot.bin , but of spl/u-boot- > spl.bin . That one is severely limited and I don't think it's realistic to > add any sort of SoC identification driver into it. In fact, I think even > the DM is somehow reduced in there. If you see the make file , soc identification driver is disabled for spl/u-boot. obj-$(CONFIG_$(SPL_)SOC_DEVICE_RENESAS) += soc_renesas.o So I think we are having same understanding not to add soc identification driver for spl/uboot. Please let me know, if you think other wise. Regards, Biju
diff --git a/arch/arm/mach-rmobile/cpu_info-rcar.c b/arch/arm/mach-rmobile/cpu_info-rcar.c index 5bde24ae0e..ee56864b61 100644 --- a/arch/arm/mach-rmobile/cpu_info-rcar.c +++ b/arch/arm/mach-rmobile/cpu_info-rcar.c @@ -6,12 +6,37 @@ */ #include <common.h> #include <asm/io.h> +#include <dm/device.h> +#define PRODUCT_MASK 0xff #define PRR_MASK 0x7fff #define R8A7796_REV_1_0 0x5200 #define R8A7796_REV_1_1 0x5210 #define R8A7796_REV_1_3 0x5211 +static const struct udevice_id tfa_cpu_info[] = { + { .compatible = "renesas,r8a774a1", .data = RMOBILE_CPU_TYPE_R8A774A1 }, + { .compatible = "renesas,r8a774b1", .data = RMOBILE_CPU_TYPE_R8A774B1 }, + { .compatible = "renesas,r8a774c0", .data = RMOBILE_CPU_TYPE_R8A774C0 }, + { .compatible = "renesas,r8a774e1", .data = RMOBILE_CPU_TYPE_R8A774E1 }, + { }, +}; + +static const u32 get_cpu_type(u32 soc_id) +{ + const struct udevice_id *of_match = tfa_cpu_info; + int i; + + for (i = 0; i < ARRAY_SIZE(tfa_cpu_info); i++) { + if (soc_id == (of_match->data & PRODUCT_MASK) && + of_machine_is_compatible(of_match->compatible)) + return of_match->data; + of_match++; + } + + return soc_id; +} + static u32 rmobile_get_prr(void) { #ifdef CONFIG_RCAR_GEN3 @@ -23,7 +48,9 @@ static u32 rmobile_get_prr(void) u32 rmobile_get_cpu_type(void) { - return (rmobile_get_prr() & 0x00007F00) >> 8; + const u32 soc_id = (rmobile_get_prr() & 0x00007F00) >> 8; + + return get_cpu_type(soc_id); } u32 rmobile_get_cpu_rev_integer(void) diff --git a/arch/arm/mach-rmobile/cpu_info.c b/arch/arm/mach-rmobile/cpu_info.c index fdbbd72e28..b19b7e3044 100644 --- a/arch/arm/mach-rmobile/cpu_info.c +++ b/arch/arm/mach-rmobile/cpu_info.c @@ -3,12 +3,12 @@ * (C) Copyright 2012 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> * (C) Copyright 2012 Renesas Solutions Corp. */ -#include <common.h> -#include <cpu_func.h> #include <asm/cache.h> -#include <init.h> #include <asm/io.h> +#include <common.h> +#include <cpu_func.h> #include <env.h> +#include <init.h> #include <linux/ctype.h> #ifdef CONFIG_ARCH_CPU_INIT @@ -59,6 +59,10 @@ static const struct { } rmobile_cpuinfo[] = { { RMOBILE_CPU_TYPE_SH73A0, "SH73A0" }, { RMOBILE_CPU_TYPE_R8A7740, "R8A7740" }, + { RMOBILE_CPU_TYPE_R8A774A1, "R8A774A1" }, + { RMOBILE_CPU_TYPE_R8A774B1, "R8A774B1" }, + { RMOBILE_CPU_TYPE_R8A774C0, "R8A774C0" }, + { RMOBILE_CPU_TYPE_R8A774E1, "R8A774E1" }, { RMOBILE_CPU_TYPE_R8A7790, "R8A7790" }, { RMOBILE_CPU_TYPE_R8A7791, "R8A7791" }, { RMOBILE_CPU_TYPE_R8A7792, "R8A7792" }, diff --git a/arch/arm/mach-rmobile/include/mach/rmobile.h b/arch/arm/mach-rmobile/include/mach/rmobile.h index a50249dc96..6d638466e9 100644 --- a/arch/arm/mach-rmobile/include/mach/rmobile.h +++ b/arch/arm/mach-rmobile/include/mach/rmobile.h @@ -24,21 +24,48 @@ #endif #endif /* CONFIG_ARCH_RMOBILE */ -/* PRR CPU IDs */ -#define RMOBILE_CPU_TYPE_SH73A0 0x37 -#define RMOBILE_CPU_TYPE_R8A7740 0x40 -#define RMOBILE_CPU_TYPE_R8A7790 0x45 -#define RMOBILE_CPU_TYPE_R8A7791 0x47 -#define RMOBILE_CPU_TYPE_R8A7792 0x4A -#define RMOBILE_CPU_TYPE_R8A7793 0x4B -#define RMOBILE_CPU_TYPE_R8A7794 0x4C -#define RMOBILE_CPU_TYPE_R8A7795 0x4F -#define RMOBILE_CPU_TYPE_R8A7796 0x52 -#define RMOBILE_CPU_TYPE_R8A77965 0x55 -#define RMOBILE_CPU_TYPE_R8A77970 0x54 -#define RMOBILE_CPU_TYPE_R8A77980 0x56 -#define RMOBILE_CPU_TYPE_R8A77990 0x57 -#define RMOBILE_CPU_TYPE_R8A77995 0x58 +/* PRR IDs */ +#define SOC_ID_SH73A0 0x37 +#define SOC_ID_R8A7740 0x40 +#define SOC_ID_R8A774A1 0x52 +#define SOC_ID_R8A774B1 0x55 +#define SOC_ID_R8A774C0 0x57 +#define SOC_ID_R8A774E1 0x4F +#define SOC_ID_R8A7790 0x45 +#define SOC_ID_R8A7791 0x47 +#define SOC_ID_R8A7792 0x4A +#define SOC_ID_R8A7793 0x4B +#define SOC_ID_R8A7794 0x4C +#define SOC_ID_R8A7795 0x4F +#define SOC_ID_R8A7796 0x52 +#define SOC_ID_R8A77965 0x55 +#define SOC_ID_R8A77970 0x54 +#define SOC_ID_R8A77980 0x56 +#define SOC_ID_R8A77990 0x57 +#define SOC_ID_R8A77995 0x58 + +/* CPU IDs */ +#define RMOBILE_CPU_TYPE_SH73A0 (SOC_ID_SH73A0) +#define RMOBILE_CPU_TYPE_R8A7740 (SOC_ID_R8A7740) +#define RMOBILE_CPU_TYPE_R8A774A1 (SOC_ID_R8A774A1 | RZG_CPU_MASK) +#define RMOBILE_CPU_TYPE_R8A774B1 (SOC_ID_R8A774B1 | RZG_CPU_MASK) +#define RMOBILE_CPU_TYPE_R8A774C0 (SOC_ID_R8A774C0 | RZG_CPU_MASK) +#define RMOBILE_CPU_TYPE_R8A774E1 (SOC_ID_R8A774E1 | RZG_CPU_MASK) +#define RMOBILE_CPU_TYPE_R8A7790 (SOC_ID_R8A7790) +#define RMOBILE_CPU_TYPE_R8A7791 (SOC_ID_R8A7791) +#define RMOBILE_CPU_TYPE_R8A7792 (SOC_ID_R8A7792) +#define RMOBILE_CPU_TYPE_R8A7793 (SOC_ID_R8A7793) +#define RMOBILE_CPU_TYPE_R8A7794 (SOC_ID_R8A7794) +#define RMOBILE_CPU_TYPE_R8A7795 (SOC_ID_R8A7795) +#define RMOBILE_CPU_TYPE_R8A7796 (SOC_ID_R8A7796) +#define RMOBILE_CPU_TYPE_R8A77965 (SOC_ID_R8A77965) +#define RMOBILE_CPU_TYPE_R8A77970 (SOC_ID_R8A77970) +#define RMOBILE_CPU_TYPE_R8A77980 (SOC_ID_R8A77980) +#define RMOBILE_CPU_TYPE_R8A77990 (SOC_ID_R8A77990) +#define RMOBILE_CPU_TYPE_R8A77995 (SOC_ID_R8A77995) + +/* RZ/G CPU Identification Mask */ +#define RZG_CPU_MASK 0x1000 #ifndef __ASSEMBLY__ u32 rmobile_get_cpu_type(void);