Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1448761

Re: [RFC PATCH v1 2/2] drivers: soc: Add support for Hisilicon Djtag driver

From Paul Gortmaker <paul.gortmaker@gmail.com>
Newsgroups linux.kernel
Subject Re: [RFC PATCH v1 2/2] drivers: soc: Add support for Hisilicon Djtag driver
Date 2016-07-22 22:40 +0200
Message-ID <rXPoK-2cw-1@gated-at.bofh.it> (permalink)
References <rXEjD-3pq-1@gated-at.bofh.it> <rXEjE-3pq-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Jul 22, 2016 at 4:48 AM, Tan Xiaojun <tanxiaojun@huawei.com> wrote:
> The Hisilicon Djtag is an independent module which connects with some modules
> in the SoC by Debug Bus. This module can be configured to access the registers
> of connecting modules (like L3 cache) during real time debugging.
>
> This patch add the driver of Hisilicon Djtag.
>
> Signed-off-by: Tan Xiaojun <tanxiaojun@huawei.com>
> ---
>  drivers/soc/Kconfig                 |    1 +
>  drivers/soc/Makefile                |    1 +
>  drivers/soc/hisilicon/Kconfig       |   12 ++
>  drivers/soc/hisilicon/Makefile      |    1 +
>  drivers/soc/hisilicon/djtag.c       |  373 +++++++++++++++++++++++++++++++++++
>  include/linux/soc/hisilicon/djtag.h |   18 ++
>  6 files changed, 406 insertions(+)
>  create mode 100644 drivers/soc/hisilicon/Kconfig
>  create mode 100644 drivers/soc/hisilicon/Makefile
>  create mode 100644 drivers/soc/hisilicon/djtag.c
>  create mode 100644 include/linux/soc/hisilicon/djtag.h
>
> diff --git a/drivers/soc/Kconfig b/drivers/soc/Kconfig
> index cb58ef0..f5982ec 100644
> --- a/drivers/soc/Kconfig
> +++ b/drivers/soc/Kconfig
> @@ -3,6 +3,7 @@ menu "SOC (System On Chip) specific Drivers"
>  source "drivers/soc/bcm/Kconfig"
>  source "drivers/soc/brcmstb/Kconfig"
>  source "drivers/soc/fsl/qe/Kconfig"
> +source "drivers/soc/hisilicon/Kconfig"
>  source "drivers/soc/mediatek/Kconfig"
>  source "drivers/soc/qcom/Kconfig"
>  source "drivers/soc/rockchip/Kconfig"
> diff --git a/drivers/soc/Makefile b/drivers/soc/Makefile
> index 380230f..373449d 100644
> --- a/drivers/soc/Makefile
> +++ b/drivers/soc/Makefile
> @@ -7,6 +7,7 @@ obj-$(CONFIG_SOC_BRCMSTB)       += brcmstb/
>  obj-$(CONFIG_ARCH_DOVE)                += dove/
>  obj-$(CONFIG_MACH_DOVE)                += dove/
>  obj-y                          += fsl/
> +obj-$(CONFIG_ARCH_HISI)                += hisilicon/
>  obj-$(CONFIG_ARCH_MEDIATEK)    += mediatek/
>  obj-$(CONFIG_ARCH_QCOM)                += qcom/
>  obj-$(CONFIG_ARCH_RENESAS)     += renesas/
> diff --git a/drivers/soc/hisilicon/Kconfig b/drivers/soc/hisilicon/Kconfig
> new file mode 100644
> index 0000000..3644aab
> --- /dev/null
> +++ b/drivers/soc/hisilicon/Kconfig
> @@ -0,0 +1,12 @@
> +#
> +# Hisilicon SoC drivers
> +#
> +config HISI_DJTAG
> +       bool "Hisilicon Djtag Support"
> +       depends on ARCH_HISI || COMPILE_TEST
> +       help
> +         Say y here to enable the Hisilicon Djtag support. It is an
> +         independent module which connects with some modules in the
> +         SoC by Debug Bus. This module can be configured to access
> +         the registers of connecting modules during real time
> +         debugging.

