core/linux-odroid-c1 to 3.10.96-9

This commit is contained in:
Kevin Mihelich 2016-08-19 00:15:11 +00:00
parent c708d83821
commit c6434a34fb
2 changed files with 3 additions and 117 deletions

View file

@ -1,110 +0,0 @@
From ebf576e456d152ef2f54d58bfb730b4910ad9467 Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Tue, 23 Jun 2015 18:02:40 -0600
Subject: [PATCH] gcc 5.1 fix for mac address
Signed-off-by: Kevin Mihelich <kevin@archlinuxarm.org>
---
drivers/amlogic/efuse/efuse.c | 25 +++++++++++--------------
drivers/amlogic/ethernet/am_net8218.c | 14 +++++++-------
2 files changed, 18 insertions(+), 21 deletions(-)
diff --git a/drivers/amlogic/efuse/efuse.c b/drivers/amlogic/efuse/efuse.c
index a29a742..2a1d547 100644
--- a/drivers/amlogic/efuse/efuse.c
+++ b/drivers/amlogic/efuse/efuse.c
@@ -242,19 +242,16 @@ static const struct file_operations efuse_fops = {
#define MACCHAR(x) (('A' <= (x) && (x) <= 'F') \
? (x) - 'A' + 'a' : (x))
-static char *aml_efuse_mac(void)
+void aml_efuse_mac(unsigned char* hwmac)
{
- char hwmac[20];
char buf[80];
char mac_mask;
efuseinfo_item_t info;
-
- if (efuse_getinfo_byID(EFUSE_MAC_ID, &info) < 0)
- return 0;
-
- if (efuse_read_item(buf, info.data_len,
- (loff_t*)&info.offset) < 0)
- return 0;
+ if (efuse_getinfo_byID(EFUSE_MAC_ID, &info) < 0
+ || efuse_read_item(buf, info.data_len, (loff_t*)&info.offset) < 0) {
+ hwmac[0] = '\0';
+ return;
+ }
sprintf(hwmac, "%02x:%02x:%02x:%02x:%02x:%02x",
buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]);
@@ -275,11 +272,9 @@ static char *aml_efuse_mac(void)
MACCHAR(buf[11]), MACCHAR(buf[12]), MACCHAR(buf[13]),
MACCHAR(buf[14]), MACCHAR(buf[15]));
}
-
- return hwmac;
}
-unsigned char *aml_efuse_get_item(unsigned char* key_name)
+unsigned char *aml_efuse_get_item(unsigned char* key_name, unsigned char* value)
{
unsigned char *ret = 0;
int id;
@@ -294,7 +289,7 @@ unsigned char *aml_efuse_get_item(unsigned char* key_name)
}
if (id == EFUSE_MAC_ID) {
- return aml_efuse_mac();
+ aml_efuse_mac(value);
}
return ret;
@@ -304,7 +299,9 @@ EXPORT_SYMBOL(aml_efuse_get_item);
/* Sysfs Files */
static ssize_t mac_show(struct class *cla, struct class_attribute *attr, char *buf)
{
- return sprintf(buf, "%s\n", aml_efuse_mac());
+ char hwmac[20];
+ aml_efuse_mac(hwmac);
+ return sprintf(buf, "%s\n", hwmac);
}
static ssize_t mac_wifi_show(struct class *cla, struct class_attribute *attr, char *buf)
diff --git a/drivers/amlogic/ethernet/am_net8218.c b/drivers/amlogic/ethernet/am_net8218.c
index c39df30..a192128 100644
--- a/drivers/amlogic/ethernet/am_net8218.c
+++ b/drivers/amlogic/ethernet/am_net8218.c
@@ -117,7 +117,7 @@ static int reset_mac(struct net_device *dev);
static void am_net_dump_macreg(void);
static void read_macreg(void);
void hardware_reset_phy(void);
-extern char *aml_efuse_get_item(unsigned char* key_name);
+extern char *aml_efuse_get_item(unsigned char* key_name, unsigned char *value);
/* --------------------------------------------------------------------------*/
/**
@@ -1351,13 +1351,13 @@ static void config_mac_addr(struct net_device *dev, void *mac)
static void mac_from_efuse_to_DEFMAC(void)
{
unsigned char mac[6];
- unsigned char *efuse_mac;
- int i;
+ unsigned char efuse_mac[20];
+ int i, j;
- efuse_mac = aml_efuse_get_item("mac");
- for (i = 0; i < 6 && efuse_mac[0] != '\0' && efuse_mac[1] != '\0'; i++) {
- mac[i] = chartonum(efuse_mac[0]) << 4 | chartonum(efuse_mac[1]);
- efuse_mac += 3;
+ aml_efuse_get_item("mac", efuse_mac);
+ for (i = 0, j = 0; i < 6 && efuse_mac[j] != '\0' && efuse_mac[j+1] != '\0'; i++) {
+ mac[i] = chartonum(efuse_mac[j]) << 4 | chartonum(efuse_mac[j+1]);
+ j += 3;
}
memcpy(DEFMAC, mac, 6);
g_mac_addr_setup++;
--
2.7.3

View file

@ -4,12 +4,12 @@
buildarch=4
pkgbase=linux-odroid-c1
_commit=6d0cfcfd6a251a1486b167562b3ba42c44dcb34e
_commit=8b23fa19c5de7d1084d3bbfac439ce402d3d3388
_srcname=linux-${_commit}
_kernelname=${pkgbase#linux}
_desc="ODROID-C1"
pkgver=3.10.96
pkgrel=8
pkgrel=9
arch=('armv7h')
url="https://github.com/hardkernel/linux"
license=('GPL2')
@ -17,20 +17,16 @@ makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc' 'git' 'uboot-tools')
options=('!strip')
source=("https://github.com/hardkernel/linux/archive/${_commit}.tar.gz"
"git+https://github.com/mdrjr/c1_bootini.git"
'0001-gcc-5.1-fix-for-mac-address.patch'
'config'
'amlogic.service')
md5sums=('db09835e738f4a9ad43351dd0e1e4f2a'
md5sums=('03cb7e1128d0939ccbfed470da819af7'
'SKIP'
'969cd9ee3116cdd18fed121c87094065'
'67a33d4c1b9fc5a0a72350f3f11ecde8'
'b8956789318f49cec5b8bb0b41654a9b')
prepare() {
cd "${srcdir}/${_srcname}"
git apply ../0001-gcc-5.1-fix-for-mac-address.patch
cat "${srcdir}/config" > ./.config
# add pkgrel to extraversion