From: Nobuhiro Iwamatsu Date: Thu, 31 Mar 2016 18:51:33 +0000 (+0900) Subject: ARM: rmobile: Move rcar-gen2-common to rcar-common X-Git-Tag: v2016.09-rc2~2^2~12 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a7da6f8c3d6d685af9426cdc2357d2e66cff2875;p=oweals%2Fu-boot.git ARM: rmobile: Move rcar-gen2-common to rcar-common To common use of rcar-gen2-common directory in the R-Car SoCs, and change from rcar-gen2-common to rcar-common. Signed-off-by: Nobuhiro Iwamatsu --- diff --git a/board/renesas/alt/Makefile b/board/renesas/alt/Makefile index 6904e39b12..22ab1f43d9 100644 --- a/board/renesas/alt/Makefile +++ b/board/renesas/alt/Makefile @@ -6,4 +6,4 @@ # SPDX-License-Identifier: GPL-2.0 # -obj-y := alt.o qos.o ../rcar-gen2-common/common.o +obj-y := alt.o qos.o ../rcar-common/common.o diff --git a/board/renesas/gose/Makefile b/board/renesas/gose/Makefile index 2dac748efb..e09ae1e414 100644 --- a/board/renesas/gose/Makefile +++ b/board/renesas/gose/Makefile @@ -6,4 +6,4 @@ # SPDX-License-Identifier: GPL-2.0 # -obj-y := gose.o qos.o ../rcar-gen2-common/common.o +obj-y := gose.o qos.o ../rcar-common/common.o diff --git a/board/renesas/koelsch/Makefile b/board/renesas/koelsch/Makefile index c10bba5682..15f111c504 100644 --- a/board/renesas/koelsch/Makefile +++ b/board/renesas/koelsch/Makefile @@ -6,4 +6,4 @@ # SPDX-License-Identifier: GPL-2.0 # -obj-y := koelsch.o qos.o ../rcar-gen2-common/common.o +obj-y := koelsch.o qos.o ../rcar-common/common.o diff --git a/board/renesas/porter/Makefile b/board/renesas/porter/Makefile index dbf32e9c54..09c07ef5d4 100644 --- a/board/renesas/porter/Makefile +++ b/board/renesas/porter/Makefile @@ -7,4 +7,4 @@ # SPDX-License-Identifier: GPL-2.0 # -obj-y := porter.o qos.o ../rcar-gen2-common/common.o +obj-y := porter.o qos.o ../rcar-common/common.o diff --git a/board/renesas/rcar-common/common.c b/board/renesas/rcar-common/common.c new file mode 100644 index 0000000000..be2b945462 --- /dev/null +++ b/board/renesas/rcar-common/common.c @@ -0,0 +1,59 @@ +/* + * board/renesas/rcar-common/common.c + * + * Copyright (C) 2013 Renesas Electronics Corporation + * Copyright (C) 2013 Nobuhiro Iwamatsu + * + * SPDX-License-Identifier: GPL-2.0 + */ + +#include +#include +#include +#include +#include + +#define TSTR0 0x04 +#define TSTR0_STR0 0x01 + +static struct mstp_ctl mstptbl[] = { + { SMSTPCR0, MSTP0_BITS, CONFIG_SMSTP0_ENA, + RMSTPCR0, MSTP0_BITS, CONFIG_RMSTP0_ENA }, + { SMSTPCR1, MSTP1_BITS, CONFIG_SMSTP1_ENA, + RMSTPCR1, MSTP1_BITS, CONFIG_RMSTP1_ENA }, + { SMSTPCR2, MSTP2_BITS, CONFIG_SMSTP2_ENA, + RMSTPCR2, MSTP2_BITS, CONFIG_RMSTP2_ENA }, + { SMSTPCR3, MSTP3_BITS, CONFIG_SMSTP3_ENA, + RMSTPCR3, MSTP3_BITS, CONFIG_RMSTP3_ENA }, + { SMSTPCR4, MSTP4_BITS, CONFIG_SMSTP4_ENA, + RMSTPCR4, MSTP4_BITS, CONFIG_RMSTP4_ENA }, + { SMSTPCR5, MSTP5_BITS, CONFIG_SMSTP5_ENA, + RMSTPCR5, MSTP5_BITS, CONFIG_RMSTP5_ENA }, + /* No MSTP6 */ + { SMSTPCR7, MSTP7_BITS, CONFIG_SMSTP7_ENA, + RMSTPCR7, MSTP7_BITS, CONFIG_RMSTP7_ENA }, + { SMSTPCR8, MSTP8_BITS, CONFIG_SMSTP8_ENA, + RMSTPCR8, MSTP8_BITS, CONFIG_RMSTP8_ENA }, + { SMSTPCR9, MSTP9_BITS, CONFIG_SMSTP9_ENA, + RMSTPCR9, MSTP9_BITS, CONFIG_RMSTP9_ENA }, + { SMSTPCR10, MSTP10_BITS, CONFIG_SMSTP10_ENA, + RMSTPCR10, MSTP10_BITS, CONFIG_RMSTP10_ENA }, + { SMSTPCR11, MSTP11_BITS, CONFIG_SMSTP1_ENA, + RMSTPCR11, MSTP11_BITS, CONFIG_RMSTP11_ENA }, +}; + +void arch_preboot_os(void) +{ + int i; + + /* stop TMU0 */ + mstp_clrbits_le32(TMU_BASE + TSTR0, TMU_BASE + TSTR0, TSTR0_STR0); + + /* Stop module clock */ + for (i = 0; i < ARRAY_SIZE(mstptbl); i++) { + mstp_setclrbits_le32(mstptbl[i].s_addr, mstptbl[i].s_dis, + mstptbl[i].s_ena); + mstp_setclrbits_le32(mstptbl[i].r_addr, mstptbl[i].r_dis, + mstptbl[i].r_ena); + } +} diff --git a/board/renesas/rcar-gen2-common/common.c b/board/renesas/rcar-gen2-common/common.c deleted file mode 100644 index 0103f42bd5..0000000000 --- a/board/renesas/rcar-gen2-common/common.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * board/renesas/rcar-gen2-common/common.c - * - * Copyright (C) 2013 Renesas Electronics Corporation - * Copyright (C) 2013 Nobuhiro Iwamatsu - * - * SPDX-License-Identifier: GPL-2.0 - */ - -#include -#include -#include -#include -#include - -#define TSTR0 0x04 -#define TSTR0_STR0 0x01 - -static struct mstp_ctl mstptbl[] = { - { SMSTPCR0, MSTP0_BITS, CONFIG_SMSTP0_ENA, - RMSTPCR0, MSTP0_BITS, CONFIG_RMSTP0_ENA }, - { SMSTPCR1, MSTP1_BITS, CONFIG_SMSTP1_ENA, - RMSTPCR1, MSTP1_BITS, CONFIG_RMSTP1_ENA }, - { SMSTPCR2, MSTP2_BITS, CONFIG_SMSTP2_ENA, - RMSTPCR2, MSTP2_BITS, CONFIG_RMSTP2_ENA }, - { SMSTPCR3, MSTP3_BITS, CONFIG_SMSTP3_ENA, - RMSTPCR3, MSTP3_BITS, CONFIG_RMSTP3_ENA }, - { SMSTPCR4, MSTP4_BITS, CONFIG_SMSTP4_ENA, - RMSTPCR4, MSTP4_BITS, CONFIG_RMSTP4_ENA }, - { SMSTPCR5, MSTP5_BITS, CONFIG_SMSTP5_ENA, - RMSTPCR5, MSTP5_BITS, CONFIG_RMSTP5_ENA }, - /* No MSTP6 */ - { SMSTPCR7, MSTP7_BITS, CONFIG_SMSTP7_ENA, - RMSTPCR7, MSTP7_BITS, CONFIG_RMSTP7_ENA }, - { SMSTPCR8, MSTP8_BITS, CONFIG_SMSTP8_ENA, - RMSTPCR8, MSTP8_BITS, CONFIG_RMSTP8_ENA }, - { SMSTPCR9, MSTP9_BITS, CONFIG_SMSTP9_ENA, - RMSTPCR9, MSTP9_BITS, CONFIG_RMSTP9_ENA }, - { SMSTPCR10, MSTP10_BITS, CONFIG_SMSTP10_ENA, - RMSTPCR10, MSTP10_BITS, CONFIG_RMSTP10_ENA }, - { SMSTPCR11, MSTP11_BITS, CONFIG_SMSTP1_ENA, - RMSTPCR11, MSTP11_BITS, CONFIG_RMSTP11_ENA }, -}; - -void arch_preboot_os(void) -{ - int i; - - /* stop TMU0 */ - mstp_clrbits_le32(TMU_BASE + TSTR0, TMU_BASE + TSTR0, TSTR0_STR0); - - /* Stop module clock */ - for (i = 0; i < ARRAY_SIZE(mstptbl); i++) { - mstp_setclrbits_le32(mstptbl[i].s_addr, mstptbl[i].s_dis, - mstptbl[i].s_ena); - mstp_setclrbits_le32(mstptbl[i].r_addr, mstptbl[i].r_dis, - mstptbl[i].r_ena); - } -} diff --git a/board/renesas/silk/Makefile b/board/renesas/silk/Makefile index e6eea6142e..8916a8d961 100644 --- a/board/renesas/silk/Makefile +++ b/board/renesas/silk/Makefile @@ -7,4 +7,4 @@ # SPDX-License-Identifier: GPL-2.0 # -obj-y := silk.o qos.o ../rcar-gen2-common/common.o +obj-y := silk.o qos.o ../rcar-common/common.o diff --git a/board/renesas/stout/Makefile b/board/renesas/stout/Makefile index e78f80c361..cb7c61d020 100644 --- a/board/renesas/stout/Makefile +++ b/board/renesas/stout/Makefile @@ -8,4 +8,4 @@ # SPDX-License-Identifier: GPL-2.0 # -obj-y := stout.o cpld.o qos.o ../rcar-gen2-common/common.o +obj-y := stout.o cpld.o qos.o ../rcar-common/common.o