Choice of word "module" here is probably confusing since it normally
means a ".ko" when used in Kconfig help.   Maybe instead, use:

...independent component...

...connects with some other components....

This driver can be configured to ....

--hopefully  the above will clarify against such confusion.   Also....

> diff --git a/drivers/soc/hisilicon/Makefile b/drivers/soc/hisilicon/Makefile
> new file mode 100644
> index 0000000..35a7b4b
> --- /dev/null
> +++ b/drivers/soc/hisilicon/Makefile
> @@ -0,0 +1 @@
> +obj-$(CONFIG_HISI_DJTAG)       += djtag.o
> diff --git a/drivers/soc/hisilicon/djtag.c b/drivers/soc/hisilicon/djtag.c
> new file mode 100644
> index 0000000..41e11ed
> --- /dev/null
> +++ b/drivers/soc/hisilicon/djtag.c
> @@ -0,0 +1,373 @@
> +/*
> + * Driver for Hisilicon Djtag r/w via System Controller.
> + *
> + * Copyright (C) 2016 Hisilicon Ltd.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include <linux/bitops.h>
> +#include <linux/init.h>
> +#include <linux/list.h>
> +#include <linux/mfd/syscon.h>
> +#include <linux/module.h>

...since you add the driver as a bool Kconfig item, you should
avoid using module.h and any MODULE_<xyz> tags.  Use the
builtin registration functions instead.

Alternatively, if there is a genuine use case for this to really be
a dynamically loadable .ko module, then convert it to tristate.

Thanks,
Paul.
--
> +#include <linux/of.h>
> +#include <linux/of_address.h>
> +#include <linux/of_device.h>
> +#include <linux/platform_device.h>
> +#include <linux/regmap.h>
> +#include <linux/slab.h>
> +#include <linux/spinlock.h>
> +
> +#include <asm-generic/delay.h>
> +#include <linux/soc/hisilicon/djtag.h>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC PATCH v1 0/2] Add Hisilicon Djtag driver Tan Xiaojun <tanxiaojun@huawei.com> - 2016-07-22 10:50 +0200
  [RFC PATCH v1 1/2] Documentation: arm64: Add Hisilicon HiP05/06/07 Sysctrl and Djtag dts bindings Tan Xiaojun <tanxiaojun@huawei.com> - 2016-07-22 10:50 +0200
  [RFC PATCH v1 2/2] drivers: soc: Add support for Hisilicon Djtag driver Tan Xiaojun <tanxiaojun@huawei.com> - 2016-07-22 10:50 +0200
    Re: [RFC PATCH v1 2/2] drivers: soc: Add support for Hisilicon Djtag driver Paul Gortmaker <paul.gortmaker@gmail.com> - 2016-07-22 22:40 +0200
      Re: [RFC PATCH v1 2/2] drivers: soc: Add support for Hisilicon Djtag  driver Tan Xiaojun <tanxiaojun@huawei.com> - 2016-07-25 04:00 +0200
  Re: [RFC PATCH v1 0/2] Add Hisilicon Djtag driver Mark Rutland <mark.rutland@arm.com> - 2016-07-22 13:00 +0200
    Re: [RFC PATCH v1 0/2] Add Hisilicon Djtag driver Arnd Bergmann <arnd@arndb.de> - 2016-07-22 15:40 +0200
      Re: [RFC PATCH v1 0/2] Add Hisilicon Djtag driver Tan Xiaojun <tanxiaojun@huawei.com> - 2016-07-25 04:20 +0200
    Re: [RFC PATCH v1 0/2] Add Hisilicon Djtag driver Tan Xiaojun <tanxiaojun@huawei.com> - 2016-07-25 04:10 +0200

csiph-web