Resguardo inicial

This commit is contained in:
lastdragon
2026-09-06 12:53:21 -06:00
parent 662efe3c2a
commit ad2088d178
94853 changed files with 43200404 additions and 0 deletions
+50
View File
@@ -0,0 +1,50 @@
# SPDX-License-Identifier: GPL-2.0
if ECONET
choice
prompt "EcoNet SoC selection"
default SOC_ECONET_EN751221
help
Select EcoNet MIPS SoC type. Individual SoCs within a family are
very similar, so is it enough to select the right family, and
then customize to the specific SoC using the device tree only.
config SOC_ECONET_EN751221
bool "EN751221 family"
select COMMON_CLK
select ECONET_EN751221_INTC
select HAVE_PCI
select IRQ_MIPS_CPU
select PCI_DRIVERS_GENERIC
select SMP
select SMP_UP
select SYS_SUPPORTS_SMP
help
The EN751221 family includes EN7512, RN7513, EN7521, EN7526.
They are based on single core MIPS 34Kc processors. To boot
this kernel, you will need a device tree such as
MIPS_RAW_APPENDED_DTB=y, and a root filesystem.
endchoice
choice
prompt "Devicetree selection"
default DTB_ECONET_NONE
help
Select the devicetree.
config DTB_ECONET_NONE
bool "None"
config DTB_ECONET_SMARTFIBER_XP8421_B
bool "EN751221 SmartFiber XP8421-B"
depends on SOC_ECONET_EN751221
select BUILTIN_DTB
help
The SmartFiber XP8421-B is a device based on the EN751221 SoC.
It has 512MB of memory and 256MB of NAND flash. This kernel
needs only an appended initramfs to boot. It can be loaded
through XMODEM and booted from memory in the bootloader, or
it can be packed in tclinux.trx format and written to flash.
endchoice
endif
+2
View File
@@ -0,0 +1,2 @@
obj-y := init.o
+5
View File
@@ -0,0 +1,5 @@
# To address a 7.2MB kernel size limit in the EcoNet SDK bootloader,
# we put the load address well above where the bootloader loads and then use
# zboot. So please set CONFIG_ZBOOT_LOAD_ADDRESS to the address where your
# bootloader actually places the kernel.
load-$(CONFIG_ECONET) += 0xffffffff81000000
+78
View File
@@ -0,0 +1,78 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* EcoNet setup code
*
* Copyright (C) 2025 Caleb James DeLisle <cjd@cjdns.fr>
*/
#include <linux/init.h>
#include <linux/of_clk.h>
#include <linux/irqchip.h>
#include <asm/addrspace.h>
#include <asm/io.h>
#include <asm/bootinfo.h>
#include <asm/time.h>
#include <asm/prom.h>
#include <asm/smp-ops.h>
#include <asm/reboot.h>
#define CR_AHB_RSTCR ((void __iomem *)CKSEG1ADDR(0x1fb00040))
#define RESET BIT(31)
#define UART_BASE CKSEG1ADDR(0x1fbf0003)
#define UART_REG_SHIFT 2
static void hw_reset(char *command)
{
iowrite32(RESET, CR_AHB_RSTCR);
}
/* 1. Bring up early printk. */
void __init prom_init(void)
{
setup_8250_early_printk_port(UART_BASE, UART_REG_SHIFT, 0);
_machine_restart = hw_reset;
}
/* 2. Parse the DT and find memory */
void __init plat_mem_setup(void)
{
void *dtb;
set_io_port_base(KSEG1);
dtb = get_fdt();
if (!dtb)
panic("no dtb found");
__dt_setup_arch(dtb);
early_init_dt_scan_memory();
}
/* 3. Overload __weak device_tree_init(), add SMP_UP ops */
void __init device_tree_init(void)
{
unflatten_and_copy_device_tree();
register_up_smp_ops();
}
const char *get_system_type(void)
{
return "EcoNet-EN75xx";
}
/* 4. Initialize the IRQ subsystem */
void __init arch_init_irq(void)
{
irqchip_init();
}
/* 5. Timers */
void __init plat_time_init(void)
{
of_clk_init(NULL);
timer_probe();
}