All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: amlogic: add JetHub D1 eth mac generation with manufacturer OUI
@ 2021-10-29  7:08 Vyacheslav Bocharov
  2021-10-29 12:08 ` Neil Armstrong
  0 siblings, 1 reply; 9+ messages in thread
From: Vyacheslav Bocharov @ 2021-10-29  7:08 UTC (permalink / raw)
  To: Neil Armstrong; +Cc: u-boot, u-boot-amlogic

JetHome has own MAC OUI. Add jethub-j100 board file. Update config.

Signed-off-by: Vyacheslav Bocharov <adeep@lexina.in>
---
 board/amlogic/jethub-j100/MAINTAINERS   |  8 +++++
 board/amlogic/jethub-j100/Makefile      |  6 ++++
 board/amlogic/jethub-j100/jethub-j100.c | 41 +++++++++++++++++++++++++
 board/amlogic/jethub-j80/MAINTAINERS    |  3 +-
 configs/jethub_j100_defconfig           |  1 +
 5 files changed, 57 insertions(+), 2 deletions(-)
 create mode 100644 board/amlogic/jethub-j100/MAINTAINERS
 create mode 100644 board/amlogic/jethub-j100/Makefile
 create mode 100644 board/amlogic/jethub-j100/jethub-j100.c

diff --git a/board/amlogic/jethub-j100/MAINTAINERS b/board/amlogic/jethub-j100/MAINTAINERS
new file mode 100644
index 0000000000..43f6a5fc86
--- /dev/null
+++ b/board/amlogic/jethub-j100/MAINTAINERS
@@ -0,0 +1,8 @@
+JetHome JetHub
+M:	Vyacheslav Bocharov <adeep@lexina.in>
+S:	Maintained
+L:	u-boot-amlogic@groups.io
+F:	board/amlogic/jethub-j100/
+F:	configs/jethub_j100_defconfig
+F:	doc/board/amlogic/jethub-j100.rst
+F:	include/configs/jethub.h
diff --git a/board/amlogic/jethub-j100/Makefile b/board/amlogic/jethub-j100/Makefile
new file mode 100644
index 0000000000..4d935af984
--- /dev/null
+++ b/board/amlogic/jethub-j100/Makefile
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# (C) Copyright 2021 Vyacheslav Bocharov
+# Author: Vyacheslav Bocharov <adeep@lexina.in>
+
+obj-y	:= jethub-j100.o
diff --git a/board/amlogic/jethub-j100/jethub-j100.c b/board/amlogic/jethub-j100/jethub-j100.c
new file mode 100644
index 0000000000..575bb31573
--- /dev/null
+++ b/board/amlogic/jethub-j100/jethub-j100.c
@@ -0,0 +1,41 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2021 Vyacheslav Bocharov
+ * Author: Vyacheslav Bocharov <adeep@lexina.in>
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <init.h>
+#include <net.h>
+#include <asm/io.h>
+#include <asm/arch/axg.h>
+#include <asm/arch/sm.h>
+#include <asm/arch/eth.h>
+#include <asm/arch/mem.h>
+
+int misc_init_r(void)
+{
+	u8 mac_addr[ARP_HLEN];
+	char serial[SM_SERIAL_SIZE];
+	u32 sid;
+
+	if (!meson_sm_get_serial(serial, SM_SERIAL_SIZE)) {
+		sid = crc32(0, (unsigned char *)serial, SM_SERIAL_SIZE);
+		/* Ensure the NIC specific bytes of the mac are not all 0 */
+		if ((sid & 0xffff) == 0)
+			sid |= 0x800000;
+
+		/* OUI registered MAC address */
+		mac_addr[0] = 0x10;
+		mac_addr[1] = 0x27;
+		mac_addr[2] = 0xBE;
+		mac_addr[3] = (sid >> 16) & 0xff;
+		mac_addr[4] = (sid >>  8) & 0xff;
+		mac_addr[5] = (sid >>  0) & 0xff;
+
+		eth_env_set_enetaddr("ethaddr", mac_addr);
+	}
+
+	return 0;
+}
diff --git a/board/amlogic/jethub-j80/MAINTAINERS b/board/amlogic/jethub-j80/MAINTAINERS
index 459e9f89da..a899153117 100644
--- a/board/amlogic/jethub-j80/MAINTAINERS
+++ b/board/amlogic/jethub-j80/MAINTAINERS
@@ -4,6 +4,5 @@ S:	Maintained
 L:	u-boot-amlogic@groups.io
 F:	board/amlogic/jethub-j80/
 F:	configs/jethub_j80_defconfig
-F:	configs/jethub_j100_defconfig
 F:	doc/board/amlogic/jethub-j80.rst
-F:	doc/board/amlogic/jethub-j100.rst
+F:	include/configs/jethub.h
diff --git a/configs/jethub_j100_defconfig b/configs/jethub_j100_defconfig
index 290ce4db85..ad026a89e0 100644
--- a/configs/jethub_j100_defconfig
+++ b/configs/jethub_j100_defconfig
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_SYS_BOARD="jethub-j100"
 CONFIG_SYS_CONFIG_NAME="jethub"
 CONFIG_ARCH_MESON=y
 CONFIG_SYS_TEXT_BASE=0x01000000
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] ARM: amlogic: add JetHub D1 eth mac generation with manufacturer OUI
  2021-10-29  7:08 [PATCH] ARM: amlogic: add JetHub D1 eth mac generation with manufacturer OUI Vyacheslav Bocharov
@ 2021-10-29 12:08 ` Neil Armstrong
  2021-10-29 12:21     ` Vyacheslav Bocharov
  0 siblings, 1 reply; 9+ messages in thread
From: Neil Armstrong @ 2021-10-29 12:08 UTC (permalink / raw)
  To: Vyacheslav Bocharov; +Cc: u-boot, u-boot-amlogic

On 29/10/2021 09:08, Vyacheslav Bocharov wrote:
> JetHome has own MAC OUI. Add jethub-j100 board file. Update config.
> 
> Signed-off-by: Vyacheslav Bocharov <adeep@lexina.in>
> ---
>  board/amlogic/jethub-j100/MAINTAINERS   |  8 +++++
>  board/amlogic/jethub-j100/Makefile      |  6 ++++
>  board/amlogic/jethub-j100/jethub-j100.c | 41 +++++++++++++++++++++++++
>  board/amlogic/jethub-j80/MAINTAINERS    |  3 +-
>  configs/jethub_j100_defconfig           |  1 +
>  5 files changed, 57 insertions(+), 2 deletions(-)
>  create mode 100644 board/amlogic/jethub-j100/MAINTAINERS
>  create mode 100644 board/amlogic/jethub-j100/Makefile
>  create mode 100644 board/amlogic/jethub-j100/jethub-j100.c
> 
> diff --git a/board/amlogic/jethub-j100/MAINTAINERS b/board/amlogic/jethub-j100/MAINTAINERS
> new file mode 100644
> index 0000000000..43f6a5fc86
> --- /dev/null
> +++ b/board/amlogic/jethub-j100/MAINTAINERS
> @@ -0,0 +1,8 @@
> +JetHome JetHub
> +M:	Vyacheslav Bocharov <adeep@lexina.in>
> +S:	Maintained
> +L:	u-boot-amlogic@groups.io
> +F:	board/amlogic/jethub-j100/
> +F:	configs/jethub_j100_defconfig
> +F:	doc/board/amlogic/jethub-j100.rst
> +F:	include/configs/jethub.h
> diff --git a/board/amlogic/jethub-j100/Makefile b/board/amlogic/jethub-j100/Makefile
> new file mode 100644
> index 0000000000..4d935af984
> --- /dev/null
> +++ b/board/amlogic/jethub-j100/Makefile
> @@ -0,0 +1,6 @@
> +# SPDX-License-Identifier: GPL-2.0+
> +#
> +# (C) Copyright 2021 Vyacheslav Bocharov
> +# Author: Vyacheslav Bocharov <adeep@lexina.in>
> +
> +obj-y	:= jethub-j100.o
> diff --git a/board/amlogic/jethub-j100/jethub-j100.c b/board/amlogic/jethub-j100/jethub-j100.c
> new file mode 100644
> index 0000000000..575bb31573
> --- /dev/null
> +++ b/board/amlogic/jethub-j100/jethub-j100.c
> @@ -0,0 +1,41 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright (C) 2021 Vyacheslav Bocharov
> + * Author: Vyacheslav Bocharov <adeep@lexina.in>
> + */
> +
> +#include <common.h>
> +#include <dm.h>
> +#include <init.h>
> +#include <net.h>
> +#include <asm/io.h>
> +#include <asm/arch/axg.h>
> +#include <asm/arch/sm.h>
> +#include <asm/arch/eth.h>
> +#include <asm/arch/mem.h>
> +
> +int misc_init_r(void)
> +{
> +	u8 mac_addr[ARP_HLEN];
> +	char serial[SM_SERIAL_SIZE];
> +	u32 sid;
> +
> +	if (!meson_sm_get_serial(serial, SM_SERIAL_SIZE)) {
> +		sid = crc32(0, (unsigned char *)serial, SM_SERIAL_SIZE);
> +		/* Ensure the NIC specific bytes of the mac are not all 0 */
> +		if ((sid & 0xffff) == 0)
> +			sid |= 0x800000;
> +
> +		/* OUI registered MAC address */
> +		mac_addr[0] = 0x10;
> +		mac_addr[1] = 0x27;
> +		mac_addr[2] = 0xBE;
> +		mac_addr[3] = (sid >> 16) & 0xff;
> +		mac_addr[4] = (sid >>  8) & 0xff;
> +		mac_addr[5] = (sid >>  0) & 0xff;
> +
> +		eth_env_set_enetaddr("ethaddr", mac_addr);
> +	}
> +
> +	return 0;
> +}
> diff --git a/board/amlogic/jethub-j80/MAINTAINERS b/board/amlogic/jethub-j80/MAINTAINERS
> index 459e9f89da..a899153117 100644
> --- a/board/amlogic/jethub-j80/MAINTAINERS
> +++ b/board/amlogic/jethub-j80/MAINTAINERS
> @@ -4,6 +4,5 @@ S:	Maintained
>  L:	u-boot-amlogic@groups.io
>  F:	board/amlogic/jethub-j80/
>  F:	configs/jethub_j80_defconfig
> -F:	configs/jethub_j100_defconfig
>  F:	doc/board/amlogic/jethub-j80.rst
> -F:	doc/board/amlogic/jethub-j100.rst
> +F:	include/configs/jethub.h
> diff --git a/configs/jethub_j100_defconfig b/configs/jethub_j100_defconfig
> index 290ce4db85..ad026a89e0 100644
> --- a/configs/jethub_j100_defconfig
> +++ b/configs/jethub_j100_defconfig
> @@ -1,4 +1,5 @@
>  CONFIG_ARM=y
> +CONFIG_SYS_BOARD="jethub-j100"
>  CONFIG_SYS_CONFIG_NAME="jethub"
>  CONFIG_ARCH_MESON=y
>  CONFIG_SYS_TEXT_BASE=0x01000000
> 

Applied to u-boot-amlogic

I will probably send it next week along `add sm efuse write support and cmd for read/write efuse`

Thanks,
Neil

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ARM: amlogic: add JetHub D1 eth mac generation with manufacturer OUI
  2021-10-29 12:08 ` Neil Armstrong
