CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=4096
CONFIG_CEVT_R4K=y
-CONFIG_CLKDEV_LOOKUP=y
CONFIG_CLONE_BACKWARDS=y
CONFIG_COMPAT_32BIT_TIME=y
CONFIG_CONSOLE_LOGLEVEL_DEFAULT=15
CONFIG_DMA_NONCOHERENT_CACHE_SYNC=y
CONFIG_DTC=y
CONFIG_EARLY_PRINTK=y
+CONFIG_EARLY_PRINTK_8250=y
CONFIG_EFI_EARLYCON=y
CONFIG_ETHERNET_PACKET_MANGLE=y
CONFIG_EXTRA_FIRMWARE="rtl838x_phy/rtl838x_8214fc.fw rtl838x_phy/rtl838x_8218b.fw rtl838x_phy/rtl838x_8380.fw"
CONFIG_GENERIC_LIB_UCMPDI2=y
CONFIG_GENERIC_PCI_IOMAP=y
CONFIG_GENERIC_PHY=y
+CONFIG_GENERIC_PINCONF=y
+CONFIG_GENERIC_PINCTRL_GROUPS=y
+CONFIG_GENERIC_PINMUX_FUNCTIONS=y
CONFIG_GENERIC_SCHED_CLOCK=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_PHYLIB=y
CONFIG_PHYLINK=y
CONFIG_PINCTRL=y
-# CONFIG_PINCTRL_SINGLE is not set
CONFIG_POWER_RESET=y
CONFIG_POWER_RESET_SYSCON=y
CONFIG_PSB6970_PHY=y
CONFIG_TARGET_ISA_REV=2
CONFIG_TICK_CPU_ACCOUNTING=y
CONFIG_TINY_SRCU=y
+CONFIG_USE_GENERIC_EARLY_PRINTK_8250=y
CONFIG_USE_OF=y
CONFIG_ZLIB_DEFLATE=y
CONFIG_ZLIB_INFLATE=y
#include <mach-rtl83xx.h>
extern char arcs_cmdline[];
-const void *fdt;
extern const char __appended_dtb;
-//extern int __init rtl838x_serial_init(void);
-
-void prom_console_init(void)
-{
- /* UART 16550A is initialized by the bootloader */
-}
-
-#ifdef CONFIG_EARLY_PRINTK
-#define rtl83xx_r8(reg) __raw_readb(reg)
-#define rtl83xx_w8(val, reg) __raw_writeb(val, reg)
-
-void unregister_prom_console(void)
-{
-
-}
-
-void disable_early_printk(void)
-{
-
-}
-
-void prom_putchar(char c)
-{
- unsigned int retry = 0;
-
- do {
- if (retry++ >= 30000) {
- /* Reset Tx FIFO */
- rtl83xx_w8(TXRST | CHAR_TRIGGER_14, UART0_FCR);
- return;
- }
- } while ((rtl83xx_r8(UART0_LSR) & LSR_THRE) == TxCHAR_AVAIL);
-
- /* Send Character */
- rtl83xx_w8(c, UART0_THR);
-}
-
-char prom_getchar(void)
-{
- return '\0';
-}
-#endif
struct rtl83xx_soc_info soc_info;
+const void *fdt;
const char *get_system_type(void)
{
return soc_info.name;
}
-
void __init prom_free_prom_memory(void)
{
void __init device_tree_init(void)
{
- pr_info("%s called\r\n", __func__);
if (!fdt_check_header(&__appended_dtb)) {
fdt = &__appended_dtb;
pr_info("Using appended Device Tree.\n");
pr_info("Kernel command line: %s\n", arcs_cmdline);
}
-/* Do basic initialization */
void __init prom_init(void)
{
uint32_t model;
- pr_info("%s called\n", __func__);
- soc_info.sw_base = RTL838X_SW_BASE;
+ /* uart0 */
+ setup_8250_early_printk_port(0xb8002000, 2, 0);
- model = sw_r32(RTL838X_MODEL_NAME_INFO);
- pr_info("RTL838X model is %x\n", model);
- model = model >> 16 & 0xFFFF;
+ soc_info.sw_base = RTL838X_SW_BASE;
- if ((model != 0x8328) && (model != 0x8330) && (model != 0x8332)
- && (model != 0x8380) && (model != 0x8382)) {
- model = sw_r32(RTL839X_MODEL_NAME_INFO);
- pr_info("RTL839X model is %x\n", model);
- model = model >> 16 & 0xFFFF;
- }
+ model = sw_r32(RTL838X_MODEL_NAME_INFO) >> 16;
+ if (model != 0x8328 && model != 0x8330 && model != 0x8332 &&
+ model != 0x8380 && model != 0x8382)
+ model = sw_r32(RTL839X_MODEL_NAME_INFO) >> 16;
soc_info.id = model;
extern int rtl838x_serial_init(void);
extern struct rtl83xx_soc_info soc_info;
-struct clk {
- struct clk_lookup cl;
- unsigned long rate;
-};
-
-struct clk cpu_clk;
-
u32 pll_reset_value;
static void rtl838x_restart(char *command)
static void rtl838x_halt(void)
{
pr_info("System halted.\n");
- while
- (1);
-}
-
-static void __init rtl838x_setup(void)
-{
- unsigned int val;
-
- pr_info("Registering _machine_restart\n");
- _machine_restart = rtl838x_restart;
- _machine_halt = rtl838x_halt;
-
- val = rtl83xx_r32((volatile void *)0xBB0040000);
- if (val == 3)
- pr_info("PCI device found\n");
- else
- pr_info("NO PCI device found\n");
-
- /* Setup System LED. Bit 15 (14 for RTL8390) then allows to toggle it */
- if (soc_info.family == RTL8380_FAMILY_ID)
- sw_w32_mask(0, 3 << 16, RTL838X_LED_GLB_CTRL);
- else
- sw_w32_mask(0, 3 << 15, RTL839X_LED_GLB_CTRL);
+ while(1);
}
void __init plat_mem_setup(void)
{
void *dtb;
- pr_info("%s called\n", __func__);
-
set_io_port_base(KSEG1);
+ _machine_restart = rtl838x_restart;
+ _machine_halt = rtl838x_halt;
if (fw_passed_dtb) /* UHI interface */
dtb = (void *)fw_passed_dtb;
* parsed resulting in our memory appearing
*/
__dt_setup_arch(dtb);
-
- rtl838x_setup();
}
void __init plat_time_init(void)
{
- u32 freq = 500000000;
struct device_node *np;
- struct clk *clk = &cpu_clk;
+ u32 freq = 500000000;
np = of_find_node_by_name(NULL, "cpus");
if (!np) {
of_node_put(np);
}
- clk->rate = freq;
-
- if (IS_ERR(clk))
- panic("unable to get CPU clock, err=%ld", PTR_ERR(clk));
-
- pr_info("CPU Clock: %ld MHz\n", clk->rate / 1000000);
mips_hpt_frequency = freq / 2;
pll_reset_value = sw_r32(RTL838X_PLL_CML_CTRL);
- pr_info("PLL control register: %x\n", pll_reset_value);
-
- /* With the info from the command line and cpu-freq we can setup the console */
rtl838x_serial_init();
}
===================================================================
--- linux-5.4.77.orig/arch/mips/Kconfig
+++ linux-5.4.77/arch/mips/Kconfig
-@@ -630,6 +630,28 @@ config RALINK
+@@ -630,6 +630,30 @@ config RALINK
select ARCH_HAS_RESET_CONTROLLER
select RESET_CONTROLLER
+ select SYS_SUPPORTS_MULTITHREADING
+ select SYS_SUPPORTS_VPE_LOADER
+ select SYS_HAS_EARLY_PRINTK
++ select SYS_HAS_EARLY_PRINTK_8250
++ select USE_GENERIC_EARLY_PRINTK_8250
+ select SWAP_IO_SPACE
+ select BOOT_RAW
+ select PINCTRL