From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] mx6: support i.MX6UL speed grading reading from OTP bits
Date: Wed, 13 Jul 2016 16:18:24 +0200 [thread overview]
Message-ID: <57864DB0.2010706@denx.de> (raw)
In-Reply-To: <1466432092-3289-1-git-send-email-hector.palacios@digi.com>
Hi Hector,
On 20/06/2016 16:14, Hector Palacios wrote:
> i.MX6UL defines speed grading in OCOTP register 0x440[17:16]
> as follows:
> 00 reserved
> 01 528MHz
> 10 700MHz
> 11 reserved
>
> This commit removes the constants (which had the speed hardcoded
> in their names) and uses values instead.
>
> Signed-off-by: Hector Palacios <hector.palacios@digi.com>
> ---
> arch/arm/cpu/armv7/mx6/soc.c | 23 ++++++++++++-----------
> 1 file changed, 12 insertions(+), 11 deletions(-)
>
> diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c
> index d4b22ad7f315..49b5773b1b77 100644
> --- a/arch/arm/cpu/armv7/mx6/soc.c
> +++ b/arch/arm/cpu/armv7/mx6/soc.c
> @@ -103,10 +103,6 @@ u32 get_cpu_rev(void)
> * defines a 2-bit SPEED_GRADING
> */
> #define OCOTP_CFG3_SPEED_SHIFT 16
> -#define OCOTP_CFG3_SPEED_800MHZ 0
> -#define OCOTP_CFG3_SPEED_850MHZ 1
> -#define OCOTP_CFG3_SPEED_1GHZ 2
> -#define OCOTP_CFG3_SPEED_1P2GHZ 3
>
> u32 get_cpu_speed_grade_hz(void)
> {
> @@ -122,18 +118,23 @@ u32 get_cpu_speed_grade_hz(void)
>
> switch (val) {
> /* Valid for IMX6DQ */
> - case OCOTP_CFG3_SPEED_1P2GHZ:
> + case 3:
> if (is_cpu_type(MXC_CPU_MX6Q) || is_cpu_type(MXC_CPU_MX6D))
> return 1200000000;
> - /* Valid for IMX6SX/IMX6SDL/IMX6DQ */
> - case OCOTP_CFG3_SPEED_1GHZ:
> - return 996000000;
> - /* Valid for IMX6DQ */
> - case OCOTP_CFG3_SPEED_850MHZ:
> + /* Valid for IMX6SX/IMX6SDL/IMX6DQ/IMX6UL */
> + case 2:
> + if (is_cpu_type(MXC_CPU_MX6UL))
> + return 700000000;
> + else
> + return 996000000;
> + /* Valid for IMX6DQ/IMX6UL */
> + case 1:
> if (is_cpu_type(MXC_CPU_MX6Q) || is_cpu_type(MXC_CPU_MX6D))
> return 852000000;
> + else if (is_cpu_type(MXC_CPU_MX6UL))
> + return 528000000;
> /* Valid for IMX6SX/IMX6SDL/IMX6DQ */
> - case OCOTP_CFG3_SPEED_800MHZ:
> + case 0:
> return 792000000;
> }
> return 0;
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
Applied to -u-boot-imx, thanks !
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
prev parent reply other threads:[~2016-07-13 14:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-20 14:14 [U-Boot] [PATCH] mx6: support i.MX6UL speed grading reading from OTP bits Hector Palacios
2016-07-13 14:18 ` Stefano Babic [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57864DB0.2010706@denx.de \
--to=sbabic@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.