]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
ARM: tegra: rename MASK_BITS_29_28 to MASK_BITS_31_28
authorStephen Warren <swarren@nvidia.com>
Fri, 24 Jan 2014 17:16:18 +0000 (10:16 -0700)
committerTom Warren <twarren@nvidia.com>
Mon, 3 Feb 2014 16:46:45 +0000 (09:46 -0700)
The only place where the MASK_BITS_* values are used is in
adjust_periph_pll(), which interprets the value 4 (old MASK_BITS_29_28,
new MASK_BITS_31_28) as being associated with mask OUT_CLK_SOURCE4_MASK,
i.e. bits 31:28. Rename the MASK_BITS_ macro to reflect how it's actually
implemented.

Note that no Tegra clock register actually uses all of bits 31:28 as
the mux field. Rather, bits 30:28, 29:28, or 28 are used. However, in
those cases, nothing is stored in the bits above the mux field, so it's
safe to pretend that the mux field extends all the way to the end of the
register. As such, the U-Boot clock driver is currently a bit lazy, and
doesn't distinguish between 31:28, 30:28, 29:28 and 28; it just lumps
them all together and pretends they're all 31:28. This patch doesn't
cause this issue; it was pre-existing. Hopefully, future patches will
clean this up.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Tested-by: Thierry Reding <treding@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
arch/arm/cpu/tegra114-common/clock.c
arch/arm/cpu/tegra30-common/clock.c
arch/arm/include/asm/arch-tegra/clock.h

index 47612e12d262a7686025bdddd5307f4fdb7c6803..3bede71a7a1f7efaf3077c105bbe2e3627c741d1 100644 (file)
@@ -103,7 +103,7 @@ static enum clock_id clock_source[CLOCK_TYPE_COUNT][CLOCK_MAX_MUX+1] = {
                MASK_BITS_31_29},
        { CLK(PERIPH),  CLK(CGENERAL),  CLK(SFROM32KHZ),        CLK(OSC),
                CLK(NONE),      CLK(NONE),      CLK(NONE),      CLK(NONE),
-               MASK_BITS_29_28}
+               MASK_BITS_31_28}
 };
 
 /*
index 89c3529c885b50ce589781c5934f8a98336f5a95..33528702185e8e5f990fa41ceeb8af91388a1a36 100644 (file)
@@ -102,7 +102,7 @@ static enum clock_id clock_source[CLOCK_TYPE_COUNT][CLOCK_MAX_MUX+1] = {
                MASK_BITS_31_29},
        { CLK(PERIPH),  CLK(CGENERAL),  CLK(SFROM32KHZ), CLK(OSC),
                CLK(NONE),      CLK(NONE),      CLK(NONE),      CLK(NONE),
-               MASK_BITS_29_28}
+               MASK_BITS_31_28}
 };
 
 /*
index 052c0208b18aac44974ac488d23ef76854152867..80825e30f8e349e674d422df9093ace04c2f577f 100644 (file)
@@ -20,10 +20,19 @@ enum clock_osc_freq {
        CLOCK_OSC_FREQ_COUNT,
 };
 
+/*
+ * Note that no Tegra clock register actually uses all of bits 31:28 as
+ * the mux field. Rather, bits 30:28, 29:28, or 28 are used. However, in
+ * those cases, nothing is stored in the bits about the mux field, so it's
+ * safe to pretend that the mux field extends all the way to the end of the
+ * register. As such, the U-Boot clock driver is currently a bit lazy, and
+ * doesn't distinguish between 31:28, 30:28, 29:28 and 28; it just lumps
+ * them all together and pretends they're all 31:28.
+ */
 enum {
        MASK_BITS_31_30 = 2,    /* num of bits used to specify clock source */
        MASK_BITS_31_29,
-       MASK_BITS_29_28,
+       MASK_BITS_31_28,
 };
 
 #include <asm/arch/clock-tables.h>