Skip to content

Commit 3536cb1

Browse files
committed
Merge tag 'soc-arm-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
Pull SoC arm platform updates from Arnd Bergmann: "The at91 platform gains support for SAMA7D65, a new variant of the Cortex-A7 based SAMA7G5 with a graphics output. The i.MX, Renesas and davinci platforms each get one minor bugfix" * tag 'soc-arm-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: ARM: davinci: always enable CONFIG_ARCH_DAVINCI_DA850 ARM: imx: mark imx53_suspend_sz as unused ARM: at91: pm: Enable ULP0/ULP1 for SAMA7D65 ARM: at91: pm: Add Backup mode for SAMA7D65 ARM: at91: pm: add DT compatible support for sama7d65 ARM: at91: pm: fix at91_suspend_finish for ZQ calibration dt-bindings: ARM: at91: add Calao USB boards dt-bindings: ARM: at91: make separate entry for Olimex board ARM: at91: Add Support in SoC driver for SAMA7D65 dt-bindings: atmel-sysreg: Add SAMA7D65 Chip ID ARM: shmobile: rcar-gen2: Remove CMA reservation code
2 parents 3bb3396 + 46367f0 commit 3536cb1

11 files changed

Lines changed: 170 additions & 102 deletions

File tree

Documentation/devicetree/bindings/arm/atmel-at91.yaml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ properties:
2222
- items:
2323
- const: atmel,at91rm9200
2424
- items:
25-
- enum:
26-
- olimex,sam9-l9260
2725
- enum:
2826
- atmel,at91sam9260
2927
- atmel,at91sam9261
@@ -36,6 +34,37 @@ properties:
3634
- atmel,at91sam9x60
3735
- const: atmel,at91sam9
3836

37+
- description: Olimex SAM9-L9260
38+
items:
39+
- const: olimex,sam9-l9260
40+
- const: atmel,at91sam9260
41+
- const: atmel,at91sam9
42+
43+
- description: Calao USB A9260
44+
items:
45+
- const: calao,usb-a9260
46+
- const: atmel,at91sam9260
47+
- const: atmel,at91sam9
48+
49+
- description: Calao USB A9263
50+
items:
51+
- const: calao,usb-a9263
52+
- const: atmel,at91sam9263
53+
- const: atmel,at91sam9
54+
55+
- description: Calao USB A9G20
56+
items:
57+
- const: calao,usb-a9g20
58+
- const: atmel,at91sam9g20
59+
- const: atmel,at91sam9
60+
61+
- description: Calao USB A9G20-LPW
62+
items:
63+
- const: calao,usb-a9g20-lpw
64+
- const: calao,usb-a9g20
65+
- const: atmel,at91sam9g20
66+
- const: atmel,at91sam9
67+
3968
- items:
4069
- enum:
4170
- overkiz,kizboxmini-base # Overkiz kizbox Mini Base Board

Documentation/devicetree/bindings/arm/atmel-sysregs.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Atmel system registers
22

33
Chipid required properties:
44
- compatible: Should be "atmel,sama5d2-chipid" or "microchip,sama7g5-chipid"
5+
"microchip,sama7d65-chipid"
56
- reg : Should contain registers location and length
67

78
PIT Timer required properties:

arch/arm/mach-at91/pm.c

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,16 @@ static const struct of_device_id sam9x60_ws_ids[] = {
222222
{ /* sentinel */ }
223223
};
224224