@ 2021-10-29 12:21     ` Vyacheslav Bocharov
  0 siblings, 0 replies; 9+ messages in thread
From: Vyacheslav @ 2021-10-29 12:21 UTC (permalink / raw)
  To: u-boot-amlogic, narmstrong; +Cc: u-boot

Thanks.

29.10.2021 15:08, Neil Armstrong пишет:
> On 29/10/2021 09:08, Vyacheslav Bocharov wrote:
>> JetHome has own MAC OUI. Add jethub-j100 board file. Update config.
>>
>> Signed-off-by: Vyacheslav Bocharov <adeep@lexina.in>
>> ---
>>   board/amlogic/jethub-j100/MAINTAINERS   |  8 +++++
>>   board/amlogic/jethub-j100/Makefile      |  6 ++++
>>   board/amlogic/jethub-j100/jethub-j100.c | 41 +++++++++++++++++++++++++
>>   board/amlogic/jethub-j80/MAINTAINERS    |  3 +-
>>   configs/jethub_j100_defconfig           |  1 +
>>   5 files changed, 57 insertions(+), 2 deletions(-)
>>   create mode 100644 board/amlogic/jethub-j100/MAINTAINERS
>>   create mode 100644 board/amlogic/jethub-j100/Makefile
>>   create mode 100644 board/amlogic/jethub-j100/jethub-j100.c
>>
>> diff --git a/board/amlogic/jethub-j100/MAINTAINERS b/board/amlogic/jethub-j100/MAINTAINERS
>> new file mode 100644
>> index 0000000000..43f6a5fc86
>> --- /dev/null
>> +++ b/board/amlogic/jethub-j100/MAINTAINERS
>> @@ -0,0 +1,8 @@
>> +JetHome JetHub
>> +M:	Vyacheslav Bocharov <adeep@lexina.in>
>> +S:	Maintained
>> +L:	u-boot-amlogic@groups.io
>> +F:	board/amlogic/jethub-j100/
>> +F:	configs/jethub_j100_defconfig
>> +F:	doc/board/amlogic/jethub-j100.rst
>> +F:	include/configs/jethub.h
>> diff --git a/board/amlogic/jethub-j100/Makefile b/board/amlogic/jethub-j100/Makefile
>> new file mode 100644
>> index 0000000000..4d935af984
>> --- /dev/null
>> +++ b/board/amlogic/jethub-j100/Makefile
>> @@ -0,0 +1,6 @@
>> +# SPDX-License-Identifier: GPL-2.0+
>> +#
>> +# (C) Copyright 2021 Vyacheslav Bocharov
>> +# Author: Vyacheslav Bocharov <adeep@lexina.in>
>> +
>> +obj-y	:= jethub-j100.o
>> diff --git a/board/amlogic/jethub-j100/jethub-j100.c b/board/amlogic/jethub-j100/jethub-j100.c
>> new file mode 100644
>> index 0000000000..575bb31573
>> --- /dev/null
>> +++ b/board/amlogic/jethub-j100/jethub-j100.c
>> @@ -0,0 +1,41 @@
>> +// SPDX-License-Identifier: GPL-2.0+
>> +/*
>> + * Copyright (C) 2021 Vyacheslav Bocharov
>> + * Author: Vyacheslav Bocharov <adeep@lexina.in>
>> + */
>> +
>> +#include <common.h>
>> +#include <dm.h>
>> +#include <init.h>
>> +#include <net.h>
>> +#include <asm/io.h>
>> +#include <asm/arch/axg.h>
>> +#include <asm/arch/sm.h>
>> +#include <asm/arch/eth.h>
>> +#include <asm/arch/mem.h>
>> +
>> +int misc_init_r(void)
>> +{
>> +	u8 mac_addr[ARP_HLEN];
>> +	char serial[SM_SERIAL_SIZE];
>> +	u32 sid;
>> +
>> +	if (!meson_sm_get_serial(serial, SM_SERIAL_SIZE)) {
>> +		sid = crc32(0, (unsigned char *)serial, SM_SERIAL_SIZE);
>> +		/* Ensure the NIC specific bytes of the mac are not all 0 */
>> +		if ((sid & 0xffff) == 0)
>> +			sid |= 0x800000;
>> +
>> +		/* OUI registered MAC address */
>> +		mac_addr[0] = 0x10;
>> +		mac_addr[1] = 0x27;
>> +		mac_addr[2] = 0xBE;
>> +		mac_addr[3] = (sid >> 16) & 0xff;
>> +		mac_addr[4] = (sid >>  8) & 0xff;
>> +		mac_addr[5] = (sid >>  0) & 0xff;
>> +
>> +		eth_env_set_enetaddr("ethaddr", mac_addr);
>> +	}
>> +
>> +	return 0;
>> +}
>> diff --git a/board/amlogic/jethub-j80/MAINTAINERS b/board/amlogic/jethub-j80/MAINTAINERS
>> index 459e9f89da..a899153117 100644
>> --- a/board/amlogic/jethub-j80/MAINTAINERS
>> +++ b/board/amlogic/jethub-j80/MAINTAINERS
>> @@ -4,6 +4,5 @@ S:	Maintained
>>   L:	u-boot-amlogic@groups.io
>>   F:	board/amlogic/jethub-j80/
>>   F:	configs/jethub_j80_defconfig
>> -F:	configs/jethub_j100_defconfig
>>   F:	doc/board/amlogic/jethub-j80.rst
>> -F:	doc/board/amlogic/jethub-j100.rst
>> +F:	include/configs/jethub.h
>> diff --git a/configs/jethub_j100_defconfig b/configs/jethub_j100_defconfig
>> index 290ce4db85..ad026a89e0 100644
>> --- a/configs/jethub_j100_defconfig
>> +++ b/configs/jethub_j100_defconfig
>> @@ -1,4 +1,5 @@
>>   CONFIG_ARM=y
>> +CONFIG_SYS_BOARD="jethub-j100"
>>   CONFIG_SYS_CONFIG_NAME="jethub"
>>   CONFIG_ARCH_MESON=y
>>   CONFIG_SYS_TEXT_BASE=0x01000000
>>
> 
> Applied to u-boot-amlogic
> 
> I will probably send it next week along `add sm efuse write support and cmd for read/write efuse`
> 
> Thanks,
> Neil

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ARM: amlogic: add JetHub D1 eth mac generation with manufacturer OUI
@ 2021-10-29 12:21     ` Vyacheslav Bocharov
  0 siblings, 0 replies; 9+ messages in thread
