History log of /u-boot/net/eth_common.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 09c8b8de 06-Sep-2023 Marek Vasut <marek.vasut+renesas@mailbox.org>

net: phy: Remove unused NEEDS_MANUAL_RELOC code bits

The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8f8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>

# 9461d73d 19-Mar-2023 Marek Vasut <marek.vasut+renesas@mailbox.org>

net: phy: Only call phy_init() on systems needing manual relocation

The phy_init() is now used only to perform manual relocation of PHY
driver callbacks. Wrap it in ifdeffery and only call it on systems
which still require manual relocation, i.e. m68k .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)

# 9f664920 08-Aug-2021 Simon Glass <sjg@chromium.org>

net: Move network rules to drivers/net

The code under drivers/net is related to ethernet networking drivers, in
some fashion or another. Drop these from the top-level Makefile and
also move the phy rule into drivers/net/Makefile which is where it
belongs. Make the new rule for drivers/net check for the build-stage
relevant ETH symbol.

Fix up some Kconfig dependencies while we're here to mirror how the
Makefile logic now works.

Signed-off-by: Simon Glass <sjg@chromium.org>
[trini: Introduce ETH, Kconfig dependency changes, am43xx fix]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 52f24238 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop bootstage.h from common header

Move this fairly uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e7dcf564 01-Aug-2019 Simon Glass <sjg@chromium.org>

env: Drop environment.h header file where not needed

This header file is now only used by files that access internal
environment features. Drop it from various places where it is not needed.

Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Simon Glass <sjg@chromium.org>

# f1f0ae6a 01-Aug-2019 Simon Glass <sjg@chromium.org>

env: Move get_env_id() to env.h

Move this function over to the new header file. Also rename it to have an
env_ prefix like the other functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 9925f1db 01-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

net: Move enetaddr env access code to env config instead of net config

In order that we can use eth_env_* even when CONFIG_NET isn't set, move
these functions to environment code from net code.

This fixes failures such as:

