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
+34
View File
@@ -0,0 +1,34 @@
# SPDX-License-Identifier: GPL-2.0-only
#
# Sophgo SoC drivers
#
if ARCH_SOPHGO || COMPILE_TEST
menu "Sophgo SoC drivers"
config SOPHGO_CV1800_RTCSYS
tristate "Sophgo CV1800 RTC MFD"
select MFD_CORE
help
If you say yes here you get support the RTC MFD driver for Sophgo
CV1800 series SoC. The RTC module comprises a 32kHz oscillator,
Power-on-Reset (PoR) sub-module, HW state machine to control chip
power-on, power-off and reset. Furthermore, the 8051 subsystem is
located within RTCSYS including associated SRAM block.
This driver can also be built as a module. If so, the module will be
called cv1800-rtcsys.
config SOPHGO_SG2044_TOPSYS
tristate "Sophgo SG2044 TOP syscon driver"
select MFD_CORE
help
This is the core driver for the Sophgo SG2044 TOP system
controller device. This driver provide PLL clock device
for the SoC.
This driver can also be built as a module. If so, the module
will be called sg2044-topsys.
endmenu
endif
+4
View File
@@ -0,0 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
obj-$(CONFIG_SOPHGO_CV1800_RTCSYS) += cv1800-rtcsys.o
obj-$(CONFIG_SOPHGO_SG2044_TOPSYS) += sg2044-topsys.o
@@ -0,0 +1,63 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Driver for Sophgo CV1800 series SoC RTC subsystem
*
* The RTC module comprises a 32kHz oscillator, Power-on-Reset (PoR) sub-module,
* HW state machine to control chip power-on, power-off and reset. Furthermore,
* the 8051 subsystem is located within RTCSYS including associated SRAM block.
*
* Copyright (C) 2025 Alexander Sverdlin <alexander.sverdlin@gmail.com>
*
*/
#include <linux/mfd/core.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/property.h>
static struct resource cv1800_rtcsys_irq_resources[] = {
DEFINE_RES_IRQ_NAMED(0, "alarm"),
};
static const struct mfd_cell cv1800_rtcsys_subdev[] = {
{
.name = "cv1800b-rtc",
.num_resources = 1,
.resources = &cv1800_rtcsys_irq_resources[0],
},
};
static int cv1800_rtcsys_probe(struct platform_device *pdev)
{
int irq;
irq = platform_get_irq_byname(pdev, "alarm");
if (irq < 0)
return irq;
cv1800_rtcsys_irq_resources[0].start = irq;
cv1800_rtcsys_irq_resources[0].end = irq;
return devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO,
cv1800_rtcsys_subdev,
ARRAY_SIZE(cv1800_rtcsys_subdev),
NULL, 0, NULL);
}
static const struct of_device_id cv1800_rtcsys_of_match[] = {
{ .compatible = "sophgo,cv1800b-rtc" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, cv1800_rtcsys_of_match);
static struct platform_driver cv1800_rtcsys_mfd = {
.probe = cv1800_rtcsys_probe,
.driver = {
.name = "cv1800_rtcsys",
.of_match_table = cv1800_rtcsys_of_match,
},
};
module_platform_driver(cv1800_rtcsys_mfd);
MODULE_AUTHOR("Alexander Sverdlin <alexander.sverdlin@gmail.com>");
MODULE_DESCRIPTION("Sophgo CV1800 series SoC RTC subsystem driver");
MODULE_LICENSE("GPL");
@@ -0,0 +1,44 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Sophgo SG2044 multi-function system controller driver
*
* Copyright (C) 2025 Inochi Amaoto <inochiama@gmail.com>
*/
#include <linux/mfd/core.h>
#include <linux/module.h>
#include <linux/property.h>
#include <linux/resource.h>
static const struct mfd_cell sg2044_topsys_subdev[] = {
{
.name = "sg2044-pll",
},
};
static int sg2044_topsys_probe(struct platform_device *pdev)
{
return devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO,
sg2044_topsys_subdev,
ARRAY_SIZE(sg2044_topsys_subdev),
NULL, 0, NULL);
}
static const struct of_device_id sg2044_topsys_of_match[] = {
{ .compatible = "sophgo,sg2044-top-syscon" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, sg2044_topsys_of_match);
static struct platform_driver sg2044_topsys_driver = {
.probe = sg2044_topsys_probe,
.driver = {
.name = "sg2044-topsys",
.of_match_table = sg2044_topsys_of_match,
},
};
module_platform_driver(sg2044_topsys_driver);
MODULE_AUTHOR("Inochi Amaoto <inochiama@gmail.com>");
MODULE_DESCRIPTION("Sophgo SG2044 multi-function system controller driver");
MODULE_LICENSE("GPL");