Added legacy kernel (3.10.107) targets for several A64 boards: Orangepi Win and Bananapi M64 were tested, the rest is untested: NanopiA64, Olinuxino A64 and Teres A64

This commit is contained in:
Igor Pecovnik 2018-01-09 22:51:54 +01:00
parent 495a31caee
commit 103ac41430
19 changed files with 34526 additions and 3474 deletions

View file

@ -1,14 +1,15 @@
# A64 quad core 2GB SoC GBE WiFi eMMC
BOARD_NAME="Banana Pi M64"
BOARDFAMILY="sun50iw1"
BOOTCONFIG_DEFAULT="sun50iw1p1_config"
BOOTCONFIG="bananapi_m64_defconfig"
#
MODULES=""
MODULES="bcmdhd"
MODULES_NEXT=""
CPUMIN="408000"
CPUMAX="1296000"
#
KERNEL_TARGET="next,dev"
KERNEL_TARGET="default,next,dev"
CLI_TARGET=""
DESKTOP_TARGET=""

View file

@ -1,6 +1,7 @@
# A64 quad core 1GB SoC GBE WiFi
BOARD_NAME="A64-OLinuXino"
BOARDFAMILY="sun50iw1"
BOOTCONFIG_DEFAULT="sun50iw1p1_config"
BOOTCONFIG="a64-olinuxino_defconfig"
#
MODULES=""
@ -8,7 +9,7 @@ MODULES_NEXT=""
CPUMIN="408000"
CPUMAX="1296000"
#
KERNEL_TARGET="dev"
KERNEL_TARGET="default,next,dev"
CLI_TARGET=""
DESKTOP_TARGET=""

View file

@ -1,14 +1,15 @@
# A64 quad core 1GB SoC GBE WiFi
BOARD_NAME="Orange Pi Win"
BOARDFAMILY="sun50iw1"
BOOTCONFIG_DEFAULT="sun50iw1p1_config"
BOOTCONFIG="orangepi_win_defconfig"
#
MODULES=""
MODULES="bcmdhd"
MODULES_NEXT=""
CPUMIN="408000"
CPUMAX="1296000"
#
KERNEL_TARGET="next,dev"
KERNEL_TARGET="default,next,dev"
CLI_TARGET=""
DESKTOP_TARGET=""

View file

@ -28,6 +28,12 @@ setenv bootargs "root=${rootdev} rootfstype=${rootfstype} rootwait ${consoleargs
fdt get value dt_name / dt-name
if test "${dt_name}" = "sun50iw1p1-pine64so"; then
setenv pine64_model "pine64so"
elif test "${dt_name}" = "sun50iw1p1-orangepiwin"; then
setenv pine64_model "orangepiwin"
elif test "${dt_name}" = "sun50iw1p1-bananapim64"; then
setenv pine64_model "bananapim64"
elif test "${dt_name}" = "sun50iw1p1-olinuxino-a64"; then
setenv pine64_model "olinuxino-a64"
fi
load mmc ${boot_part} ${fdt_addr} ${prefix}dtb/sun50iw1p1-${pine64_model}.dtb

View file

@ -1361,7 +1361,8 @@ CONFIG_USB_NET_RNDIS_WLAN=m
CONFIG_RTL8187=m
CONFIG_RTL8187_LEDS=y
# CONFIG_MAC80211_HWSIM is not set
CONFIG_WIFI_CONTROL_FUNC=y
# CONFIG_WIFI_CONTROL_FUNC is not set
# CONFIG_WAKE_ON_WLAN is not set
CONFIG_ATH_COMMON=m
CONFIG_ATH_CARDS=m
# CONFIG_ATH_DEBUG is not set
@ -1399,7 +1400,13 @@ CONFIG_B43LEGACY_PIO=y
CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y
# CONFIG_B43LEGACY_DMA_MODE is not set
# CONFIG_B43LEGACY_PIO_MODE is not set
# CONFIG_BCMDHD is not set
CONFIG_BCMDHD=m
CONFIG_BCMDHD_FW_PATH="/lib/firmware/ap6212/fw_bcmdhd.bin"
CONFIG_BCMDHD_NVRAM_PATH="/lib/firmware/ap6212/nvram.txt"
CONFIG_BCMDHD_DISABLE_WOWLAN=y
CONFIG_BCMDHD_SDIO=y
CONFIG_BCMDHD_OOB=y
# CONFIG_BCMDHD_SDIO_IRQ is not set
CONFIG_BRCMUTIL=m
CONFIG_BRCMFMAC=m
CONFIG_BRCMFMAC_SDIO=y