board/ti/am335x/built-in.o: In function `board_late_init':
board/ti/am335x/board.c:752: undefined reference to `eth_env_set_enetaddr'
u-boot/board/ti/am335x/board.c:766: undefined reference to `eth_env_set_enetaddr'

which caters for use cases such as:

commit f411b5cca48f ("board: am335x: Always set eth/eth1addr environment
variable")

when Ethernet is required in Linux, but not U-Boot.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 35affd7a 03-Aug-2017 Simon Glass <sjg@chromium.org>

env: Rename eth_getenv_enetaddr() to eth_env_get_enetaddr()

Rename this function for consistency with env_get().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 00caae6d 03-Aug-2017 Simon Glass <sjg@chromium.org>

env: Rename getenv/_f() to env_get()

We are now using an env_ prefix for environment functions. Rename these
two functions for consistency. Also add function comments in common.h.

Quite a few places use getenv() in a condition context, provoking a
warning from checkpatch. These are fixed up in this patch also.

Suggested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>

# fd1e959e 03-Aug-2017 Simon Glass <sjg@chromium.org>

env: Rename eth_setenv_enetaddr() to eth_env_set_enetaddr()

Rename this function for consistency with env_set().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 382bee57 03-Aug-2017 Simon Glass <sjg@chromium.org>

env: Rename setenv() to env_set()

We are now using an env_ prefix for environment functions. Rename setenv()
for consistency. Also add function comments in common.h.

Suggested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>

# ee6fdfad 13-Mar-2017 Roger Quadros <rogerq@ti.com>

net: don't override ethernet address environment

If the ethernet address environment is set with a valid
ethernet address prevent overriding it as it is most likely
set by the user and he/she doesn't want board code to
automatically override it whatsoever.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 9f455bcb 25-Nov-2016 oliver@schinagl.nl <oliver@schinagl.nl>

net: cosmetic: Make the MAC address string less magical

In u-boot printf has been extended with the %pM formatter to allow
printing of MAC addresses. However buffers that want to store a MAC
address cannot safely get the size. Add a define for this case so the
string of a MAC address can be reliably obtained.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 8607a6bf 17-Jan-2016 Simon Glass <sjg@chromium.org>

net: Move remaining common functions to eth_common.c

Move eth_current_changed(), eth_set_current(), eth_mac_skip() and
eth_get_name() into the common file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 9987ecdd 17-Jan-2016 Simon Glass <sjg@chromium.org>

net: Move environment functions to the common file

Move the functions which set ethernet environment variables to the common
file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 818f91eb 17-Jan-2016 Simon Glass <sjg@chromium.org>

net: Move common init into a new eth_common.c file

Only half of the init is actually common. Move that part into a new common
file and call it from driver-model and legacy code. More common functions
will be added in future patches.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 9461d73d 19-Mar-2023 Marek Vasut <marek.vasut+renesas@mailbox.org>

net: phy: Only call phy_init() on systems needing manual relocation

The phy_init() is now used only to perform manual relocation of PHY
driver callbacks. Wrap it in ifdeffery and only call it on systems
which still require manual relocation, i.e. m68k .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)

# 9f664920 08-Aug-2021 Simon Glass <sjg@chromium.org>

net: Move network rules to drivers/net

The code under drivers/net is related to ethernet networking drivers, in
some fashion or another. Drop these from the top-level Makefile and
also move the phy rule into drivers/net/Makefile which is where it
belongs. Make the new rule for drivers/net check for the build-stage
relevant ETH symbol.

Fix up some Kconfig dependencies while we're here to mirror how the
Makefile logic now works.

Signed-off-by: Simon Glass <sjg@chromium.org>
[trini: Introduce ETH, Kconfig dependency changes, am43xx fix]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 52f24238 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop bootstage.h from common header

Move this fairly uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e7dcf564 01-Aug-2019 Simon Glass <sjg@chromium.org>

env: Drop environment.h header file where not needed

This header file is now only used by files that access internal
environment features. Drop it from various places where it is not needed.

Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Simon Glass <sjg@chromium.org>

# f1f0ae6a 01-Aug-2019 Simon Glass <sjg@chromium.org>

env: Move get_env_id() to env.h

Move this function over to the new header file. Also rename it to have an
env_ prefix like the other functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 9925f1db 01-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

net: Move enetaddr env access code to env config instead of net config

In order that we can use eth_env_* even when CONFIG_NET isn't set, move
these functions to environment code from net code.

This fixes failures such as:

board/ti/am335x/built-in.o: In function `board_late_init':
board/ti/am335x/board.c:752: undefined reference to `eth_env_set_enetaddr'
u-boot/board/ti/am335x/board.c:766: undefined reference to `eth_env_set_enetaddr'

which caters for use cases such as:

