arch/arm/mach-orion5x/net2big-setup.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-orion5x/net2big-setup.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-orion5x/net2big-setup.c- Extension
.c- Size
- 12059 bytes
- Lines
- 445
- Domain
- Architecture Layer
- Bucket
- arch/arm
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/init.hlinux/platform_device.hlinux/mtd/physmap.hlinux/mv643xx_eth.hlinux/leds.hlinux/gpio_keys.hlinux/input.hlinux/i2c.hlinux/ata_platform.hlinux/gpio.hlinux/gpio/machine.hlinux/delay.hasm/mach-types.hasm/mach/arch.hplat/orion-gpio.hcommon.hmpp.horion5x.h
Detected Declarations
function net2big_sata_power_initfunction net2big_gpio_leds_initfunction net2big_power_offfunction net2big_init
Annotated Snippet
gpio_get_value(NET2BIG_GPIO_SATA1_POWER)) {
return;
}
/*
* SATA power up on both disk is done by pulling high the CPLD power
* request line. The 300ms delay is related to the CPLD clock and is
* needed to be sure that the CPLD has take into account the low line
* status.
*/
msleep(300);
gpio_set_value(NET2BIG_GPIO_SATA_POWER_REQ, 1);
pr_info("net2big: power up SATA hard disks\n");
return;
err_free_2:
gpio_free(NET2BIG_GPIO_SATA1_POWER);
err_free_1:
gpio_free(NET2BIG_GPIO_SATA0_POWER);
return;
}
/*****************************************************************************
* GPIO LEDs
****************************************************************************/
/*
* The power front LEDs (blue and red) and SATA red LEDs are controlled via a
* single GPIO line and are compatible with the leds-gpio driver.
*
* The SATA blue LEDs have some hardware blink capabilities which are detailed
* in the following array:
*
* SATAx blue LED | SATAx activity | LED state
* | |
* 0 | 0 | blink (rate 300ms)
* 1 | 0 | off
* ? | 1 | on
*
* Notes: The blue and the red front LED's can't be on at the same time.
* Blue LED have priority.
*/
#define NET2BIG_GPIO_PWR_RED_LED 6
#define NET2BIG_GPIO_PWR_BLUE_LED 16
#define NET2BIG_GPIO_PWR_LED_BLINK_STOP 7
#define NET2BIG_GPIO_SATA0_RED_LED 11
#define NET2BIG_GPIO_SATA1_RED_LED 10
#define NET2BIG_GPIO_SATA0_BLUE_LED 17
#define NET2BIG_GPIO_SATA1_BLUE_LED 13
static struct gpio_led net2big_leds[] = {
{
.name = "net2big:red:power",
},
{
.name = "net2big:blue:power",
},
{
.name = "net2big:red:sata0",
},
{
.name = "net2big:red:sata1",
},
};
static struct gpiod_lookup_table net2big_leds_gpio_table = {
.dev_id = "leds-gpio",
.table = {
GPIO_LOOKUP_IDX("orion_gpio0", NET2BIG_GPIO_PWR_RED_LED, NULL,
0, GPIO_ACTIVE_HIGH),
GPIO_LOOKUP_IDX("orion_gpio0", NET2BIG_GPIO_PWR_BLUE_LED, NULL,
1, GPIO_ACTIVE_HIGH),
GPIO_LOOKUP_IDX("orion_gpio0", NET2BIG_GPIO_SATA0_RED_LED, NULL,
2, GPIO_ACTIVE_HIGH),
GPIO_LOOKUP_IDX("orion_gpio0", NET2BIG_GPIO_SATA1_RED_LED, NULL,
3, GPIO_ACTIVE_HIGH),
{ },
},
};
static struct gpio_led_platform_data net2big_led_data = {
.num_leds = ARRAY_SIZE(net2big_leds),
.leds = net2big_leds,
};
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/init.h`, `linux/platform_device.h`, `linux/mtd/physmap.h`, `linux/mv643xx_eth.h`, `linux/leds.h`, `linux/gpio_keys.h`, `linux/input.h`.
- Detected declarations: `function net2big_sata_power_init`, `function net2big_gpio_leds_init`, `function net2big_power_off`, `function net2big_init`.
- Atlas domain: Architecture Layer / arch/arm.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.