File diff suppressed because it is too large Load diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,91 @@
diff --git a/drivers/net/ethernet/allwinner/sunxi-gmac.c b/drivers/net/ethernet/allwinner/sunxi-gmac.c
index e0cef7b..4aaff55
--- a/drivers/net/ethernet/allwinner/sunxi-gmac.c
+++ b/drivers/net/ethernet/allwinner/sunxi-gmac.c
@@ -30,11 +30,13 @@
#include <linux/regulator/consumer.h>
#include <linux/of_net.h>
#include <linux/io.h>
-
+#include <linux/of.h>
+#include <linux/of_gpio.h>
#include <asm/io.h>
#include "sunxi-gmac.h"
+#define PHY_POWER_ON 1
#ifndef GMAC_CLK
#define GMAC_CLK "gmac"
#endif
@@ -158,6 +160,9 @@ struct geth_priv {
spinlock_t lock;
spinlock_t tx_lock;
+#ifdef PHY_POWER_ON
+ unsigned int power_on_gpio;
+#endif
};
#ifdef CONFIG_GETH_PHY_POWER
@@ -722,6 +727,38 @@ static const struct dev_pm_ops geth_pm_ops;
*
*
****************************************************************************/
+#ifdef PHY_POWER_ON
+void gmac_phy_power_on(struct geth_priv *priv)
+{
+ if (!priv)
+ return;
+
+ if (gpio_is_valid(priv->power_on_gpio)) {
+ printk("GPIO %d valid\n", priv->power_on_gpio);
+ gpio_request(priv->power_on_gpio, NULL);
+ gpio_direction_output(priv->power_on_gpio, 1);
+ __gpio_set_value(priv->power_on_gpio, 1);
+ mdelay(200);
+ } else {
+ printk("Request GPIO %d\n", priv->power_on_gpio);
+ __gpio_set_value(priv->power_on_gpio, 1);
+ mdelay(200);
+ }
+ printk("Current_V is : %d\n", __gpio_get_value(priv->power_on_gpio));
+}
+
+void gmac_phy_power_disable(struct geth_priv *priv)
+{
+ if (!priv)
+ return;
+
+ if (priv->power_on_gpio) {
+ __gpio_set_value(priv->power_on_gpio, 0);
+ }
+ printk("Current_V is : %d\n", __gpio_get_value(priv->power_on_gpio));
+ return;
+}
+#endif
static void geth_check_addr(struct net_device *ndev, unsigned char *mac)
{
int i;
@@ -859,6 +896,10 @@ static int geth_open(struct net_device *ndev)
struct geth_priv *priv = netdev_priv(ndev);
int ret = 0;
+#ifdef PHY_POWER_ON
+ gmac_phy_power_on(priv);
+#endif
+
ret = geth_power_on(priv);
if (ret) {
netdev_err(ndev, "Power on is failed\n");
@@ -1545,6 +1586,11 @@ static int geth_script_parse(struct platform_device *pdev)
if (priv->phy_ext == INT_PHY)
priv->phy_interface = PHY_INTERFACE_MODE_MII;
+
+#ifdef PHY_POWER_ON
+ priv->power_on_gpio = of_get_named_gpio(np, "phy_power_on", 0);
+#endif
+
#endif
if(!of_property_read_u32(np, "tx-delay", &value))
tx_delay = value;

File diff suppressed because it is too large Load diff