225-
static const struct of_device_id sama7g5_ws_ids[] = {
225+
static const struct of_device_id sama7_ws_ids[] = {
226+
{ .compatible = "microchip,sama7d65-rtc", .data = &ws_info[1] },
226227
{ .compatible = "microchip,sama7g5-rtc", .data = &ws_info[1] },
227228
{ .compatible = "microchip,sama7g5-ohci", .data = &ws_info[2] },
228229
{ .compatible = "usb-ohci", .data = &ws_info[2] },
229230
{ .compatible = "atmel,at91sam9g45-ehci", .data = &ws_info[2] },
230231
{ .compatible = "usb-ehci", .data = &ws_info[2] },
232+
{ .compatible = "microchip,sama7d65-sdhci", .data = &ws_info[3] },
231233
{ .compatible = "microchip,sama7g5-sdhci", .data = &ws_info[3] },
234+
{ .compatible = "microchip,sama7d65-rtt", .data = &ws_info[4] },
232235
{ .compatible = "microchip,sama7g5-rtt", .data = &ws_info[4] },
233236
{ /* sentinel */ }
234237
};
@@ -545,11 +548,12 @@ extern u32 at91_pm_suspend_in_sram_sz;
545548

546549
static int at91_suspend_finish(unsigned long val)
547550
{
548-
unsigned char modified_gray_code[] = {
549-
0x00, 0x01, 0x02, 0x03, 0x06, 0x07, 0x04, 0x05, 0x0c, 0x0d,
550-
0x0e, 0x0f, 0x0a, 0x0b, 0x08, 0x09, 0x18, 0x19, 0x1a, 0x1b,
551-
0x1e, 0x1f, 0x1c, 0x1d, 0x14, 0x15, 0x16, 0x17, 0x12, 0x13,
552-
0x10, 0x11,
551+
/* SYNOPSYS workaround to fix a bug in the calibration logic */
552+
unsigned char modified_fix_code[] = {
553+
0x00, 0x01, 0x01, 0x06, 0x07, 0x0c, 0x06, 0x07, 0x0b, 0x18,
554+
0x0a, 0x0b, 0x0c, 0x0d, 0x0d, 0x0a, 0x13, 0x13, 0x12, 0x13,
555+
0x14, 0x15, 0x15, 0x12, 0x18, 0x19, 0x19, 0x1e, 0x1f, 0x14,
556+
0x1e, 0x1f,
553557
};
554558
unsigned int tmp, index;
555559
int i;
@@ -560,25 +564,25 @@ static int at91_suspend_finish(unsigned long val)
560564
* restore the ZQ0SR0 with the value saved here. But the
561565
* calibration is buggy and restoring some values from ZQ0SR0
562566
* is forbidden and risky thus we need to provide processed
563-
* values for these (modified gray code values).
567+
* values for these.
564568
*/
565569
tmp = readl(soc_pm.data.ramc_phy + DDR3PHY_ZQ0SR0);
566570

567571
/* Store pull-down output impedance select. */
568572
index = (tmp >> DDR3PHY_ZQ0SR0_PDO_OFF) & 0x1f;
569-
soc_pm.bu->ddr_phy_calibration[0] = modified_gray_code[index];
573+
soc_pm.bu->ddr_phy_calibration[0] = modified_fix_code[index] << DDR3PHY_ZQ0SR0_PDO_OFF;
570574

571575
/* Store pull-up output impedance select. */
572576
index = (tmp >> DDR3PHY_ZQ0SR0_PUO_OFF) & 0x1f;
573-
soc_pm.bu->ddr_phy_calibration[0] |= modified_gray_code[index];
577+
soc_pm.bu->ddr_phy_calibration[0] |= modified_fix_code[index] << DDR3PHY_ZQ0SR0_PUO_OFF;
574578

575579
/* Store pull-down on-die termination impedance select. */
576580
index = (tmp >> DDR3PHY_ZQ0SR0_PDODT_OFF) & 0x1f;
577-
soc_pm.bu->ddr_phy_calibration[0] |= modified_gray_code[index];
581+
soc_pm.bu->ddr_phy_calibration[0] |= modified_fix_code[index] << DDR3PHY_ZQ0SR0_PDODT_OFF;
578582

579583
/* Store pull-up on-die termination impedance select. */
580584
index = (tmp >> DDR3PHY_ZQ0SRO_PUODT_OFF) & 0x1f;
581-
soc_pm.bu->ddr_phy_calibration[0] |= modified_gray_code[index];
585+
soc_pm.bu->ddr_phy_calibration[0] |= modified_fix_code[index] << DDR3PHY_ZQ0SRO_PUODT_OFF;
582586

583587
/*
584588
* The 1st 8 words of memory might get corrupted in the process
@@ -643,6 +647,11 @@ static void at91_pm_suspend(suspend_state_t state)
643647
at91_suspend_sram_fn = fncpy(at91_suspend_sram_fn,
644648
&at91_pm_suspend_in_sram,
645649
at91_pm_suspend_in_sram_sz);
650+
651+
if (IS_ENABLED(CONFIG_SOC_SAMA7D65)) {
652+
/* SHDWC.SR */
653+
readl(soc_pm.data.shdwc + 0x08);
654+
}
646655
} else {
647656
at91_suspend_finish(0);
648657
}
@@ -1061,7 +1070,8 @@ static int __init at91_pm_backup_init(void)
10611070
int ret = -ENODEV, located = 0;
10621071

10631072
if (!IS_ENABLED(CONFIG_SOC_SAMA5D2) &&
1064-
!IS_ENABLED(CONFIG_SOC_SAMA7G5))
1073+
!IS_ENABLED(CONFIG_SOC_SAMA7G5) &&
1074+
!IS_ENABLED(CONFIG_SOC_SAMA7D65))
10651075
return -EPERM;
10661076

10671077
if (!at91_is_pm_mode_active(AT91_PM_BACKUP))
@@ -1329,6 +1339,7 @@ struct pmc_info {
13291339
unsigned long uhp_udp_mask;
13301340
unsigned long mckr;
13311341
unsigned long version;
1342+
unsigned long mcks;
13321343
};
13331344