From: Vyacheslav Bocharov @ 2021-10-29 12:21 UTC (permalink / raw)
  To: u-boot-amlogic, narmstrong; +Cc: u-boot

Thanks.

29.10.2021 15:08, Neil Armstrong пишет:
> On 29/10/2021 09:08, Vyacheslav Bocharov wrote:
>> JetHome has own MAC OUI. Add jethub-j100 board file. Update config.
>>
>> Signed-off-by: Vyacheslav Bocharov <adeep@lexina.in>
>> ---
>>   board/amlogic/jethub-j100/MAINTAINERS   |  8 +++++
>>   board/amlogic/jethub-j100/Makefile      |  6 ++++
>>   board/amlogic/jethub-j100/jethub-j100.c | 41 +++++++++++++++++++++++++
>>   board/amlogic/jethub-j80/MAINTAINERS    |  3 +-
>>   configs/jethub_j100_defconfig           |  1 +
>>   5 files changed, 57 insertions(+), 2 deletions(-)
>>   create mode 100644 board/amlogic/jethub-j100/MAINTAINERS
>>   create mode 100644 board/amlogic/jethub-j100/Makefile
>>   create mode 100644 board/amlogic/jethub-j100/jethub-j100.c
>>
>> diff --git a/board/amlogic/jethub-j100/MAINTAINERS b/board/amlogic/jethub-j100/MAINTAINERS
>> new file mode 100644
>> index 0000000000..43f6a5fc86
>> --- /dev/null
>> +++ b/board/amlogic/jethub-j100/MAINTAINERS
>> @@ -0,0 +1,8 @@
>> +JetHome JetHub
>> +M:	Vyacheslav Bocharov <adeep@lexina.in>
>> +S:	Maintained
>> +L:	u-boot-amlogic@groups.io
>> +F:	board/amlogic/jethub-j100/
>> +F:	configs/jethub_j100_defconfig
>> +F:	doc/board/amlogic/jethub-j100.rst
>> +F:	include/configs/jethub.h
>> diff --git a/board/amlogic/jethub-j100/Makefile b/board/amlogic/jethub-j100/Makefile
>> new file mode 100644
>> index 0000000000..4d935af984
>> --- /dev/null
>> +++ b/board/amlogic/jethub-j100/Makefile
>> @@ -0,0 +1,6 @@
>> +# SPDX-License-Identifier: GPL-2.0+
>> +#
>> +# (C) Copyright 2021 Vyacheslav Bocharov
>> +# Author: Vyacheslav Bocharov <adeep@lexina.in>
>> +
>> +obj-y	:= jethub-j100.o
>> diff --git a/board/amlogic/jethub-j100/jethub-j100.c b/board/amlogic/jethub-j100/jethub-j100.c
>> new file mode 100644
>> index 0000000000..575bb31573
>> --- /dev/null
>> +++ b/board/amlogic/jethub-j100/jethub-j100.c
>> @@ -0,0 +1,41 @@
>> +// SPDX-License-Identifier: GPL-2.0+
>> +/*
>> + * Copyright (C) 2021 Vyacheslav Bocharov
>> + * Author: Vyacheslav Bocharov <adeep@lexina.in>
>> + */
>> +
>> +#include <common.h>
>> +#include <dm.h>
>> +#include <init.h>
>> +#include <net.h>
>> +#include <asm/io.h>
>> +#include <asm/arch/axg.h>
>> +#include <asm/arch/sm.h>
>> +#include <asm/arch/eth.h>
>> +#include <asm/arch/mem.h>
>> +
>> +int misc_init_r(void)
>> +{
>> +	u8 mac_addr[ARP_HLEN];
>> +	char serial[SM_SERIAL_SIZE];
>> +	u32 sid;
>> +
>> +	if (!meson_sm_get_serial(serial, SM_SERIAL_SIZE)) {
>> +		sid = crc32(0, (unsigned char *)serial, SM_SERIAL_SIZE);
>> +		/* Ensure the NIC specific bytes of the mac are not all 0 */
>> +		if ((sid & 0xffff) == 0)
>> +			sid |= 0x800000;
>> +
>> +		/* OUI registered MAC address */
>> +		mac_addr[0] = 0x10;
>> +		mac_addr[1] = 0x27;
>> +		mac_addr[2] = 0xBE;
>> +		mac_addr[3] = (sid >> 16) & 0xff;
>> +		mac_addr[4] = (sid >>  8) & 0xff;
>> +		mac_addr[5] = (sid >>  0) & 0xff;
>> +
>> +		eth_env_set_enetaddr("ethaddr", mac_addr);
>> +	}
>> +
>> +	return 0;
>> +}
>> diff --git a/board/amlogic/jethub-j80/MAINTAINERS b/board/amlogic/jethub-j80/MAINTAINERS
>> index 459e9f89da..a899153117 100644
>> --- a/board/amlogic/jethub-j80/MAINTAINERS
>> +++ b/board/amlogic/jethub-j80/MAINTAINERS
>> @@ -4,6 +4,5 @@ S:	Maintained
>>   L:	u-boot-amlogic@groups.io
>>   F:	board/amlogic/jethub-j80/
>>   F:	configs/jethub_j80_defconfig
>> -F:	configs/jethub_j100_defconfig
>>   F:	doc/board/amlogic/jethub-j80.rst
>> -F:	doc/board/amlogic/jethub-j100.rst
>> +F:	include/configs/jethub.h
>> diff --git a/configs/jethub_j100_defconfig b/configs/jethub_j100_defconfig
>> index 290ce4db85..ad026a89e0 100644
>> --- a/configs/jethub_j100_defconfig
>> +++ b/configs/jethub_j100_defconfig
>> @@ -1,4 +1,5 @@
>>   CONFIG_ARM=y
>> +CONFIG_SYS_BOARD="jethub-j100"
>>   CONFIG_SYS_CONFIG_NAME="jethub"
>>   CONFIG_ARCH_MESON=y
>>   CONFIG_SYS_TEXT_BASE=0x01000000
>>
> 
> Applied to u-boot-amlogic
> 
> I will probably send it next week along `add sm efuse write support and cmd for read/write efuse`
> 
> Thanks,
> Neil

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ARM: amlogic: add JetHub D1 eth mac generation with manufacturer OUI
  2021-10-29 12:21     ` Vyacheslav Bocharov
  (?)
@ 2021-10-29 13:53     ` Neil Armstrong
  2021-10-29 14:49         ` Vyacheslav Bocharov
  2021-10-29 15:00       ` Vyacheslav Bocharov
  -1 siblings, 2 replies; 9+ messages in thread
