diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-09-11 11:52:28 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-09-23 08:40:32 +0200 |
commit | e07ddb8b97b07160376245d6b45c776bafe5b286 (patch) | |
tree | 2b1434fe2ec8839db91065ad799a0cc6456fdce2 /arch/arm/boards/terasic-sockit/board.c | |
parent | 5b5f6ab6bfdd369bd2e3f968a868569c4399c374 (diff) | |
download | barebox-e07ddb8b97b07160376245d6b45c776bafe5b286.tar.gz barebox-e07ddb8b97b07160376245d6b45c776bafe5b286.tar.xz |
ARM: SoCFPGA: Add Terasic SoCkit board support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards/terasic-sockit/board.c')
-rw-r--r-- | arch/arm/boards/terasic-sockit/board.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/arch/arm/boards/terasic-sockit/board.c b/arch/arm/boards/terasic-sockit/board.c new file mode 100644 index 0000000000..fdff76ff84 --- /dev/null +++ b/arch/arm/boards/terasic-sockit/board.c @@ -0,0 +1,37 @@ +#include <common.h> +#include <types.h> +#include <driver.h> +#include <init.h> +#include <asm/armlinux.h> +#include <linux/micrel_phy.h> +#include <linux/phy.h> +#include <sizes.h> +#include <fcntl.h> +#include <fs.h> +#include <mach/socfpga-regs.h> + +static int phy_fixup(struct phy_device *dev) +{ + /* min rx data delay */ + phy_write(dev, 0x0b, 0x8105); + phy_write(dev, 0x0c, 0x0000); + + /* max rx/tx clock delay, min rx/tx control delay */ + phy_write(dev, 0x0b, 0x8104); + phy_write(dev, 0x0c, 0xa0d0); + phy_write(dev, 0x0b, 0x104); + + return 0; +} + +static int socfpga_console_init(void) +{ + if (!of_machine_is_compatible("terasic,sockit")) + return 0; + + if (IS_ENABLED(CONFIG_PHYLIB)) + phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK, phy_fixup); + + return 0; +} +console_initcall(socfpga_console_init); |