13341345
static const struct pmc_info pmc_infos[] __initconst = {
@@ -1360,8 +1371,14 @@ static const struct pmc_info pmc_infos[] __initconst = {
13601371
{
13611372
.mckr = 0x28,
13621373
.version = AT91_PMC_V2,
1374+
.mcks = 4,
1375+
},
1376+
{
1377+
.uhp_udp_mask = AT91SAM926x_PMC_UHP,
1378+
.mckr = 0x28,
1379+
.version = AT91_PMC_V2,
1380+
.mcks = 9,
13631381
},
1364-
13651382
};
13661383

13671384
static const struct of_device_id atmel_pmc_ids[] __initconst = {
@@ -1378,6 +1395,7 @@ static const struct of_device_id atmel_pmc_ids[] __initconst = {
13781395
{ .compatible = "atmel,sama5d2-pmc", .data = &pmc_infos[1] },
13791396
{ .compatible = "microchip,sam9x60-pmc", .data = &pmc_infos[4] },
13801397
{ .compatible = "microchip,sam9x7-pmc", .data = &pmc_infos[4] },
1398+
{ .compatible = "microchip,sama7d65-pmc", .data = &pmc_infos[6] },
13811399
{ .compatible = "microchip,sama7g5-pmc", .data = &pmc_infos[5] },
13821400
{ /* sentinel */ },
13831401
};
@@ -1448,6 +1466,7 @@ static void __init at91_pm_init(void (*pm_idle)(void))
14481466
soc_pm.data.uhp_udp_mask = pmc->uhp_udp_mask;
14491467
soc_pm.data.pmc_mckr_offset = pmc->mckr;
14501468
soc_pm.data.pmc_version = pmc->version;
1469+
soc_pm.data.pmc_mcks = pmc->mcks;
14511470

14521471
if (pm_idle)
14531472
arm_pm_idle = pm_idle;
@@ -1671,7 +1690,7 @@ void __init sama7_pm_init(void)
16711690
at91_pm_modes_init(iomaps, ARRAY_SIZE(iomaps));
16721691
at91_pm_init(NULL);
16731692

1674-
soc_pm.ws_ids = sama7g5_ws_ids;
1693+
soc_pm.ws_ids = sama7_ws_ids;
16751694
soc_pm.config_pmc_ws = at91_sam9x60_config_pmc_ws;
16761695

16771696
soc_pm.sfrbu_regs.pswbu.key = (0x4BD20C << 8);

arch/arm/mach-at91/pm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ struct at91_pm_data {
3939
unsigned int suspend_mode;
4040
unsigned int pmc_mckr_offset;
4141
unsigned int pmc_version;
42+
unsigned int pmc_mcks;
4243
};
4344
#endif
4445

arch/arm/mach-at91/pm_data-offsets.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ int main(void)
1818
pmc_mckr_offset));
1919
DEFINE(PM_DATA_PMC_VERSION, offsetof(struct at91_pm_data,
2020
pmc_version));
21+
DEFINE(PM_DATA_PMC_MCKS, offsetof(struct at91_pm_data,
22+
pmc_mcks));
2123

2224
return 0;
2325
}

arch/arm/mach-at91/pm_suspend.S

Lines changed: 92 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -814,18 +814,20 @@ sr_dis_exit:
814814
.endm
815815

816816
/**
817-
* at91_mckx_ps_enable: save MCK1..4 settings and switch it to main clock
817+
* at91_mckx_ps_enable: save MCK settings and switch it to main clock
818818
*
819-
* Side effects: overwrites tmp1, tmp2
819+
* Side effects: overwrites tmp1, tmp2, tmp3
820820
*/
821821
.macro at91_mckx_ps_enable
822822
#ifdef CONFIG_SOC_SAMA7
823823
ldr pmc, .pmc_base
824+
ldr tmp3, .mcks
824825

825-
/* There are 4 MCKs we need to handle: MCK1..4 */
826+
/* Start at MCK1 and go until MCKs */
826827
mov tmp1, #1
827-
e_loop: cmp tmp1, #5
828-
beq e_done
828+
e_loop:
829+
cmp tmp1, tmp3
830+
bgt e_done
829831

