/***************************************************************************** * 512KB NOR Flash on Boot Device
****************************************************************************/
/* * TODO: Check write support on flash MX29LV400CBTC-70G
*/
/***************************************************************************** * SATA
****************************************************************************/
staticvoid __init net2big_sata_power_init(void)
{ int err;
/* Configure GPIOs over MPP max number. */
orion_gpio_set_valid(NET2BIG_GPIO_SATA0_POWER, 1);
orion_gpio_set_valid(NET2BIG_GPIO_SATA1_POWER, 1);
err = gpio_request(NET2BIG_GPIO_SATA0_POWER, "SATA0 power status"); if (err == 0) {
err = gpio_direction_input(NET2BIG_GPIO_SATA0_POWER); if (err)
gpio_free(NET2BIG_GPIO_SATA0_POWER);
} if (err) {
pr_err("net2big: failed to setup SATA0 power GPIO\n"); return;
}
err = gpio_request(NET2BIG_GPIO_SATA1_POWER, "SATA1 power status"); if (err == 0) {
err = gpio_direction_input(NET2BIG_GPIO_SATA1_POWER); if (err)
gpio_free(NET2BIG_GPIO_SATA1_POWER);
} if (err) {
pr_err("net2big: failed to setup SATA1 power GPIO\n"); goto err_free_1;
}
err = gpio_request(NET2BIG_GPIO_SATA_POWER_REQ, "SATA power request"); if (err == 0) {
err = gpio_direction_output(NET2BIG_GPIO_SATA_POWER_REQ, 0); if (err)
gpio_free(NET2BIG_GPIO_SATA_POWER_REQ);
} if (err) {
pr_err("net2big: failed to setup SATA power request GPIO\n"); goto err_free_2;
}
if (gpio_get_value(NET2BIG_GPIO_SATA0_POWER) &&
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");
/* * 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.
*/
staticvoid __init net2big_gpio_leds_init(void)
{ int err;
/* Stop initial CPLD slow red/blue blinking on power LED. */
err = gpio_request(NET2BIG_GPIO_PWR_LED_BLINK_STOP, "Power LED blink stop"); if (err == 0) {
err = gpio_direction_output(NET2BIG_GPIO_PWR_LED_BLINK_STOP, 1); if (err)
gpio_free(NET2BIG_GPIO_PWR_LED_BLINK_STOP);
} if (err)
pr_err("net2big: failed to setup power LED blink GPIO\n");
/* * Configure SATA0 and SATA1 blue LEDs to blink in relation with the * hard disk activity.
*/
err = gpio_request(NET2BIG_GPIO_SATA0_BLUE_LED, "SATA0 blue LED control"); if (err == 0) {
err = gpio_direction_output(NET2BIG_GPIO_SATA0_BLUE_LED, 1); if (err)
gpio_free(NET2BIG_GPIO_SATA0_BLUE_LED);
} if (err)
pr_err("net2big: failed to setup SATA0 blue LED GPIO\n");
err = gpio_request(NET2BIG_GPIO_SATA1_BLUE_LED, "SATA1 blue LED control"); if (err == 0) {
err = gpio_direction_output(NET2BIG_GPIO_SATA1_BLUE_LED, 1); if (err)
gpio_free(NET2BIG_GPIO_SATA1_BLUE_LED);
} if (err)
pr_err("net2big: failed to setup SATA1 blue LED GPIO\n");
/***************************************************************************** * General Setup
****************************************************************************/
staticunsignedint net2big_mpp_modes[] __initdata = {
MPP0_GPIO, /* Raid mode (bit 0) */
MPP1_GPIO, /* USB port 2 fuse (0 = Fail, 1 = Ok) */
MPP2_GPIO, /* Raid mode (bit 1) */
MPP3_GPIO, /* Board ID (bit 0) */
MPP4_GPIO, /* Fan activity (0 = Off, 1 = On) */
MPP5_GPIO, /* Fan fail detection */
MPP6_GPIO, /* Red front LED (0 = Off, 1 = On) */
MPP7_GPIO, /* Disable initial blinking on front LED */
MPP8_GPIO, /* Rear power switch (on|auto) */
MPP9_GPIO, /* Rear power switch (auto|off) */
MPP10_GPIO, /* SATA 1 red LED (0 = Off, 1 = On) */
MPP11_GPIO, /* SATA 0 red LED (0 = Off, 1 = On) */
MPP12_GPIO, /* Board ID (bit 1) */
MPP13_GPIO, /* SATA 1 blue LED blink control */
MPP14_SATA_LED,
MPP15_SATA_LED,
MPP16_GPIO, /* Blue front LED control */
MPP17_GPIO, /* SATA 0 blue LED blink control */
MPP18_GPIO, /* Front button (0 = Released, 1 = Pushed ) */
MPP19_GPIO, /* SATA{0,1} power On/Off request */
0, /* 22: USB port 1 fuse (0 = Fail, 1 = Ok) */ /* 23: SATA 0 power status */ /* 24: Board power off */ /* 25: SATA 1 power status */
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.