ttbr1 = save_ttbr1();
/* Now change DDR frequency. */
- mx6_change_lpddr2_freq(ddr_rate,
- (mode == BUS_FREQ_LOW || mode == BUS_FREQ_ULTRA_LOW) ? 1 : 0);
+ if (cpu_is_imx6sl())
+ mx6_change_lpddr2_freq(ddr_rate,
+ (mode == BUS_FREQ_LOW || mode == BUS_FREQ_ULTRA_LOW) ? 1 : 0);
+ else
+ mx6_change_lpddr2_freq(ddr_rate,
+ (mode == BUS_FREQ_LOW || mode == BUS_FREQ_AUDIO) ? 1 : 0);
+
restore_ttbr1(ttbr1);
curr_ddr_rate = ddr_rate;
/*
- * Copyright (C) 2012-2015 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2012-2016 Freescale Semiconductor, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
bic r6, r6, r4
orr r6, r6, r7
str r6, [r8, r5]
- /* Now perform a Force Measurement. */
- ldr r6, [r8, r5]
- orr r6, r6, #0x800
- str r6, [r8, r5]
- /* Wait for FRC_MSR to clear. */
-force_measure:
- ldr r6, [r8, r5]
- and r6, r6, #0x800
- cmp r6, #0x0
- bne force_measure
.endm
#define MMDC0_MAPSR 0x404
#define MMDC0_MADPCR0 0x410
+#define HIGH_BUS_MODE 0x0
+
.macro wait_for_ccm_handshake
1:
.endm
.macro mmdc_clk_lower_100MHz
+ /* if MMDC is not in 400MHz mode, skip double mu count */
+ cmp r1, #HIGH_BUS_MODE
+ bne 1f
/*
* Prior to reducing the DDR frequency (at 528/400 MHz),
bic r6, r6, r4
orr r6, r6, r7
str r6, [r5, r8]
- /* Now perform a Force Measurement. */
- ldr r6, [r5, r8]
- orr r6, r6, #0x800
- str r6, [r5, r8]
- /* Wait for FRC_MSR to clear. */
-force_measure:
- ldr r6, [r5, r8]
- and r6, r6, #0x800
- cmp r6, #0x0
- bne force_measure
/* For freq lower than 100MHz, need to set RALAT to 2 */
ldr r6, [r5, #0x18]
bic r6, r6, #(0x7 << 6)
orr r6, r6, #(0x2 << 6)
str r6, [r5, #0x18]
-
+1:
.endm
.macro mmdc_clk_above_100MHz
/*
- * Copyright (C) 2014-2015 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2014-2016 Freescale Semiconductor, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#define MMDC0_MAPSR 0x404
#define MMDC0_MADPCR0 0x410
+#define HIGH_BUS_MODE 0x0
+
/* Check if the cpu is cortex-a7 */
.macro is_ca7
.endm
.macro mmdc_clk_lower_100MHz
+ /* if MMDC is not in 400MHz mode, skip double mu count */
+ cmp r1, #HIGH_BUS_MODE
+ bne 1f
/*
* Prior to reducing the DDR frequency (at 528/400 MHz),
bic r6, r6, r4
orr r6, r6, r7
str r6, [r5, r8]
- /* Now perform a Force Measurement. */
- ldr r6, [r5, r8]
- orr r6, r6, #0x800
- str r6, [r5, r8]
- /* Wait for FRC_MSR to clear. */
-force_measure:
- ldr r6, [r5, r8]
- and r6, r6, #0x800
- cmp r6, #0x0
- bne force_measure
/* For freq lower than 100MHz, need to set RALAT to 2 */
ldr r6, [r5, #0x18]
bic r6, r6, #(0x7 << 6)
orr r6, r6, #(0x2 << 6)
str r6, [r5, #0x18]
-
+1:
.endm
.macro mmdc_clk_above_100MHz