830832
/* Write MCK ID to retrieve the settings. */
831833
str tmp1, [pmc, #AT91_PMC_MCR_V2]
@@ -850,7 +852,37 @@ e_save_mck3:
850852
b e_ps
851853

852854
e_save_mck4:
855+
cmp tmp1, #4
856+
bne e_save_mck5
853857
str tmp2, .saved_mck4
858+
b e_ps
859+
860+
e_save_mck5:
861+
cmp tmp1, #5
862+
bne e_save_mck6
863+
str tmp2, .saved_mck5
864+
b e_ps
865+
866+
e_save_mck6:
867+
cmp tmp1, #6
868+
bne e_save_mck7
869+
str tmp2, .saved_mck6
870+
b e_ps
871+
872+
e_save_mck7:
873+
cmp tmp1, #7
874+
bne e_save_mck8
875+
str tmp2, .saved_mck7
876+
b e_ps
877+
878+
e_save_mck8:
879+
cmp tmp1, #8
880+
bne e_save_mck9
881+
str tmp2, .saved_mck8
882+
b e_ps
883+
884+
e_save_mck9:
885+
str tmp2, .saved_mck9
854886

855887
e_ps:
856888
/* Use CSS=MAINCK and DIV=1. */
@@ -870,18 +902,20 @@ e_done:
870902
.endm
871903

872904
/**
873-
* at91_mckx_ps_restore: restore MCK1..4 settings
905+
* at91_mckx_ps_restore: restore MCKx settings
874906
*
875907
* Side effects: overwrites tmp1, tmp2
876908
*/
877909
.macro at91_mckx_ps_restore
878910
#ifdef CONFIG_SOC_SAMA7
879911
ldr pmc, .pmc_base
912+
ldr tmp2, .mcks
880913

881-
/* There are 4 MCKs we need to handle: MCK1..4 */
914+
/* Start from MCK1 and go up to MCKs */
882915
mov tmp1, #1
883-
r_loop: cmp tmp1, #5
884-
beq r_done
916+
r_loop:
917+
cmp tmp1, tmp2
918+
bgt r_done
885919

886920
r_save_mck1:
887921
cmp tmp1, #1
@@ -902,7 +936,37 @@ r_save_mck3:
902936
b r_ps
903937

904938
r_save_mck4:
939+
cmp tmp1, #4
940+
bne r_save_mck5
905941
ldr tmp2, .saved_mck4
942+
b r_ps
943+
944+
r_save_mck5:
945+
cmp tmp1, #5
946+
bne r_save_mck6
947+
ldr tmp2, .saved_mck5
948+
b r_ps
949+
950+
r_save_mck6:
951+
cmp tmp1, #6
952+
bne r_save_mck7
953+
ldr tmp2, .saved_mck6
954+
b r_ps
955+
956+
r_save_mck7:
957+
cmp tmp1, #7
958+
bne r_save_mck8
959+
ldr tmp2, .saved_mck7
960+
b r_ps
961+
962+
r_save_mck8:
963+
cmp tmp1, #8
964+
bne r_save_mck9
965+
ldr tmp2, .saved_mck8
966+
b r_ps
967+
968+
r_save_mck9:
969+
ldr tmp2, .saved_mck9
906970

907971
r_ps:
908972
/* Write MCK ID to retrieve the settings. */
@@ -921,6 +985,7 @@ r_ps:
921985
wait_mckrdy tmp1
922986

923987
add tmp1, tmp1, #1
988+
ldr tmp2, .mcks
924989
b r_loop
925990
r_done:
926991
#endif
@@ -1045,6 +1110,10 @@ ENTRY(at91_pm_suspend_in_sram)
10451110
str tmp1, .memtype
10461111
ldr tmp1, [r0, #PM_DATA_MODE]
10471112
str tmp1, .pm_mode
1113+
#ifdef CONFIG_SOC_SAMA7
1114+
ldr tmp1, [r0, #PM_DATA_PMC_MCKS]
1115+
str tmp1, .mcks
1116+
#endif
10481117

10491118
/*
10501119
* ldrne below are here to preload their address in the TLB as access
@@ -1132,6 +1201,10 @@ ENDPROC(at91_pm_suspend_in_sram)
11321201
.word 0
11331202
.pmc_version:
11341203
.word 0
1204+
#ifdef CONFIG_SOC_SAMA7
1205+
.mcks:
1206+
.word 0
1207+
#endif
11351208
.saved_mckr:
11361209
.word 0
11371210
.saved_pllar:
@@ -1155,6 +1228,16 @@ ENDPROC(at91_pm_suspend_in_sram)
11551228
.word 0
11561229
.saved_mck4:
11571230
.word 0
1231+
.saved_mck5:
1232+
.word 0
1233+
.saved_mck6:
1234+
.word 0
1235+
.saved_mck7:
1236+
.word 0
1237+
.saved_mck8:
1238+
.word 0
1239+
.saved_mck9:
1240+
.word 0
11581241
#endif
11591242

11601243
ENTRY(at91_pm_suspend_in_sram_sz)

arch/arm/mach-davinci/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ menuconfig ARCH_DAVINCI
44
bool "TI DaVinci"
55
depends on ARCH_MULTI_V5
66
depends on CPU_LITTLE_ENDIAN
7+
select ARCH_DAVINCI_DA850
78
select CPU_ARM926T
89
select DAVINCI_TIMER
910
select ZONE_DMA

0 commit comments

Comments
 (0)