From: Neil Armstrong @ 2021-10-29 13:53 UTC (permalink / raw)
  To: Vyacheslav, u-boot-amlogic; +Cc: u-boot

Hi,

Ci fails with :

+board/amlogic/jethub-j100/jethub-j100.c: In function 'misc_init_r':
1516+board/amlogic/jethub-j100/jethub-j100.c:24:23: error: implicit declaration of function 'crc32' [-Werror=implicit-function-declaration]
1517+   24 |                 sid = crc32(0, (unsigned char *)serial, SM_SERIAL_SIZE);
1518+      |

Can you send a fix I can squash on the commit ?

Neil

On 29/10/2021 14:21, Vyacheslav wrote:
> Thanks.
> 
> 29.10.2021 15:08, Neil Armstrong пишет:
>> On 29/10/2021 09:08, Vyacheslav Bocharov wrote:
>>> JetHome has own MAC OUI. Add jethub-j100 board file. Update config.
>>>
>>> Signed-off-by: Vyacheslav Bocharov <adeep@lexina.in>
>>> ---
>>>   board/amlogic/jethub-j100/MAINTAINERS   |  8 +++++
>>>   board/amlogic/jethub-j100/Makefile      |  6 ++++
>>>   board/amlogic/jethub-j100/jethub-j100.c | 41 +++++++++++++++++++++++++
>>>   board/amlogic/jethub-j80/MAINTAINERS    |  3 +-
>>>   configs/jethub_j100_defconfig           |  1 +
>>>   5 files changed, 57 insertions(+), 2 deletions(-)
>>>   create mode 100644 board/amlogic/jethub-j100/MAINTAINERS
>>>   create mode 100644 board/amlogic/jethub-j100/Makefile
>>>   create mode 100644 board/amlogic/jethub-j100/jethub-j100.c
>>>
>>> diff --git a/board/amlogic/jethub-j100/MAINTAINERS b/board/amlogic/jethub-j100/MAINTAINERS
>>> new file mode 100644
>>> index 0000000000..43f6a5fc86
>>> --- /dev/null
>>> +++ b/board/amlogic/jethub-j100/MAINTAINERS
>>> @@ -0,0 +1,8 @@
>>> +JetHome JetHub
>>> +M:    Vyacheslav Bocharov <adeep@lexina.in>
>>> +S:    Maintained
>>> +L:    u-boot-amlogic@groups.io
>>> +F:    board/amlogic/jethub-j100/
>>> +F:    configs/jethub_j100_defconfig
>>> +F:    doc/board/amlogic/jethub-j100.rst
>>> +F:    include/configs/jethub.h
>>> diff --git a/board/amlogic/jethub-j100/Makefile b/board/amlogic/jethub-j100/Makefile
>>> new file mode 100644
>>> index 0000000000..4d935af984
>>> --- /dev/null
>>> +++ b/board/amlogic/jethub-j100/Makefile
>>> @@ -0,0 +1,6 @@
>>> +# SPDX-License-Identifier: GPL-2.0+
>>> +#
>>> +# (C) Copyright 2021 Vyacheslav Bocharov
>>> +# Author: Vyacheslav Bocharov <adeep@lexina.in>
>>> +
>>> +obj-y    := jethub-j100.o
>>> diff --git a/board/amlogic/jethub-j100/jethub-j100.c b/board/amlogic/jethub-j100/jethub-j100.c
>>> new file mode 100644
>>> index 0000000000..575bb31573
>>> --- /dev/null
>>> +++ b/board/amlogic/jethub-j100/jethub-j100.c
>>> @@ -0,0 +1,41 @@
>>> +// SPDX-License-Identifier: GPL-2.0+
>>> +/*
>>> + * Copyright (C) 2021 Vyacheslav Bocharov
>>> + * Author: Vyacheslav Bocharov <adeep@lexina.in>
>>> + */
>>> +
>>> +#include <common.h>
>>> +#include <dm.h>
>>> +#include <init.h>
>>> +#include <net.h>
>>> +#include <asm/io.h>
>>> +#include <asm/arch/axg.h>
>>> +#include <asm/arch/sm.h>
>>> +#include <asm/arch/eth.h>
>>> +#include <asm/arch/mem.h>
>>> +
>>> +int misc_init_r(void)
>>> +{
>>> +    u8 mac_addr[ARP_HLEN];
>>> +    char serial[SM_SERIAL_SIZE];
>>> +    u32 sid;
>>> +
>>> +    if (!meson_sm_get_serial(serial, SM_SERIAL_SIZE)) {
>>> +        sid = crc32(0, (unsigned char *)serial, SM_SERIAL_SIZE);
>>> +        /* Ensure the NIC specific bytes of the mac are not all 0 */
>>> +        if ((sid & 0xffff) == 0)
>>> +            sid |= 0x800000;
>>> +
>>> +        /* OUI registered MAC address */
>>> +        mac_addr[0] = 0x10;
>>> +        mac_addr[1] = 0x27;
>>> +        mac_addr[2] = 0xBE;
>>> +        mac_addr[3] = (sid >> 16) & 0xff;
>>> +        mac_addr[4] = (sid >>  8) & 0xff;
>>> +        mac_addr[5] = (sid >>  0) & 0xff;
>>> +
>>> +        eth_env_set_enetaddr("ethaddr", mac_addr);
>>> +    }
>>> +
>>> +    return 0;
>>> +}
>>> diff --git a/board/amlogic/jethub-j80/MAINTAINERS b/board/amlogic/jethub-j80/MAINTAINERS
>>> index 459e9f89da..a899153117 100644
>>> --- a/board/amlogic/jethub-j80/MAINTAINERS
>>> +++ b/board/amlogic/jethub-j80/MAINTAINERS
>>> @@ -4,6 +4,5 @@ S:    Maintained
>>>   L:    u-boot-amlogic@groups.io
>>>   F:    board/amlogic/jethub-j80/
>>>   F:    configs/jethub_j80_defconfig
>>> -F:    configs/jethub_j100_defconfig
>>>   F:    doc/board/amlogic/jethub-j80.rst
>>> -F:    doc/board/amlogic/jethub-j100.rst
>>> +F:    include/configs/jethub.h
>>> diff --git a/configs/jethub_j100_defconfig b/configs/jethub_j100_defconfig
>>> index 290ce4db85..ad026a89e0 100644
>>> --- a/configs/jethub_j100_defconfig
>>> +++ b/configs/jethub_j100_defconfig
>>> @@ -1,4 +1,5 @@
>>>   CONFIG_ARM=y
>>> +CONFIG_SYS_BOARD="jethub-j100"
>>>   CONFIG_SYS_CONFIG_NAME="jethub"
>>>   CONFIG_ARCH_MESON=y
>>>   CONFIG_SYS_TEXT_BASE=0x01000000
>>>
>>
>> Applied to u-boot-amlogic
>>
>> I will probably send it next week along `add sm efuse write support and cmd for read/write efuse`
>>
>> Thanks,
>> Neil


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ARM: amlogic: add JetHub D1 eth mac generation with manufacturer OUI
  2021-10-29 13:53     ` Neil Armstrong
@ 2021-10-29 14:49         ` Vyacheslav Bocharov
  2021-10-29 15:00       ` Vyacheslav Bocharov
  1 sibling, 0 replies; 9+ messages in thread
From: Vyacheslav @ 2021-10-29 14:49 UTC (permalink / raw)
  To: u-boot-amlogic, narmstrong; +Cc: u-boot

Fix build warning in misc_init_r jethub-j100.c

Signed-off-by: Vyacheslav Bocharov <adeep@lexina.in>

---
  board/amlogic/jethub-j100/jethub-j100.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/board/amlogic/jethub-j100/jethub-j100.c 
b/board/amlogic/jethub-j100/jethub-j100.c
index 575bb31573..6a2c4ad4c3 100644
--- a/board/amlogic/jethub-j100/jethub-j100.c
+++ b/board/amlogic/jethub-j100/jethub-j100.c
@@ -13,6 +13,7 @@
  #include <asm/arch/sm.h>
  #include <asm/arch/eth.h>
  #include <asm/arch/mem.h>
+#include <u-boot/crc.h>

  int misc_init_r(void)
  {
--
2.30.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] ARM: amlogic: add JetHub D1 eth mac generation with manufacturer OUI
@ 2021-10-29 14:49         ` Vyacheslav Bocharov
  0 siblings, 0 replies; 9+ messages in thread
