[U-Boot] [PATCH v2 04/20] arm: socfpga: Restructure misc driver
Ley Foon Tan
lftan.linux at gmail.com
Wed Mar 22 08:16:19 UTC 2017
On Tue, Mar 21, 2017 at 4:25 PM, Marek Vasut <marex at denx.de> wrote:
> On 03/21/2017 08:44 AM, Ley Foon Tan wrote:
>> On Fri, Mar 10, 2017 at 9:36 AM, Marek Vasut <marex at denx.de> wrote:
>>> On 03/09/2017 01:26 AM, Ley Foon Tan wrote:
>>>> Restructure misc driver in the preparation to support A10.
>>>> Move the Gen5 specific code to _gen5 file. No functional change.
>>>>
>>>> Change all uint32_t_to u32.
>>>>
>>>> Signed-off-by: Ley Foon Tan <ley.foon.tan at intel.com>
>>>> ---
>>>> arch/arm/mach-socfpga/Makefile | 3 +-
>>>> arch/arm/mach-socfpga/include/mach/misc.h | 26 +++
>>>> arch/arm/mach-socfpga/misc.c | 361 ++----------------------------
>>>> arch/arm/mach-socfpga/misc_gen5.c | 355 +++++++++++++++++++++++++++++
>>>> 4 files changed, 398 insertions(+), 347 deletions(-)
>>>> create mode 100644 arch/arm/mach-socfpga/include/mach/misc.h
>>>> create mode 100644 arch/arm/mach-socfpga/misc_gen5.c
>>>>
>>>> diff --git a/arch/arm/mach-socfpga/Makefile b/arch/arm/mach-socfpga/Makefile
>>>> index 97819ac..5b09ea9 100644
>>>> --- a/arch/arm/mach-socfpga/Makefile
>>>> +++ b/arch/arm/mach-socfpga/Makefile
>>>> @@ -14,7 +14,8 @@ obj-$(CONFIG_SPL_BUILD) += spl.o freeze_controller.o
>>>>
>>>> # QTS-generated config file wrappers
>>>> obj-$(CONFIG_TARGET_SOCFPGA_GEN5) += scan_manager.o wrap_pll_config.o \
>>>> - clock_manager_gen5.o reset_manager_gen5.o
>>>> + clock_manager_gen5.o reset_manager_gen5.o \
>>>> + misc_gen5.o
>>>> obj-$(CONFIG_SPL_BUILD) += wrap_iocsr_config.o wrap_pinmux_config.o \
>>>> wrap_sdram_config.o
>>>> CFLAGS_wrap_iocsr_config.o += -I$(srctree)/board/$(BOARDDIR)
>>>> diff --git a/arch/arm/mach-socfpga/include/mach/misc.h b/arch/arm/mach-socfpga/include/mach/misc.h
>>>> new file mode 100644
>>>> index 0000000..64f9b86
>>>> --- /dev/null
>>>> +++ b/arch/arm/mach-socfpga/include/mach/misc.h
>>>> @@ -0,0 +1,26 @@
>>>> +/*
>>>> + * Copyright (C) 2016-2017 Intel Corporation
>>>> + *
>>>> + * SPDX-License-Identifier: GPL-2.0
>>>> + */
>>>> +
>>>> +#ifndef _MISC_H_
>>>> +#define _MISC_H_
>>>> +
>>>> +void dwmac_deassert_reset(const unsigned int of_reset_id,
>>>> + const u32 phymode);
>>>> +
>>>> +struct bsel {
>>>> + const char *mode;
>>>> + const char *name;
>>>> +};
>>>> +
>>>> +extern struct bsel bsel_str[];
>>>
>>> I'm really not a big fan of extern variables, can we get rid of this?
>> For public variable, we need extern keyword here. Only function
>> prototype doesn't need the extern.
>
> Why does this have to be in public namespace anyway ?
We have same bsel_str[] array shared by both Gen5 and A10.
It used by both misc_gen5.c and misc_arria10.c.
Regards
Ley Foon
More information about the U-Boot
mailing list