sysmobts: run lindent
Signed-off-by: Jan Luebbe <jluebbe@debian.org>
This commit is contained in:
parent
c5cd569198
commit
b6dbcd408a
|
@ -22,7 +22,7 @@
|
|||
#include <gpio.h>
|
||||
#include <envfs.h>
|
||||
#include <fs.h>
|
||||
#include <fcntl.h>
|
||||
#include <fcntl.h>
|
||||
#include <libfile.h>
|
||||
#include <net.h>
|
||||
|
||||
|
@ -33,14 +33,14 @@
|
|||
#define PINMUX1 0x01c40004
|
||||
#define PINMUX1_I2C BIT(7)
|
||||
|
||||
#define VDD3P3V_PWDN (0x01c40048)
|
||||
#define VDD3P3V_PWDN (0x01c40048)
|
||||
|
||||
#include <platform_data/eth-davinci-emac.h>
|
||||
|
||||
#define EMAC_BASE_ADDR 0x01C80000
|
||||
#define EMAC_WRAPPER_BASE_ADDR 0x01C81000
|
||||
#define EMAC_WRAPPER_RAM_ADDR 0x01C82000
|
||||
#define EMAC_MDIO_BASE_ADDR 0x01C84000
|
||||
#define EMAC_MDIO_BASE_ADDR 0x01C84000
|
||||
|
||||
static struct resource dm644x_emac_resources[] = {
|
||||
{
|
||||
|
@ -62,21 +62,22 @@ static struct resource dm644x_emac_resources[] = {
|
|||
}
|
||||
};
|
||||
|
||||
static struct davinci_emac_platform_data dm644x_emac_pdata = {
|
||||
.force_link = false,
|
||||
.interface_rmii = false,
|
||||
.phy_addr = 1,
|
||||
};
|
||||
|
||||
static struct device_d dm644x_emac_device = {
|
||||
.id = DEVICE_ID_DYNAMIC,
|
||||
.name = "davinci_emac",
|
||||
.num_resources = ARRAY_SIZE(dm644x_emac_resources),
|
||||
.resource = dm644x_emac_resources,
|
||||
.platform_data = &dm644x_emac_pdata,
|
||||
};
|
||||
static struct davinci_emac_platform_data dm644x_emac_pdata = {
|
||||
.force_link = false,
|
||||
.interface_rmii = false,
|
||||
.phy_addr = 1,
|
||||
};
|
||||
|
||||
static void sysmobts_config_eeprom(const char *compatible) {
|
||||
static struct device_d dm644x_emac_device = {
|
||||
.id = DEVICE_ID_DYNAMIC,
|
||||
.name = "davinci_emac",
|
||||
.num_resources = ARRAY_SIZE(dm644x_emac_resources),
|
||||
.resource = dm644x_emac_resources,
|
||||
.platform_data = &dm644x_emac_pdata,
|
||||
};
|
||||
|
||||
static void sysmobts_config_eeprom(const char *compatible)
|
||||
{
|
||||
struct device_node *node;
|
||||
|
||||
node = of_find_node_by_path("/i2c/eeprom@50");
|
||||
|
@ -84,14 +85,15 @@ static void sysmobts_config_eeprom(const char *compatible) {
|
|||
pr_err("can't find eeprom node to configure\n");
|
||||
return;
|
||||
}
|
||||
of_set_property(node, "compatible", compatible, strlen(compatible)+1, 1);
|
||||
of_set_property(node, "compatible", compatible, strlen(compatible) + 1,
|
||||
1);
|
||||
of_device_enable(node);
|
||||
}
|
||||
|
||||
static void sysmobts_board_detect(void)
|
||||
{
|
||||
int board_ver, board_cfg;
|
||||
char variant[4];
|
||||
int board_ver, board_cfg;
|
||||
char variant[4];
|
||||
|
||||
board_ver = gpio_get_value(15);
|
||||
board_ver |= gpio_get_value(16) << 1;
|
||||
|
@ -103,10 +105,10 @@ static void sysmobts_board_detect(void)
|
|||
board_cfg |= gpio_get_value(13) << 4;
|
||||
board_cfg |= gpio_get_value(14) << 5;
|
||||
|
||||
variant[0] = 'A' + board_ver;
|
||||
variant[1] = '.';
|
||||
variant[2] = '0' + board_cfg;
|
||||
variant[3] = '\0';
|
||||
variant[0] = 'A' + board_ver;
|
||||
variant[1] = '.';
|
||||
variant[2] = '0' + board_cfg;
|
||||
variant[3] = '\0';
|
||||
|
||||
globalvar_add_simple("board.variant", variant);
|
||||
|
||||
|
@ -154,7 +156,7 @@ err:
|
|||
return ret;
|
||||
}
|
||||
|
||||
#define MACH_TYPE_SYSMOBTS_V2 3758
|
||||
#define MACH_TYPE_SYSMOBTS_V2 3758
|
||||
|
||||
static void sysmobts_devices_shutdown(void)
|
||||
{
|
||||
|
@ -171,21 +173,23 @@ static int sysmobts_coredevices_init(void)
|
|||
|
||||
writel(readl(PINMUX1) & ~PINMUX1_I2C, PINMUX1);
|
||||
|
||||
sysmobts_board_detect();
|
||||
sysmobts_board_detect();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
coredevice_initcall(sysmobts_coredevices_init);
|
||||
|
||||
static int sysmobts_devices_init(void)
|
||||
{
|
||||
sysmobts_set_ethaddr();
|
||||
platform_device_register(&dm644x_emac_device);
|
||||
sysmobts_set_ethaddr();
|
||||
platform_device_register(&dm644x_emac_device);
|
||||
|
||||
defaultenv_append_directory(defaultenv_sysmobts);
|
||||
|
||||
armlinux_set_architecture(MACH_TYPE_SYSMOBTS_V2);
|
||||
armlinux_set_architecture(MACH_TYPE_SYSMOBTS_V2);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
device_initcall(sysmobts_devices_init);
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
extern char __dtb_dm6442_sysmobts_start[];
|
||||
|
||||
void __naked __bare_init barebox_arm_reset_vector(void)
|
||||
void __naked __bare_init barebox_arm_reset_vector(void)
|
||||
{
|
||||
void *fdt;
|
||||
|
||||
|
|
Loading…
Reference in New Issue