• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision1e8f1aff3cea72639bd50be54fb8b501ec0d2376 (tree)
Time2020-07-26 18:21:27
AuthorYoshinori Sato <ysato@user...>
CommiterYoshinori Sato

Log Message

Add ap-rx72m-0a

Change Summary

Incremental Difference

--- /dev/null
+++ b/arch/rx/dts/ap_rx72m_0a.dts
@@ -0,0 +1,80 @@
1+/dts-v1/;
2+/ {
3+ model = "Alphaproject AP-RX72M-0A";
4+ compatible = "alphaproject,ap-rx72m-0a";
5+ #address-cells = <1>;
6+ #size-cells = <1>;
7+ interrupt-parent = <&rxicu>;
8+
9+ chosen {
10+ stdout-path = "serial0:38400";
11+ };
12+ aliases {
13+ serial0 = &sci2;
14+ };
15+
16+ xclk: oscillator {
17+ #clock-cells = <0>;
18+ compatible = "fixed-clock";
19+ clock-frequency = <24000000>;
20+ clock-output-names = "xtal";
21+ };
22+ iclk: iclk {
23+ compatible = "renesas,rx-mul-clock";
24+ clocks = <&xclk>;
25+ #clock-cells = <0>;
26+ reg = <0x00080020 4>;
27+ renesas,offset = <24>;
28+ renesas,maxfreq = <100000000>;
29+ };
30+ pclk: pclk {
31+ compatible = "renesas,rx-mul-clock";
32+ clocks = <&xclk>;
33+ #clock-cells = <0>;
34+ reg = <0x00080020 4>;
35+ renesas,offset = <8>;
36+ renesas,maxfreq = <50000000>;
37+ };
38+ bclk: bclk {
39+ compatible = "renesas,rx-mul-clock";
40+ clocks = <&xclk>;
41+ #clock-cells = <0>;
42+ reg = <0x00080020 4>;
43+ renesas,offset = <16>;
44+ renesas,maxfreq = <50000000>;
45+ };
46+
47+ cpus {
48+ #address-cells = <1>;
49+ #size-cells = <0>;
50+ cpu@0 {
51+ compatible = "renesas,rx";
52+ clock-frequency = <240000000>;
53+ mem-cycle = <2>;
54+ };
55+ };
56+ memory@08000000 {
57+ device_type = "memory";
58+ reg = <0x08000000 0x01000000>;
59+ };
60+
61+ rxicu: interrupt-controller@87000 {
62+ compatible = "renesas,rx-icu";
63+ #interrupt-cells = <2>;
64+ interrupt-controller;
65+ reg = <0x00087000 0x600>;
66+ };
67+
68+ mtu: timer@00088600 {
69+ compatible = "renesas,rx-mtu2";
70+ reg = <0x00088600 0x600>;
71+ clock-frequency = <46875>;
72+ };
73+
74+ sci2: serial@0008a040 {
75+ compatible = "renesas,scif";
76+ reg = <0x0008a040 8>;
77+ interrupts = <214 0>, <215 0>, <216 0>, <217 0>;
78+ clock = <60000000>;
79+ };
80+};
--- /dev/null
+++ b/board/alphaproject/ap_rx72m_0a/Kconfig
@@ -0,0 +1,9 @@
1+if TARGET_AP_RX72M
2+
3+config SYS_BOARD
4+ default "alphaproject/ap_rx72m_0a"
5+
6+config SYS_CONFIG_NAME
7+ default "ap_rx72m_0a"
8+
9+endif
--- /dev/null
+++ b/board/alphaproject/ap_rx72m_0a/Makefile
@@ -0,0 +1,21 @@
1+#
2+# Copyright (C) 2014 Yoshinori Sato
3+#
4+# u-boot/board/hokuto/HSBRX63NC/Makefile
5+#
6+# This program is free software; you can redistribute it and/or
7+# modify it under the terms of the GNU General Public License as
8+# published by the Free Software Foundation; either version 2 of
9+# the License, or (at your option) any later version.
10+#
11+# This program is distributed in the hope that it will be useful,
12+# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+# GNU General Public License for more details.
15+#
16+# You should have received a copy of the GNU General Public License
17+# along with this program; if not, write to the Free Software
18+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
19+# MA 02111-1307 USA
20+
21+obj-y := ap_rx72m_0a.o lowlevel_init.o
--- /dev/null
+++ b/board/alphaproject/ap_rx72m_0a/ap_rx72m_0a.c
@@ -0,0 +1,94 @@
1+/*
2+ * Copyright (C) 2015 Yoshinori Sato
3+ * (C) Copyright 2000-2003
4+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5+ *
6+ * board/hokuto/HSBRX63N/hsbrx63n.c
7+ *
8+ * This program is free software; you can redistribute it and/or
9+ * modify it under the terms of the GNU General Public License as
10+ * published by the Free Software Foundation; either version 2 of
11+ * the License, or (at your option) any later version.
12+ *
13+ * This program is distributed in the hope that it will be useful,
14+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+ * GNU General Public License for more details.
17+ *
18+ * You should have received a copy of the GNU General Public License
19+ * along with this program; if not, write to the Free Software
20+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21+ * MA 02111-1307 USA
22+ */
23+
24+#include <common.h>
25+#include <mmc.h>
26+#include <spi.h>
27+#include <netdev.h>
28+#include <asm/io.h>
29+#include <asm/processor.h>
30+#include <asm/sections.h>
31+#include <linux/usb/r8a66597.h>
32+
33+#define PRCR *(volatile unsigned short *)0x000803fe
34+#define PFAOE0 *(volatile unsigned char *)0x0008c104
35+#define PFBCR0 *(volatile unsigned char *)0x0008c106
36+#define PFBCR1 *(volatile unsigned char *)0x0008c107
37+#define PFBCR2 *(volatile unsigned char *)0x0008c108
38+#define PFBCR3 *(volatile unsigned char *)0x0008c100
39+#define PORTA_DSCR *(volatile unsigned char *)0x0008c0ea
40+#define PORTB_DSCR *(volatile unsigned char *)0x0008c0eb
41+#define PORTD_DSCR *(volatile unsigned char *)0x0008c0ed
42+#define PORTE_DSCR *(volatile unsigned char *)0x0008c0ee
43+#define SYSCR0 *(volatile unsigned short *)0x00080006
44+#define SDIR *(volatile unsigned short *)0x00083c24
45+#define SDSR *(volatile unsigned char *)0x00083c50
46+#define SDMOD *(volatile unsigned short *)0x00083c48
47+#define SDTR *(volatile unsigned long *)0x00083c44
48+#define SDADR *(volatile unsigned char *)0x00083c40
49+#define SDRFCR *(volatile unsigned short *)0x00083c14
50+#define SDRFEN *(volatile unsigned char *)0x00083c16
51+#define SDCR *(volatile unsigned char *)0x00083c00
52+
53+static void sdram_init(void)
54+{
55+ int w;
56+
57+ PRCR = 0xa503;
58+ PFAOE0 = 0xff;
59+ PFBCR0 = 0x11;
60+ PFBCR1 = 0xd0;
61+ PFBCR2 = 0x00;
62+ PFBCR3 = 0xc0;
63+
64+ PORTA_DSCR = 0xff;
65+ PORTB_DSCR = 0xff;
66+ PORTD_DSCR = 0xff;
67+ PORTE_DSCR = 0xff;
68+ SYSCR0 = 0x5a03;
69+ for (w = 0; w < 0x10000; w++);
70+
71+ SDIR = 0x0020;
72+ while (SDSR != 0);
73+ SDIR |= 0x0001;
74+ while (SDSR != 0);
75+ SDMOD = 0x230;
76+ SDTR= 0x0031303;
77+ SDADR = 0x01;
78+ SDRFCR = 0x74e1;
79+ SDRFEN |= 0x01;
80+ SDCR |= 0x01;
81+
82+ memset(__bss_start, 0, (void *)&__bss_end - (void *)__bss_start);
83+}
84+
85+#define P12PFS *(volatile unsigned char *)0x0008c14a
86+#define P13PFS *(volatile unsigned char *)0x0008c14b
87+
88+int board_early_init_f(void)
89+{
90+ P12PFS = 0x0a;
91+ P13PFS = 0x0a;
92+ sdram_init();
93+ return 0;
94+}
--- /dev/null
+++ b/board/alphaproject/ap_rx72m_0a/lowlevel_init.S
@@ -0,0 +1,92 @@
1+/*
2+ * (C) Copyright 2020 Yoshinori Sato
3+ *
4+ * This program is free software; you can redistribute it and/or
5+ * modify it under the terms of the GNU General Public License as
6+ * published by the Free Software Foundation; either version 2 of
7+ * the License, or (at your option) any later version.
8+ *
9+ * This program is distributed in the hope that it will be useful,
10+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+ * GNU General Public License for more details.
13+ *
14+ * You should have received a copy of the GNU General Public License
15+ * along with this program; if not, write to the Free Software
16+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
17+ * MA 02111-1307 USA
18+ */
19+
20+#include <config.h>
21+#include <version.h>
22+
23+#include <asm/processor.h>
24+
25+#define PRCR 0x3fe
26+#define CKOCR 0x3e
27+#define HOCOCR 0x36
28+#define HOCOPCR 0xc294
29+#define MOFCR 0x8c293
30+#define MOSCWTCR 0xa2
31+#define MOSCCR 0x32
32+#define OSCOVFSR 0x3c
33+#define PLLCR 0x28
34+#define PLLCR2 0x2a
35+#define SCKCR 0x20
36+#define SCKCR2 0x24
37+#define SCKCR3 0x26
38+#define MEMWAIT 0x101c
39+/* PLL out:x10 PLL source:osc in: 24MHz = 240MHz */
40+#define PLLCR_VAL (0x13 << 8) | (0x00 << 4) | (0x00 << 0)
41+/* ICK=1 / PCKA = 2 / PCKB-D = 4 / FCK = 4 / BCK = 3 / UCK = 5 */
42+#define SCKCR_VAL \
43+ (2 << 28) | (0 << 24) | (1 << 22) | (9 << 16) | \
44+ (1 << 12) | (2 << 8) | (2 << 4) | (2 << 4)
45+
46+ .global lowlevel_init
47+
48+ .text
49+ .align 2
50+
51+lowlevel_init:
52+ mov.l #0x00080000, r1
53+ /* clock register unlock */
54+ add #PRCR, r1, r2
55+ mov.w #0xa50b, [r2]
56+ /* CLKOUT - main clock / output disable */
57+ mov.w #(1 << 15) | (2 << 8), CKOCR[r1]
58+ /* HOCO off */
59+ mov.b #0x01, HOCOCR[r1]
60+ add #HOCOPCR, r1, r2
61+ mov.b #0x01, [r2]
62+ /* Main OSC enable */
63+ add #MOFCR, r1, r2
64+ mov.b #0, [r2]
65+ add #MOSCWTCR, r1, r2
66+ mov.b #0x53, [r2]
67+ add #MOSCCR, r1, r2
68+ mov.b #0, [r2]
69+1: mov.b [r2], r3
70+ cmp #0, r3
71+ bne 1b
72+ /* Wait for main OSC stable */
73+2: btst #0, OSCOVFSR[r1].b
74+ beq 2b
75+ mov.w #PLLCR_VAL, PLLCR[r1]
76+ mov.b #0x00, PLLCR2[r1]
77+ /* Wait for PLL stable */
78+3: btst #2, OSCOVFSR[r1].b
79+ beq 3b
80+ mov.l #SCKCR_VAL, SCKCR[r1]
81+ mov.w #(4 << 4) | 0x0001, SCKCR2[r1]
82+ /* 1 wait */
83+ add #MEMWAIT, r1, r2
84+ mov.b #0x01, [r2]
85+4: mov.b [r2], r3
86+ cmp #1,r3
87+ bne 4b
88+ /* Source PLL */
89+ mov.w #(4 << 8), SCKCR3[r1]
90+ rts
91+
92+ .end
--- /dev/null
+++ b/board/alphaproject/ap_rx72m_0a/u-boot.lds
@@ -0,0 +1,94 @@
1+/*
2+ * Copyright (C) 2015 Yoshinori Sato
3+ *
4+ * See file CREDITS for list of people who contributed to this
5+ * project.
6+ *
7+ * This program is free software; you can redistribute it and/or
8+ * modify it under the terms of the GNU General Public License as
9+ * published by the Free Software Foundation; either version 2 of
10+ * the License, or (at your option) any later version.
11+ *
12+ * This program is distributed in the hope that it will be useful,
13+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+ * GNU General Public License for more details.
16+ *
17+ * You should have received a copy of the GNU General Public License
18+ * along with this program; if not, write to the Free Software
19+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20+ * MA 02111-1307 USA
21+ */
22+
23+#include <config.h>
24+OUTPUT_FORMAT("elf32-rx-linux")
25+OUTPUT_ARCH(rx)
26+ENTRY(_start)
27+
28+MEMORY {
29+ iram : ORIGIN = 0x0000100, LENGTH = 512K - 256
30+ sdram : ORIGIN = 0x08000000, LENGTH = 16M
31+ irom : ORIGIN = 0xfffc0000, LENGTH = 256K - 128
32+ vector : ORIGIN = 0xffffff80, LENGTH = 128
33+}
34+
35+SECTIONS
36+{
37+ .text :
38+ {
39+ PROVIDE (_ftext = .);
40+ PROVIDE (_fcode = .);
41+ PROVIDE (_start = .);
42+
43+ KEEP(arch/rx/cpu/rxv2/start.o (.text))
44+ *(.text)
45+ . = ALIGN(4);
46+ PROVIDE (_ecode = .);
47+ } > irom
48+ .rodata :
49+ {
50+ *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
51+ . = ALIGN(4);
52+ } > irom
53+ .u_boot_list : {
54+ KEEP(*(SORT(.u_boot_list*)));
55+ } > irom
56+ PROVIDE (_etext = .);
57+
58+ . = 0xffffff80;
59+ .vector :
60+ {
61+ *(.vector);
62+ } > vector
63+
64+ PROVIDE (__ram_vec = 0x00000000);
65+
66+ .data :
67+ {
68+ PROVIDE (_fdata = .);
69+ *(.data)
70+ *(.stack)
71+ . = ALIGN(4);
72+ PROVIDE (_edata = .);
73+ } > iram AT>irom
74+ _iram_start = _etext + SIZEOF(.data);
75+ .iram.text :
76+ {
77+ _iram_text = .;
78+ *(.iram.text)
79+ _iram_text_end = .;
80+ } > iram AT>irom
81+
82+ .bss :
83+ {
84+ PROVIDE (__bss_start = .);
85+ *(.bss*)
86+ . = ALIGN(4);
87+ } > iram
88+ PROVIDE (__bss_end = .);
89+ PROVIDE (__init_end = .);
90+
91+ PROVIDE (__stack = 0x00040000);
92+
93+ PROVIDE (_end = .);
94+}
--- /dev/null
+++ b/configs/ap_rx72m_0a_defconfig
@@ -0,0 +1,7 @@
1+CONFIG_RX=y
2+CONFIG_SYS_TEXT_BASE=0xfffc0000
3+CONFIG_TARGET_AP_RX72M=y
4+CONFIG_OF_CONTROL=y
5+# CONFIG_NET is not set
6+CONFIG_TIMER=y
7+CONFIG_RX_TIMER=y
--- /dev/null
+++ b/include/configs/ap_rx72m_0a.h
@@ -0,0 +1,97 @@
1+/*
2+ * Configuation settings for AP-RX64M-0A
3+ *
4+ * Copyright (C) 2011 Yoshinori Sato
5+ *
6+ * See file CREDITS for list of people who contributed to this
7+ * project.
8+ *
9+ * This program is free software; you can redistribute it and/or
10+ * modify it under the terms of the GNU General Public License as
11+ * published by the Free Software Foundation; either version 2 of
12+ * the License, or (at your option) any later version.
13+ *
14+ * This program is distributed in the hope that it will be useful,
15+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+ * GNU General Public License for more details.
18+ *
19+ * You should have received a copy of the GNU General Public License
20+ * along with this program; if not, write to the Free Software
21+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
22+ * MA 02111-1307 USA
23+ */
24+
25+#ifndef __AP_RX64M_0A_H
26+#define __AP_RX64M_0A_H
27+
28+/* SCI */
29+#define CONFIG_SCIF_A 1
30+#define CONFIG_SCIF_CONSOLE 1
31+#define CONFIG_CONS_SCIF2 1
32+
33+/* memory */
34+#define CONFIG_SYS_SRAM_BASE 0x00000000
35+#define CONFIG_SYS_SRAM_SIZE 0x00080000
36+#define CONFIG_SYS_SDRAM_BASE 0x08000000
37+#define CONFIG_SYS_SDRAM_SIZE (16 * 1024 * 1024)
38+#define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE
39+#define CONFIG_SYS_MEMTEST_END CONFIG_SYS_SDRAM_SIZE
40+#define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_MEMTEST_START + 0x100000)
41+#define CONFIG_SYS_MONITOR_BASE 0x8000 /*(CONFIG_SYS_SDRAM_BASE)*/
42+#define CONFIG_SYS_MONITOR_LEN (256 * 1024)
43+#define CONFIG_SYS_MALLOC_LEN (64 * 1024)
44+#define CONFIG_SYS_GBL_DATA_SIZE 256
45+#define CONFIG_SYS_BOOTMAPSZ (8 * 1024 * 1024)
46+#define CONFIG_SYS_MAX_FLASH_SECT 128
47+#define CONFIG_SYS_MAX_FLASH_BANKS 3
48+#define CONFIG_SYS_FLASH_PROTECTION
49+#define CONFIG_SYS_FLASH_SIZE 0x00400000
50+
51+#define CONFIG_SYS_CLK_FREQ 240000000
52+#define CONFIG_SH_SCIF_CLK_FREQ CONFIG_SYS_CLK_FREQ
53+#define CONFIG_SYS_HZ 1000
54+
55+#if defined(CONFIG_CMD_NET)
56+#define CONFIG_SH_ETHER 1
57+#define CONFIG_SH_ETHER_USE_PORT (0)
58+#define CONFIG_SH_ETHER_PHY_ADDR (0x00)
59+#define CONFIG_SH_ETHER_PHY_MODE PHY_INTERFACE_MODE_RMII
60+#define CONFIG_MII 1
61+#define CONFIG_BITBANGMII 1
62+#define CONFIG_BITBANGMII_MULTI 1
63+#define CONFIG_PHYLIB 1
64+#define CONFIG_PHY_SMSC 1
65+#endif
66+
67+#if defined(CONFIG_CMD_USB)
68+#define CONFIG_USB_R8A66597_HCD
69+#define CONFIG_R8A66597_BASE_ADDR 0x000a0200
70+#define CONFIG_R8A66597_ENDIAN 0x0000 /* little */
71+#define CONFIG_SUPERH_ON_CHIP_R8A66597
72+#define CONFIG_R8A66597_VBUS_NEG
73+#define CONFIG_USB_STORAGE
74+#endif
75+
76+#if 0
77+#define CONFIG_USB_GADGET
78+#define CONFIG_USB_GADGET_R8A66597
79+#define CONFIG_R8A66597_UDC_BASE 0x000a0000
80+#define CONFIG_USB_GADGET_SERIAL
81+#define CONFIG_USB_TTY_CDC
82+#endif
83+
84+#if defined(CONFIG_CMD_MMC_SPI) || defined(CONFIG_CMD_SPI)
85+#define CONFIG_RX_RSPI
86+#define CONFIG_RSPI_BASE 0x000883a0
87+#define CONFIG_RSPI_CLK CONFIG_SYS_CLK_FREQ
88+#endif
89+#if defined(CONFIG_CMD_MMC_SPI)
90+#define CONFIG_MMC
91+#define CONFIG_MMC_SPI
92+#define CONFIG_GENERIC_MMC
93+#endif
94+
95+/*#define CONFIG_RXRTC*/
96+
97+#endif