From: Vyacheslav Bocharov @ 2021-10-29 14:49 UTC (permalink / raw)
  To: u-boot-amlogic, narmstrong; +Cc: u-boot

Fix build warning in misc_init_r jethub-j100.c

Signed-off-by: Vyacheslav Bocharov <adeep@lexina.in>

---
  board/amlogic/jethub-j100/jethub-j100.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/board/amlogic/jethub-j100/jethub-j100.c 
b/board/amlogic/jethub-j100/jethub-j100.c
index 575bb31573..6a2c4ad4c3 100644
--- a/board/amlogic/jethub-j100/jethub-j100.c
+++ b/board/amlogic/jethub-j100/jethub-j100.c
@@ -13,6 +13,7 @@
  #include <asm/arch/sm.h>
  #include <asm/arch/eth.h>
  #include <asm/arch/mem.h>
+#include <u-boot/crc.h>

  int misc_init_r(void)
  {
--
2.30.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] ARM: amlogic: add JetHub D1 eth mac generation with manufacturer OUI
  2021-10-29 13:53     ` Neil Armstrong
  2021-10-29 14:49         ` Vyacheslav Bocharov
@ 2021-10-29 15:00       ` Vyacheslav Bocharov
  1 sibling, 0 replies; 9+ messages in thread
From: Vyacheslav Bocharov @ 2021-10-29 15:00 UTC (permalink / raw)
  To: Neil Armstrong, u-boot-amlogic

Fixed my build to use -Werror :)
Thanks.

29.10.2021 16:53, Neil Armstrong пишет:
> Hi,
> 
> Ci fails with :
> 
> +board/amlogic/jethub-j100/jethub-j100.c: In function 'misc_init_r':
> 1516+board/amlogic/jethub-j100/jethub-j100.c:24:23: error: implicit declaration of function 'crc32' [-Werror=implicit-function-declaration]
> 1517+   24 |                 sid = crc32(0, (unsigned char *)serial, SM_SERIAL_SIZE);
> 1518+      |
> 
> Can you send a fix I can squash on the commit ?
> 
> Neil
> 
> On 29/10/2021 14:21, Vyacheslav wrote:
>> Thanks.
>>
>> 29.10.2021 15:08, Neil Armstrong пишет:
>>> On 29/10/2021 09:08, Vyacheslav Bocharov wrote:
>>>> JetHome has own MAC OUI. Add jethub-j100 board file. Update config.
>>>>
>>>> Signed-off-by: Vyacheslav Bocharov <adeep@lexina.in>
>>>> ---
>>>>    board/amlogic/jethub-j100/MAINTAINERS   |  8 +++++
>>>>    board/amlogic/jethub-j100/Makefile      |  6 ++++
>>>>    board/amlogic/jethub-j100/jethub-j100.c | 41 +++++++++++++++++++++++++
>>>>    board/amlogic/jethub-j80/MAINTAINERS    |  3 +-
>>>>    configs/jethub_j100_defconfig           |  1 +
>>>>    5 files changed, 57 insertions(+), 2 deletions(-)
>>>>    create mode 100644 board/amlogic/jethub-j100/MAINTAINERS
>>>>    create mode 100644 board/amlogic/jethub-j100/Makefile
>>>>    create mode 100644 board/amlogic/jethub-j100/jethub-j100.c
>>>>
>>>> diff --git a/board/amlogic/jethub-j100/MAINTAINERS b/board/amlogic/jethub-j100/MAINTAINERS
>>>> new file mode 100644
>>>> index 0000000000..43f6a5fc86
>>>> --- /dev/null
>>>> +++ b/board/amlogic/jethub-j100/MAINTAINERS
>>>> @@ -0,0 +1,8 @@
>>>> +JetHome JetHub
>>>> +M:    Vyacheslav Bocharov <adeep@lexina.in>
>>>> +S:    Maintained
>>>> +L:    u-boot-amlogic@groups.io
>>>> +F:    board/amlogic/jethub-j100/
>>>> +F:    configs/jethub_j100_defconfig
>>>> +F:    doc/board/amlogic/jethub-j100.rst
>>>> +F:    include/configs/jethub.h
>>>> diff --git a/board/amlogic/jethub-j100/Makefile b/board/amlogic/jethub-j100/Makefile
>>>> new file mode 100644
>>>> index 0000000000..4d935af984
>>>> --- /dev/null
>>>> +++ b/board/amlogic/jethub-j100/Makefile
>>>> @@ -0,0 +1,6 @@
>>>> +# SPDX-License-Identifier: GPL-2.0+
>>>> +#
>>>> +# (C) Copyright 2021 Vyacheslav Bocharov
>>>> +# Author: Vyacheslav Bocharov <adeep@lexina.in>
>>>> +
>>>> +obj-y    := jethub-j100.o
>>>> diff --git a/board/amlogic/jethub-j100/jethub-j100.c b/board/amlogic/jethub-j100/jethub-j100.c
>>>> new file mode 100644
>>>> index 0000000000..575bb31573
>>>> --- /dev/null
>>>> +++ b/board/amlogic/jethub-j100/jethub-j100.c
>>>> @@ -0,0 +1,41 @@
>>>> +// SPDX-License-Identifier: GPL-2.0+
>>>> +/*
>>>> + * Copyright (C) 2021 Vyacheslav Bocharov
>>>> + * Author: Vyacheslav Bocharov <adeep@lexina.in>
>>>> + */
>>>> +
>>>> +#include <common.h>
>>>> +#include <dm.h>
>>>> +#include <init.h>
>>>> +#include <net.h>
>>>> +#include <asm/io.h>
>>>> +#include <asm/arch/axg.h>
>>>> +#include <asm/arch/sm.h>
>>>> +#include <asm/arch/eth.h>
>>>> +#include <asm/arch/mem.h>
>>>> +
>>>> +int misc_init_r(void)
>>>> +{
>>>> +    u8 mac_addr[ARP_HLEN];
>>>> +    char serial[SM_SERIAL_SIZE];
>>>> +    u32 sid;
>>>> +
>>>> +    if (!meson_sm_get_serial(serial, SM_SERIAL_SIZE)) {
>>>> +        sid = crc32(0, (unsigned char *)serial, SM_SERIAL_SIZE);
>>>> +        /* Ensure the NIC specific bytes of the mac are not all 0 */
>>>> +        if ((sid & 0xffff) == 0)
>>>> +            sid |= 0x800000;
>>>> +
>>>> +        /* OUI registered MAC address */
>>>> +        mac_addr[0] = 0x10;
>>>> +        mac_addr[1] = 0x27;
>>>> +        mac_addr[2] = 0xBE;
>>>> +        mac_addr[3] = (sid >> 16) & 0xff;
>>>> +        mac_addr[4] = (sid >>  8) & 0xff;
>>>> +        mac_addr[5] = (sid >>  0) & 0xff;
>>>> +
>>>> +        eth_env_set_enetaddr("ethaddr", mac_addr);
>>>> +    }
>>>> +
>>>> +    return 0;
>>>> +}
>>>> diff --git a/board/amlogic/jethub-j80/MAINTAINERS b/board/amlogic/jethub-j80/MAINTAINERS
>>>> index 459e9f89da..a899153117 100644
>>>> --- a/board/amlogic/jethub-j80/MAINTAINERS
>>>> +++ b/board/amlogic/jethub-j80/MAINTAINERS
>>>> @@ -4,6 +4,5 @@ S:    Maintained
>>>>    L:    u-boot-amlogic@groups.io
>>>>    F:    board/amlogic/jethub-j80/
>>>>    F:    configs/jethub_j80_defconfig
>>>> -F:    configs/jethub_j100_defconfig
>>>>    F:    doc/board/amlogic/jethub-j80.rst
>>>> -F:    doc/board/amlogic/jethub-j100.rst
>>>> +F:    include/configs/jethub.h
>>>> diff --git a/configs/jethub_j100_defconfig b/configs/jethub_j100_defconfig
>>>> index 290ce4db85..ad026a89e0 100644
>>>> --- a/configs/jethub_j100_defconfig
>>>> +++ b/configs/jethub_j100_defconfig
>>>> @@ -1,4 +1,5 @@
>>>>    CONFIG_ARM=y
>>>> +CONFIG_SYS_BOARD="jethub-j100"
>>>>    CONFIG_SYS_CONFIG_NAME="jethub"
>>>>    CONFIG_ARCH_MESON=y
>>>>    CONFIG_SYS_TEXT_BASE=0x01000000
>>>>
>>>
>>> Applied to u-boot-amlogic
>>>
>>> I will probably send it next week along `add sm efuse write support and cmd for read/write efuse`
>>>
>>> Thanks,
>>> Neil
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ARM: amlogic: add JetHub D1 eth mac generation with manufacturer OUI
  2021-10-29 14:49         ` Vyacheslav Bocharov
  (?)
@ 2021-10-29 17:16         ` Neil Armstrong
  -1 siblings, 0 replies; 9+ messages in thread
From: Neil Armstrong @ 2021-10-29 17:16 UTC (permalink / raw)
  To: Vyacheslav, u-boot-amlogic; +Cc: u-boot

On 29/10/2021 16:49, Vyacheslav wrote:
> #include <u-boot/crc.h>

Thanks,
Applied & squashed !

Neil

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-10-29 17:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-29  7:08 [PATCH] ARM: amlogic: add JetHub D1 eth mac generation with manufacturer OUI Vyacheslav Bocharov
2021-10-29 12:08 ` Neil Armstrong
2021-10-29 12:21   ` Vyacheslav
2021-10-29 12:21     ` Vyacheslav Bocharov
2021-10-29 13:53     ` Neil Armstrong
2021-10-29 14:49       ` Vyacheslav
2021-10-29 14:49         ` Vyacheslav Bocharov
2021-10-29 17:16         ` Neil Armstrong
2021-10-29 15:00       ` Vyacheslav Bocharov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.