commit f411b5cca48f ("board: am335x: Always set eth/eth1addr environment
variable")

when Ethernet is required in Linux, but not U-Boot.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 35affd7a 03-Aug-2017 Simon Glass <sjg@chromium.org>

env: Rename eth_getenv_enetaddr() to eth_env_get_enetaddr()

Rename this function for consistency with env_get().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 00caae6d 03-Aug-2017 Simon Glass <sjg@chromium.org>

env: Rename getenv/_f() to env_get()

We are now using an env_ prefix for environment functions. Rename these
two functions for consistency. Also add function comments in common.h.

Quite a few places use getenv() in a condition context, provoking a
warning from checkpatch. These are fixed up in this patch also.

Suggested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>

# fd1e959e 03-Aug-2017 Simon Glass <sjg@chromium.org>

env: Rename eth_setenv_enetaddr() to eth_env_set_enetaddr()

Rename this function for consistency with env_set().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 382bee57 03-Aug-2017 Simon Glass <sjg@chromium.org>

env: Rename setenv() to env_set()

We are now using an env_ prefix for environment functions. Rename setenv()
for consistency. Also add function comments in common.h.

Suggested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>

# ee6fdfad 13-Mar-2017 Roger Quadros <rogerq@ti.com>

net: don't override ethernet address environment

If the ethernet address environment is set with a valid
ethernet address prevent overriding it as it is most likely
set by the user and he/she doesn't want board code to
automatically override it whatsoever.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 9f455bcb 25-Nov-2016 oliver@schinagl.nl <oliver@schinagl.nl>

net: cosmetic: Make the MAC address string less magical

In u-boot printf has been extended with the %pM formatter to allow
printing of MAC addresses. However buffers that want to store a MAC
address cannot safely get the size. Add a define for this case so the
string of a MAC address can be reliably obtained.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 8607a6bf 17-Jan-2016 Simon Glass <sjg@chromium.org>

net: Move remaining common functions to eth_common.c

Move eth_current_changed(), eth_set_current(), eth_mac_skip() and
eth_get_name() into the common file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 9987ecdd 17-Jan-2016 Simon Glass <sjg@chromium.org>

net: Move environment functions to the common file

Move the functions which set ethernet environment variables to the common
file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 818f91eb 17-Jan-2016 Simon Glass <sjg@chromium.org>

net: Move common init into a new eth_common.c file

Only half of the init is actually common. Move that part into a new common
file and call it from driver-model and legacy code. More common functions
will be added in future patches.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 9f664920 08-Aug-2021 Simon Glass <sjg@chromium.org>

net: Move network rules to drivers/net

The code under drivers/net is related to ethernet networking drivers, in
some fashion or another. Drop these from the top-level Makefile and
also move the phy rule into drivers/net/Makefile which is where it
belongs. Make the new rule for drivers/net check for the build-stage
relevant ETH symbol.

Fix up some Kconfig dependencies while we're here to mirror how the
Makefile logic now works.

Signed-off-by: Simon Glass <sjg@chromium.org>
[trini: Introduce ETH, Kconfig dependency changes, am43xx fix]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 52f24238 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop bootstage.h from common header

Move this fairly uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e7dcf564 01-Aug-2019 Simon Glass <sjg@chromium.org>

env: Drop environment.h header file where not needed

This header file is now only used by files that access internal
environment features. Drop it from various places where it is not needed.

Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Simon Glass <sjg@chromium.org>

# f1f0ae6a 01-Aug-2019 Simon Glass <sjg@chromium.org>

env: Move get_env_id() to env.h

Move this function over to the new header file. Also rename it to have an
env_ prefix like the other functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 9925f1db 01-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

net: Move enetaddr env access code to env config instead of net config

In order that we can use eth_env_* even when CONFIG_NET isn't set, move
these functions to environment code from net code.

This fixes failures such as:

board/ti/am335x/built-in.o: In function `board_late_init':
board/ti/am335x/board.c:752: undefined reference to `eth_env_set_enetaddr'
u-boot/board/ti/am335x/board.c:766: undefined reference to `eth_env_set_enetaddr'

which caters for use cases such as:

commit f411b5cca48f ("board: am335x: Always set eth/eth1addr environment
variable")

when Ethernet is required in Linux, but not U-Boot.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 35affd7a 03-Aug-2017 Simon Glass <sjg@chromium.org>

env: Rename eth_getenv_enetaddr() to eth_env_get_enetaddr()

Rename this function for consistency with env_get().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 00caae6d 03-Aug-2017 Simon Glass <sjg@chromium.org>

env: Rename getenv/_f() to env_get()

We are now using an env_ prefix for environment functions. Rename these
two functions for consistency. Also add function comments in common.h.

Quite a few places use getenv() in a condition context, provoking a
warning from checkpatch. These are fixed up in this patch also.

Suggested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>

# fd1e959e 03-Aug-2017 Simon Glass <sjg@chromium.org>

env: Rename eth_setenv_enetaddr() to eth_env_set_enetaddr()

Rename this function for consistency with env_set().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 382bee57 03-Aug-2017 Simon Glass <sjg@chromium.org>

env: Rename setenv() to env_set()

We are now using an env_ prefix for environment functions. Rename setenv()
for consistency. Also add function comments in common.h.

Suggested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>

# ee6fdfad 13-Mar-2017 Roger Quadros <rogerq@ti.com>

net: don't override ethernet address environment

If the ethernet address environment is set with a valid
ethernet address prevent overriding it as it is most likely
set by the user and he/she doesn't want board code to
automatically override it whatsoever.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 9f455bcb 25-Nov-2016 oliver@schinagl.nl <oliver@schinagl.nl>

net: cosmetic: Make the MAC address string less magical

In u-boot printf has been extended with the %pM formatter to allow
printing of MAC addresses. However buffers that want to store a MAC
address cannot safely get the size. Add a define for this case so the
string of a MAC address can be reliably obtained.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 8607a6bf 17-Jan-2016 Simon Glass <sjg@chromium.org>

net: Move remaining common functions to eth_common.c

Move eth_current_changed(), eth_set_current(), eth_mac_skip() and
eth_get_name() into the common file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 9987ecdd 17-Jan-2016 Simon Glass <sjg@chromium.org>

net: Move environment functions to the common file

Move the functions which set ethernet environment variables to the common
file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 818f91eb 17-Jan-2016 Simon Glass <sjg@chromium.org>

net: Move common init into a new eth_common.c file

Only half of the init is actually common. Move that part into a new common
file and call it from driver-model and legacy code. More common functions
will be added in future patches.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 52f24238 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop bootstage.h from common header

Move this fairly uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e7dcf564 01-Aug-2019 Simon Glass <sjg@chromium.org>

env: Drop environment.h header file where not needed

This header file is now only used by files that access internal
environment features. Drop it from various places where it is not needed.

Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Simon Glass <sjg@chromium.org>

# f1f0ae6a 01-Aug-2019 Simon Glass <sjg@chromium.org>

env: Move get_env_id() to env.h

Move this function over to the new header file. Also rename it to have an
env_ prefix like the other functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 9925f1db 01-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

net: Move enetaddr env access code to env config instead of net config

In order that we can use eth_env_* even when CONFIG_NET isn't set, move
these functions to environment code from net code.

This fixes failures such as:

board/ti/am335x/built-in.o: In function `board_late_init':
board/ti/am335x/board.c:752: undefined reference to `eth_env_set_enetaddr'
u-boot/board/ti/am335x/board.c:766: undefined reference to `eth_env_set_enetaddr'

which caters for use cases such as:

commit f411b5cca48f ("board: am335x: Always set eth/eth1addr environment
variable")

when Ethernet is required in Linux, but not U-Boot.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 35affd7a 03-Aug-2017 Simon Glass <sjg@chromium.org>

env: Rename eth_getenv_enetaddr() to eth_env_get_enetaddr()

Rename this function for consistency with env_get().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 00caae6d 03-Aug-2017 Simon Glass <sjg@chromium.org>

env: Rename getenv/_f() to env_get()

We are now using an env_ prefix for environment functions. Rename these
two functions for consistency. Also add function comments in common.h.

Quite a few places use getenv() in a condition context, provoking a
warning from checkpatch. These are fixed up in this patch also.

Suggested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>

# fd1e959e 03-Aug-2017 Simon Glass <sjg@chromium.org>

env: Rename eth_setenv_enetaddr() to eth_env_set_enetaddr()

Rename this function for consistency with env_set().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 382bee57 03-Aug-2017 Simon Glass <sjg@chromium.org>

env: Rename setenv() to env_set()

We are now using an env_ prefix for environment functions. Rename setenv()
for consistency. Also add function comments in common.h.

Suggested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>

# ee6fdfad 13-Mar-2017 Roger Quadros <rogerq@ti.com>

net: don't override ethernet address environment

If the ethernet address environment is set with a valid
ethernet address prevent overriding it as it is most likely
set by the user and he/she doesn't want board code to
automatically override it whatsoever.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 9f455bcb 25-Nov-2016 oliver@schinagl.nl <oliver@schinagl.nl>

net: cosmetic: Make the MAC address string less magical

In u-boot printf has been extended with the %pM formatter to allow
printing of MAC addresses. However buffers that want to store a MAC
address cannot safely get the size. Add a define for this case so the
string of a MAC address can be reliably obtained.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 8607a6bf 17-Jan-2016 Simon Glass <sjg@chromium.org>

net: Move remaining common functions to eth_common.c

Move eth_current_changed(), eth_set_current(), eth_mac_skip() and
eth_get_name() into the common file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 9987ecdd 17-Jan-2016 Simon Glass <sjg@chromium.org>

net: Move environment functions to the common file

Move the functions which set ethernet environment variables to the common
file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 818f91eb 17-Jan-2016 Simon Glass <sjg@chromium.org>

net: Move common init into a new eth_common.c file

Only half of the init is actually common. Move that part into a new common
file and call it from driver-model and legacy code. More common functions
will be added in future patches.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# e7dcf564 01-Aug-2019 Simon Glass <sjg@chromium.org>

env: Drop environment.h header file where not needed

This header file is now only used by files that access internal
environment features. Drop it from various places where it is not needed.

Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Simon Glass <sjg@chromium.org>

# f1f0ae6a 01-Aug-2019 Simon Glass <sjg@chromium.org>

env: Move get_env_id() to env.h

Move this function over to the new header file. Also rename it to have an
env_ prefix like the other functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# 9925f1db 01-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

net: Move enetaddr env access code to env config instead of net config

In order that we can use eth_env_* even when CONFIG_NET isn't set, move
these functions to environment code from net code.

This fixes failures such as:

board/ti/am335x/built-in.o: In function `board_late_init':
board/ti/am335x/board.c:752: undefined reference to `eth_env_set_enetaddr'
u-boot/board/ti/am335x/board.c:766: undefined reference to `eth_env_set_enetaddr'

which caters for use cases such as:

commit f411b5cca48f ("board: am335x: Always set eth/eth1addr environment
variable")

when Ethernet is required in Linux, but not U-Boot.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 35affd7a 03-Aug-2017 Simon Glass <sjg@chromium.org>

env: Rename eth_getenv_enetaddr() to eth_env_get_enetaddr()

Rename this function for consistency with env_get().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 00caae6d 03-Aug-2017 Simon Glass <sjg@chromium.org>

env: Rename getenv/_f() to env_get()

We are now using an env_ prefix for environment functions. Rename these
two functions for consistency. Also add function comments in common.h.

Quite a few places use getenv() in a condition context, provoking a
warning from checkpatch. These are fixed up in this patch also.

Suggested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>

# fd1e959e 03-Aug-2017 Simon Glass <sjg@chromium.org>

env: Rename eth_setenv_enetaddr() to eth_env_set_enetaddr()

Rename this function for consistency with env_set().

Signed-off-by: Simon Glass <sjg@chromium.org>

# 382bee57 03-Aug-2017 Simon Glass <sjg@chromium.org>

env: Rename setenv() to env_set()

We are now using an env_ prefix for environment functions. Rename setenv()
for consistency. Also add function comments in common.h.

Suggested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>

# ee6fdfad 13-Mar-2017 Roger Quadros <rogerq@ti.com>

net: don't override ethernet address environment

If the ethernet address environment is set with a valid
ethernet address prevent overriding it as it is most likely
set by the user and he/she doesn't want board code to
automatically override it whatsoever.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 9f455bcb 25-Nov-2016 oliver@schinagl.nl <oliver@schinagl.nl>

net: cosmetic: Make the MAC address string less magical

In u-boot printf has been extended with the %pM formatter to allow
printing of MAC addresses. However buffers that want to store a MAC
address cannot safely get the size. Add a define for this case so the
string of a MAC address can be reliably obtained.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 8607a6bf 17-Jan-2016 Simon Glass <sjg@chromium.org>

net: Move remaining common functions to eth_common.c

Move eth_current_changed(), eth_set_current(), eth_mac_skip() and
eth_get_name() into the common file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 9987ecdd 17-Jan-2016 Simon Glass <sjg@chromium.org>

net: Move environment functions to the common file

Move the functions which set ethernet environment variables to the common
file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 818f91eb 17-Jan-2016 Simon Glass <sjg@chromium.org>

net: Move common init into a new eth_common.c file

Only half of the init is actually common. Move that part into a new common
file and call it from driver-model and legacy code. More common functions
will be added in future patches.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>


# 9925f1db 01-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

net: Move enetaddr env access code to env config instead of net config

In order that we can use eth_env_* even when CONFIG_NET isn't set, move
these functions to environment code from net code.

This fixes failures such as:

board/ti/am335x/built-in.o: In function `board_late_init':
board/ti/am335x/board.c:752: undefined reference to `eth_env_set_enetaddr'
u-boot/board/ti/am335x/board.c:766: undefined reference to `eth_env_set_enetaddr'

which caters for use cases such as:

commit f411b5cca48f ("board: am335x: Always set eth/eth1addr environment
variable")

when Ethernet is required in Linux, but not U-Boot.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>


# 35affd7a 03-Aug-2017 Simon Glass <sjg@chromium.org>

env: Rename eth_getenv_enetaddr() to eth_env_get_enetaddr()

Rename this function for consistency with env_get().

Signed-off-by: Simon Glass <sjg@chromium.org>


# 00caae6d 03-Aug-2017 Simon Glass <sjg@chromium.org>

env: Rename getenv/_f() to env_get()

We are now using an env_ prefix for environment functions. Rename these
two functions for consistency. Also add function comments in common.h.

Quite a few places use getenv() in a condition context, provoking a
warning from checkpatch. These are fixed up in this patch also.

Suggested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>


# fd1e959e 03-Aug-2017 Simon Glass <sjg@chromium.org>

env: Rename eth_setenv_enetaddr() to eth_env_set_enetaddr()

Rename this function for consistency with env_set().

Signed-off-by: Simon Glass <sjg@chromium.org>


# 382bee57 03-Aug-2017 Simon Glass <sjg@chromium.org>

env: Rename setenv() to env_set()

We are now using an env_ prefix for environment functions. Rename setenv()
for consistency. Also add function comments in common.h.

Suggested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>


# ee6fdfad 13-Mar-2017 Roger Quadros <rogerq@ti.com>

net: don't override ethernet address environment

If the ethernet address environment is set with a valid
ethernet address prevent overriding it as it is most likely
set by the user and he/she doesn't want board code to
automatically override it whatsoever.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 9f455bcb 25-Nov-2016 oliver@schinagl.nl <oliver@schinagl.nl>

net: cosmetic: Make the MAC address string less magical

In u-boot printf has been extended with the %pM formatter to allow
printing of MAC addresses. However buffers that want to store a MAC
address cannot safely get the size. Add a define for this case so the
string of a MAC address can be reliably obtained.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>


# 8607a6bf 17-Jan-2016 Simon Glass <sjg@chromium.org>

net: Move remaining common functions to eth_common.c

Move eth_current_changed(), eth_set_current(), eth_mac_skip() and
eth_get_name() into the common file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>


# 9987ecdd 17-Jan-2016 Simon Glass <sjg@chromium.org>

net: Move environment functions to the common file

Move the functions which set ethernet environment variables to the common
file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>


# 818f91eb 17-Jan-2016 Simon Glass <sjg@chromium.org>

net: Move common init into a new eth_common.c file

Only half of the init is actually common. Move that part into a new common
file and call it from driver-model and legacy code. More common functions
will be added in future patches.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>