* Re: [PATCH v6 05/14] mmc: sdhci-msm: Update DLL reset sequence
From: Ritesh Harjani @ 2016-11-09 12:06 UTC (permalink / raw)
To: Stephen Boyd
Cc: ulf.hansson, linux-mmc, adrian.hunter, shawn.lin, devicetree,
linux-clk, david.brown, andy.gross, linux-arm-msm, georgi.djakov,
alex.lemberg, mateusz.nowak, Yuliy.Izrailov, asutoshd, kdorfman,
david.griego, stummala, venkatg, rnayak, pramod.gurav
In-Reply-To: <20161108230622.GN16026@codeaurora.org>
Hi Stephen,
On 11/9/2016 4:36 AM, Stephen Boyd wrote:
> On 11/07, Ritesh Harjani wrote:
>>
>> diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
>> index 42f42aa..32b0b79 100644
>> --- a/drivers/mmc/host/sdhci-msm.c
>> +++ b/drivers/mmc/host/sdhci-msm.c
>> @@ -58,11 +58,17 @@
>> #define CORE_DLL_CONFIG 0x100
>> #define CORE_DLL_STATUS 0x108
>>
>> +#define CORE_DLL_CONFIG_2 0x1b4
>> +#define CORE_FLL_CYCLE_CNT BIT(18)
>> +#define CORE_DLL_CLOCK_DISABLE BIT(21)
>> +
>> #define CORE_VENDOR_SPEC 0x10c
>> #define CORE_CLK_PWRSAVE BIT(1)
>>
>> #define CORE_VENDOR_SPEC_CAPABILITIES0 0x11c
>>
>> +#define TCXO_FREQ 19200000
>
> TCXO_FREQ could change based on the board. For example, IPQ has
> it as 25 MHz.
Actually not sure of the proper way on how to get this freq in driver
today. We may use xo_board clock but, it is not available for all boards
except 8996/8916 I guess.
Also, there is no sdhc for IPQ board and for all other boards TCXO_FREQ
is same where sdhci-msm driver is used. For that purpose this was
defined here for sdhci-msm driver.
Do you think in that case we should keep it this way for now and later
change if a need arise to change the TCXO_FREQ ?
>
>> +
>> #define CDR_SELEXT_SHIFT 20
>> #define CDR_SELEXT_MASK (0xf << CDR_SELEXT_SHIFT)
>> #define CMUX_SHIFT_PHASE_SHIFT 24
>> @@ -330,6 +349,24 @@ static int msm_init_cm_dll(struct sdhci_host *host)
>> writel_relaxed(config, host->ioaddr + CORE_DLL_CONFIG);
>> msm_cm_dll_set_freq(host);
>>
>> + if (msm_host->use_14lpp_dll_reset) {
>> + u32 mclk_freq = 0;
>> +
>> + if ((readl_relaxed(host->ioaddr + CORE_DLL_CONFIG_2)
>> + & CORE_FLL_CYCLE_CNT))
>
> I suggest you grow a local variable.
Ok.
>
>> + mclk_freq = (u32)((host->clock / TCXO_FREQ) * 8);
>
> Is the cast necessary?
Will remove it.
>
>> + else
>> + mclk_freq = (u32)((host->clock / TCXO_FREQ) * 4);
>
> Ditto
Will remove it.
>
>> +
>> + config = readl_relaxed(host->ioaddr + CORE_DLL_CONFIG_2);
>> + config &= ~(0xFF << 10);
>> + config |= mclk_freq << 10;
>> +
>> + writel_relaxed(config, host->ioaddr + CORE_DLL_CONFIG_2);
>> + /* wait for 5us before enabling DLL clock */
>
> Usually there's a barrier between writel_relaxed() and delay
> because we don't know when the writel will be posted out and the
> delay is there to wait for the operation to happen. Probably
> should change this to be a writel() instead.
Arnd, already explained here.
We do need the udelay here as per the HW sequence itself.
>
>> + udelay(5);
>> + }
>> +
>> /* Write 0 to DLL_RST bit of DLL_CONFIG register */
>> config = readl_relaxed(host->ioaddr + CORE_DLL_CONFIG);
>> config &= ~CORE_DLL_RST;
>> @@ -340,6 +377,14 @@ static int msm_init_cm_dll(struct sdhci_host *host)
>> config &= ~CORE_DLL_PDN;
>> writel_relaxed(config, host->ioaddr + CORE_DLL_CONFIG);
>>
>> + if (msm_host->use_14lpp_dll_reset) {
>> + msm_cm_dll_set_freq(host);
>> + /* Enable the DLL clock */
>> + config = readl_relaxed(host->ioaddr + CORE_DLL_CONFIG_2);
>> + config &= ~CORE_DLL_CLOCK_DISABLE;
>> + writel_relaxed(config, host->ioaddr + CORE_DLL_CONFIG_2);
>> + }
>> +
>> /* Set DLL_EN bit to 1. */
>> config = readl_relaxed(host->ioaddr + CORE_DLL_CONFIG);
>> config |= CORE_DLL_EN;
>> @@ -641,6 +686,9 @@ static int sdhci_msm_probe(struct platform_device *pdev)
>> dev_dbg(&pdev->dev, "MCI Version: 0x%08x, major: 0x%04x, minor: 0x%02x\n",
>> core_version, core_major, core_minor);
>>
>> + if ((core_major == 1) && (core_minor >= 0x42))
>
> Why so many parenthesis?
Sure, will remove it.
>
>> + msm_host->use_14lpp_dll_reset = true;
>> +
>> /*
>
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply
* Re: [PATCH] weston: upgrade from 1.11.1 to 1.12.0
From: Jussi Kukkonen @ 2016-11-09 12:07 UTC (permalink / raw)
To: Fathi Boudra; +Cc: Patches and discussions about the oe-core layer
In-Reply-To: <20161108135457.13249-1-fathi.boudra@linaro.org>
[-- Attachment #1: Type: text/plain, Size: 17778 bytes --]
On 8 November 2016 at 15:54, Fathi Boudra <fathi.boudra@linaro.org> wrote:
> From: Daniel Díaz <daniel.diaz@linaro.org>
>
> * Refresh patches to apply cleanly on 1.12.0 (no changes):
> - 0001-make-error-portable.patch
> - 0001-configure.ac-Fix-wayland-protocols-path.patch
> - 0001-weston-launch-Provide-a-default-version-that-doesn-t.patch
> - 0001-Add-configuration-option-for-no-input-device.patch
> * Remove 0001-shared-include-stdint.h-for-int32_t.patch applied
> upstream
> https://cgit.freedesktop.org/wayland/weston/commit/?id=649bbce6
> * Update license files checksum, compositor.c location has changed.
> No license changes.
> * Drop --disable-rpi-compositor from EXTRA_OE_CONF. Raspberry Pi backend
> and renderer have been removed upstream. The option doesn't exist
> anymore.
> * Adjust files names to the new naming: weston -> libweston-1.
>
These changes look good to me. That said I think we should start separating
the package into weston (compositor shells, plugins and essential tools)
and libweston (the public libraries) at this point since upstream is now
saying it should work. Can you do this as part of the upgrade?
libweston should contain {libdir}/*.so.* as usual but I believe also
{libdir}/libweston-1/* (the backends). The weston plugins
({libdir}/weston/*) should stay in weston itself
Cheers,
Jussi
> Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
> Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
> ---
> ...-configuration-option-for-no-input-device.patch | 39
> +++++++++++-----------
> ...1-configure.ac-Fix-wayland-protocols-path.patch | 4 +--
> .../wayland/weston/0001-make-error-portable.patch | 20 +++++------
> .../0001-shared-include-stdint.h-for-int32_t.patch | 23 -------------
> ...ch-Provide-a-default-version-that-doesn-t.patch | 28 ++++++++--------
> .../wayland/{weston_1.11.1.bb => weston_1.12.0.bb} | 12 +++----
> 6 files changed, 51 insertions(+), 75 deletions(-)
> delete mode 100644 meta/recipes-graphics/wayland/
> weston/0001-shared-include-stdint.h-for-int32_t.patch
> rename meta/recipes-graphics/wayland/{weston_1.11.1.bb =>
> weston_1.12.0.bb} (92%)
>
> diff --git a/meta/recipes-graphics/wayland/weston/0001-Add-
> configuration-option-for-no-input-device.patch b/meta/recipes-graphics/
> wayland/weston/0001-Add-configuration-option-for-no-input-device.patch
> index c45f3ad..a822d4a 100644
> --- a/meta/recipes-graphics/wayland/weston/0001-Add-
> configuration-option-for-no-input-device.patch
> +++ b/meta/recipes-graphics/wayland/weston/0001-Add-
> configuration-option-for-no-input-device.patch
> @@ -31,24 +31,24 @@ Reviewed-by: Daniel Stone <daniels@collabora.com>
> Upstream-Status: backport from
> https://cgit.freedesktop.org/wayland/weston/commit/?id=75b7197f
> ---
> - man/weston.ini.man | 5 +++++
> - src/compositor.h | 3 +++
> - src/libinput-seat.c | 6 ++++++
> - src/main.c | 5 +++++
> - weston.ini.in | 1 +
> - 5 files changed, 20 insertions(+)
> + compositor/main.c | 5 +++++
> + libweston/compositor.h | 4 ++++
> + libweston/libinput-seat.c | 6 ++++++
> + man/weston.ini.man | 5 +++++
> + weston.ini.in | 1 +
> + 5 files changed, 21 insertions(+)
>
> ---- a/src/main.c
> -+++ b/src/main.c
> -@@ -1298,6 +1298,7 @@ int main(int argc, char *argv[])
> - struct wl_client *primary_client;
> +--- a/compositor/main.c
> ++++ b/compositor/main.c
> +@@ -1595,6 +1595,7 @@ int main(int argc, char *argv[])
> struct wl_listener primary_client_destroyed;
> struct weston_seat *seat;
> -+ int require_input;
> + struct wet_compositor user_data;
> ++ int require_input;
>
> const struct weston_option core_options[] = {
> { WESTON_OPTION_STRING, "backend", 'B', &backend },
> -@@ -1373,6 +1374,10 @@ int main(int argc, char *argv[])
> +@@ -1678,6 +1679,10 @@ int main(int argc, char *argv[])
> if (weston_compositor_init_config(ec, config) < 0)
> goto out;
>
> @@ -59,21 +59,22 @@ https://cgit.freedesktop.org/
> wayland/weston/commit/?id=75b7197f
> if (load_backend(ec, backend, &argc, argv, config) < 0) {
> weston_log("fatal: failed to create compositor backend\n");
> goto out;
> ---- a/src/compositor.h
> -+++ b/src/compositor.h
> -@@ -803,6 +803,9 @@ struct weston_compositor {
> +--- a/libweston/compositor.h
> ++++ b/libweston/compositor.h
> +@@ -836,6 +836,10 @@ struct weston_compositor {
>
> void *user_data;
> void (*exit)(struct weston_compositor *c);
> +
> + /* Whether to let the compositor run without any input device. */
> + bool require_input;
> ++
> };
>
> struct weston_buffer {
> ---- a/src/libinput-seat.c
> -+++ b/src/libinput-seat.c
> -@@ -255,6 +255,12 @@ udev_input_enable(struct udev_input *inp
> +--- a/libweston/libinput-seat.c
> ++++ b/libweston/libinput-seat.c
> +@@ -259,6 +259,12 @@ udev_input_enable(struct udev_input *inp
> devices_found = 1;
> }
>
> @@ -88,7 +89,7 @@ https://cgit.freedesktop.org/wayland/weston/commit/?id=
> 75b7197f
> "warning: no input devices on entering Weston. "
> --- a/man/weston.ini.man
> +++ b/man/weston.ini.man
> -@@ -169,6 +169,11 @@ time, the one specified in the command-l
> +@@ -168,6 +168,11 @@ time, the one specified in the command-l
> hand, if none of these sets the value, default idle timeout will be
> set to 300 seconds.
> .RS
> diff --git a/meta/recipes-graphics/wayland/weston/0001-configure.
> ac-Fix-wayland-protocols-path.patch b/meta/recipes-graphics/
> wayland/weston/0001-configure.ac-Fix-wayland-protocols-path.patch
> index edd3b91..39000d4 100644
> --- a/meta/recipes-graphics/wayland/weston/0001-configure.
> ac-Fix-wayland-protocols-path.patch
> +++ b/meta/recipes-graphics/wayland/weston/0001-configure.
> ac-Fix-wayland-protocols-path.patch
> @@ -18,10 +18,10 @@ Upstream-Status: Inappropriate [embedded specific]
>
> --- a/configure.ac
> +++ b/configure.ac
> -@@ -187,7 +187,7 @@ PKG_CHECK_MODULES(LIBINPUT_BACKEND, [lib
> +@@ -229,7 +229,7 @@ PKG_CHECK_MODULES(LIBINPUT_BACKEND, [lib
> PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES])
>
> - PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 1.2],
> + PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 1.7],
> - [ac_wayland_protocols_pkgdatadir=`$PKG_CONFIG
> --variable=pkgdatadir wayland-protocols`])
> + [ac_wayland_protocols_pkgdatadir=${WAYLAND_
> PROTOCOLS_SYSROOT_DIR}`$PKG_CONFIG --variable=pkgdatadir
> wayland-protocols`])
> AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, $ac_wayland_protocols_pkgdatadir)
> diff --git a/meta/recipes-graphics/wayland/weston/0001-make-error-portable.patch
> b/meta/recipes-graphics/wayland/weston/0001-make-error-portable.patch
> index f7b5284..c41ea49 100644
> --- a/meta/recipes-graphics/wayland/weston/0001-make-error-portable.patch
> +++ b/meta/recipes-graphics/wayland/weston/0001-make-error-portable.patch
> @@ -7,18 +7,18 @@ error() is not posix but gnu extension so may not be
> available on all
> kind of systemsi e.g. musl.
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ----
> -Upstream-Status: Submitted
>
> - configure.ac | 2 ++
> - src/weston-error.h | 20 ++++++++++++++++++++
> - src/weston-launch.c | 2 +-
> +Upstream-Status: Submitted
> +---
> + configure.ac | 2 ++
> + libweston/weston-error.h | 20 ++++++++++++++++++++
> + libweston/weston-launch.c | 2 +-
> 3 files changed, 23 insertions(+), 1 deletion(-)
> - create mode 100644 src/weston-error.h
> + create mode 100644 libweston/weston-error.h
>
> --- a/configure.ac
> +++ b/configure.ac
> -@@ -60,6 +60,8 @@ AC_CHECK_DECL(CLOCK_MONOTONIC,[],
> +@@ -102,6 +102,8 @@ AC_CHECK_DECL(CLOCK_MONOTONIC,[],
> [[#include <time.h>]])
> AC_CHECK_HEADERS([execinfo.h])
>
> @@ -28,7 +28,7 @@ Upstream-Status: Submitted
>
> COMPOSITOR_MODULES="wayland-server >= $WAYLAND_PREREQ_VERSION pixman-1
> >= 0.25.2"
> --- /dev/null
> -+++ b/src/weston-error.h
> ++++ b/libweston/weston-error.h
> @@ -0,0 +1,20 @@
> +#ifndef _WESTON_ERROR_H
> +#define _WESTON_ERROR_H
> @@ -50,8 +50,8 @@ Upstream-Status: Submitted
> +
> +#endif
> +
> ---- a/src/weston-launch.c
> -+++ b/src/weston-launch.c
> +--- a/libweston/weston-launch.c
> ++++ b/libweston/weston-launch.c
> @@ -33,7 +33,6 @@
> #include <poll.h>
> #include <errno.h>
> diff --git a/meta/recipes-graphics/wayland/weston/0001-shared-
> include-stdint.h-for-int32_t.patch b/meta/recipes-graphics/
> wayland/weston/0001-shared-include-stdint.h-for-int32_t.patch
> deleted file mode 100644
> index ee66c20..0000000
> --- a/meta/recipes-graphics/wayland/weston/0001-shared-
> include-stdint.h-for-int32_t.patch
> +++ /dev/null
> @@ -1,23 +0,0 @@
> -From ba02b8abe4e2afac2bfbf2559972d5059d75a041 Mon Sep 17 00:00:00 2001
> -From: Jussi Kukkonen <jussi.kukkonen@intel.com>
> -Date: Sat, 16 Jul 2016 22:50:19 +0300
> -Subject: [PATCH weston] shared: include stdint.h for int32_t
> -
> -This fixes build on musl.
> -
> -Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
> -Upstream-Status: Submitted
> ----
> - shared/xalloc.h | 1 +
> - 1 file changed, 1 insertion(+)
> -
> ---- a/shared/xalloc.h
> -+++ b/shared/xalloc.h
> -@@ -30,6 +30,7 @@
> - extern "C" {
> - #endif
> -
> -+#include <stdint.h>
> - #include <stdlib.h>
> - #include <string.h>
> -
> diff --git a/meta/recipes-graphics/wayland/weston/0001-weston-
> launch-Provide-a-default-version-that-doesn-t.patch
> b/meta/recipes-graphics/wayland/weston/0001-weston-
> launch-Provide-a-default-version-that-doesn-t.patch
> index d684b1c..3d12d53 100644
> --- a/meta/recipes-graphics/wayland/weston/0001-weston-
> launch-Provide-a-default-version-that-doesn-t.patch
> +++ b/meta/recipes-graphics/wayland/weston/0001-weston-
> launch-Provide-a-default-version-that-doesn-t.patch
> @@ -14,13 +14,13 @@ Upstream-Status: Pending
>
> Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
> ---
> - configure.ac | 9 +++++++--
> - src/weston-launch.c | 20 ++++++++++++++++++++
> + configure.ac | 9 +++++++--
> + libweston/weston-launch.c | 20 ++++++++++++++++++++
> 2 files changed, 27 insertions(+), 2 deletions(-)
>
> --- a/configure.ac
> +++ b/configure.ac
> -@@ -416,13 +416,17 @@ AC_ARG_ENABLE(resize-optimization,
> +@@ -441,13 +441,17 @@ AC_ARG_ENABLE(resize-optimization,
> AS_IF([test "x$enable_resize_optimization" = "xyes"],
> [AC_DEFINE([USE_RESIZE_POOL], [1], [Use resize memory pool as a
> performance optimization])])
>
> @@ -40,7 +40,7 @@ Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
> fi
>
> AM_CONDITIONAL(HAVE_PANGO, test "x$have_pango" = "xyes")
> -@@ -673,6 +677,7 @@ AC_MSG_RESULT([
> +@@ -704,6 +708,7 @@ AC_MSG_RESULT([
> Enable developer documentation ${enable_devdocs}
>
> weston-launch utility ${enable_weston_launch}
> @@ -48,8 +48,8 @@ Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
> systemd-login support ${have_systemd_login}
> systemd notify support ${enable_systemd_notify}
>
> ---- a/src/weston-launch.c
> -+++ b/src/weston-launch.c
> +--- a/libweston/weston-launch.c
> ++++ b/libweston/weston-launch.c
> @@ -51,7 +51,9 @@
>
> #include <pwd.h>
> @@ -103,7 +103,7 @@ Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
>
> if (ioctl(wl->tty, KDSKBMUTE, 0) &&
> ioctl(wl->tty, KDSKBMODE, wl->kb_mode))
> -@@ -600,6 +608,7 @@ setup_session(struct weston_launch *wl)
> +@@ -600,6 +608,7 @@ setup_session(struct weston_launch *wl,
> setenv("HOME", wl->pw->pw_dir, 1);
> setenv("SHELL", wl->pw->pw_shell, 1);
>
> @@ -111,15 +111,15 @@ Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
> env = pam_getenvlist(wl->ph);
> if (env) {
> for (i = 0; env[i]; ++i) {
> -@@ -608,6 +617,7 @@ setup_session(struct weston_launch *wl)
> +@@ -608,6 +617,7 @@ setup_session(struct weston_launch *wl,
> }
> free(env);
> }
> +#endif
> - }
>
> - static void
> -@@ -665,7 +675,9 @@ static void
> + /*
> + * We open a new session, so it makes sense
> +@@ -675,7 +685,9 @@ static void
> help(const char *name)
> {
> fprintf(stderr, "Usage: %s [args...] [-- [weston args..]]\n",
> name);
> @@ -129,7 +129,7 @@ Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
> fprintf(stderr, " -t, --tty Start session on alternative
> tty\n");
> fprintf(stderr, " -v, --verbose Be verbose\n");
> fprintf(stderr, " -h, --help Display this help message\n");
> -@@ -678,7 +690,9 @@ main(int argc, char *argv[])
> +@@ -688,7 +700,9 @@ main(int argc, char *argv[])
> int i, c;
> char *tty = NULL;
> struct option opts[] = {
> @@ -139,7 +139,7 @@ Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
> { "tty", required_argument, NULL, 't' },
> { "verbose", no_argument, NULL, 'v' },
> { "help", no_argument, NULL, 'h' },
> -@@ -690,9 +704,13 @@ main(int argc, char *argv[])
> +@@ -700,9 +714,13 @@ main(int argc, char *argv[])
> while ((c = getopt_long(argc, argv, "u:t::vh", opts, &i)) != -1) {
> switch (c) {
> case 'u':
> @@ -153,7 +153,7 @@ Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
> break;
> case 't':
> tty = optarg;
> -@@ -732,8 +750,10 @@ main(int argc, char *argv[])
> +@@ -740,8 +758,10 @@ main(int argc, char *argv[])
> if (setup_tty(&wl, tty) < 0)
> exit(EXIT_FAILURE);
>
> diff --git a/meta/recipes-graphics/wayland/weston_1.11.1.bb
> b/meta/recipes-graphics/wayland/weston_1.12.0.bb
> similarity index 92%
> rename from meta/recipes-graphics/wayland/weston_1.11.1.bb
> rename to meta/recipes-graphics/wayland/weston_1.12.0.bb
> index 7e75cf7..f944646 100644
> --- a/meta/recipes-graphics/wayland/weston_1.11.1.bb
> +++ b/meta/recipes-graphics/wayland/weston_1.12.0.bb
> @@ -3,20 +3,19 @@ DESCRIPTION = "Weston is the reference implementation of
> a Wayland compositor"
> HOMEPAGE = "http://wayland.freedesktop.org"
> LICENSE = "MIT"
> LIC_FILES_CHKSUM = "file://COPYING;md5=d79ee9e66bb0f95d3386a7acae780b70 \
> - file://src/compositor.c;endline=23;md5=
> 1d535fed266cf39f6d8c0647f52ac331"
> + file://libweston/compositor.c;endline=23;md5=
> 1d535fed266cf39f6d8c0647f52ac331"
>
> SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \
> file://weston.png \
> file://weston.desktop \
> file://0001-make-error-portable.patch \
> file://0001-configure.ac-Fix-wayland-protocols-path.patch \
> - file://0001-shared-include-stdint.h-for-int32_t.patch \
> file://xwayland.weston-start \
> file://0001-weston-launch-Provide-a-default-version-that-doesn-t.patch
> \
> file://0001-Add-configuration-option-for-no-input-device.patch
> \
> "
> -SRC_URI[md5sum] = "c5fdc02ab67d33c0fca8f72d341facdf"
> -SRC_URI[sha256sum] = "548973496a5c8613d6690f9120f210
> 66946a544df65ce4fe0ef153a8dc0bf6de"
> +SRC_URI[md5sum] = "310af6d7f8ba03c3418cec8ad72ea748"
> +SRC_URI[sha256sum] = "ac7ac2a32e3b9f50131fccded5d232
> 6bd36b2226712d90b61999118a09af5033"
>
> inherit autotools pkgconfig useradd distro_features_check
> # depends on virtual/egl
> @@ -26,7 +25,6 @@ DEPENDS = "libxkbcommon gdk-pixbuf pixman cairo glib-2.0
> jpeg"
> DEPENDS += "wayland wayland-protocols libinput virtual/egl pango
> wayland-native"
>
> EXTRA_OECONF = "--enable-setuid-install \
> - --disable-rpi-compositor \
> --disable-rdp-compositor \
> WAYLAND_PROTOCOLS_SYSROOT_DIR=${STAGING_DIR}/${MACHINE} \
> "
> @@ -84,7 +82,7 @@ PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam"
>
> do_install_append() {
> # Weston doesn't need the .la files to load modules, so wipe them
> - rm -f ${D}/${libdir}/weston/*.la
> + rm -f ${D}/${libdir}/libweston-1/*.la
>
> # If X11, ship a desktop file to launch it
> if [ "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '',
> d)}" = "x11" ]; then
> @@ -103,7 +101,7 @@ do_install_append() {
> PACKAGE_BEFORE_PN += "${@bb.utils.contains('PACKAGECONFIG', 'xwayland',
> '${PN}-xwayland', '', d)}"
> PACKAGES += "${PN}-examples"
>
> -FILES_${PN} = "${bindir}/weston ${bindir}/weston-terminal
> ${bindir}/weston-info ${bindir}/weston-launch ${bindir}/wcap-decode
> ${libexecdir} ${libdir}/${BPN}/*.so ${datadir}"
> +FILES_${PN} = "${bindir}/weston ${bindir}/weston-terminal
> ${bindir}/weston-info ${bindir}/weston-launch ${bindir}/wcap-decode
> ${libexecdir} ${libdir}/*${SOLIBS} ${libdir}/${BPN}/*.so
> ${libdir}/libweston-1/*.so ${datadir}"
> FILES_${PN}-examples = "${bindir}/*"
>
> FILES_${PN}-xwayland = "${libdir}/${BPN}/xwayland.so"
> --
> 2.10.2
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
[-- Attachment #2: Type: text/html, Size: 24036 bytes --]
^ permalink raw reply
* Re: [PATCH 5/5] wic: add --fixed-size wks option
From: Maciej Borzęcki @ 2016-11-09 12:08 UTC (permalink / raw)
To: Ed Bartosh
Cc: Maciej Borzecki, Patches and discussions about the oe-core layer
In-Reply-To: <20161109093627.GB10823@linux.intel.com>
On Wed, Nov 9, 2016 at 10:36 AM, Ed Bartosh <ed.bartosh@linux.intel.com> wrote:
> On Tue, Nov 08, 2016 at 04:56:11PM +0100, Maciej Borzecki wrote:
>> Added new option --fixed-size to wks. The option can be used to indicate
>> the exact size of a partition. The option cannot be added together with
>> --size, in which case an error will be raised. Other options that
>> influence automatic partition size (--extra-space, --overhead-factor),
>> if specifiec along with --fixed-size, will raise an error.
>>
>> If it partition data is larger than the amount of space specified with
>> --fixed-size option wic will raise an error.
>>
>> Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
>> ---
>> scripts/lib/wic/help.py | 14 ++++--
>> scripts/lib/wic/imager/direct.py | 2 +-
>> scripts/lib/wic/ksparser.py | 41 +++++++++++++++--
>> scripts/lib/wic/partition.py | 83 ++++++++++++++++++++--------------
>> scripts/lib/wic/utils/partitionedfs.py | 2 +-
>> 5 files changed, 100 insertions(+), 42 deletions(-)
>>
>> diff --git a/scripts/lib/wic/help.py b/scripts/lib/wic/help.py
>> index e5347ec4b7c900c68fc64351a5293e75de0672b3..daa11bf489c135627ddfe4cef968e48f8e3ad1d8 100644
>> --- a/scripts/lib/wic/help.py
>> +++ b/scripts/lib/wic/help.py
>> @@ -646,6 +646,12 @@ DESCRIPTION
>> not specified, the size is in MB.
>> You do not need this option if you use --source.
>>
>> + --fixed-size: Exact partition size. Value format is the same
>> + as for --size option. This option cannot be
>> + specified along with --size. If partition data
>> + is larger than --fixed-size and error will be
>> + raised when assembling disk image.
>> +
>> --source: This option is a wic-specific option that names the
>> source of the data that will populate the
>> partition. The most common value for this option
>> @@ -719,13 +725,15 @@ DESCRIPTION
>> space after the space filled by the content
>> of the partition. The final size can go
>> beyond the size specified by --size.
>> - By default, 10MB.
>> + By default, 10MB. This option cannot be used
>> + with --fixed-size option.
>>
>> --overhead-factor: This option is specific to wic. The
>> size of the partition is multiplied by
>> this factor. It has to be greater than or
>> - equal to 1.
>> - The default value is 1.3.
>> + equal to 1. The default value is 1.3.
>> + This option cannot be used with --fixed-size
>> + option.
>>
>> --part-type: This option is specific to wic. It specifies partition
>> type GUID for GPT partitions.
>> diff --git a/scripts/lib/wic/imager/direct.py b/scripts/lib/wic/imager/direct.py
>> index 2bedef08d6450096c786def6f75a9ee53fcd4b3b..c01a1ea538428e36a75ac5b31a822e01901bea6a 100644
>> --- a/scripts/lib/wic/imager/direct.py
>> +++ b/scripts/lib/wic/imager/direct.py
>> @@ -290,7 +290,7 @@ class DirectImageCreator(BaseImageCreator):
>> self.bootimg_dir, self.kernel_dir, self.native_sysroot)
>>
>>
>> - self.__image.add_partition(int(part.size),
>> + self.__image.add_partition(part.get_size(),
>> part.disk,
>> part.mountpoint,
>> part.source_file,
>> diff --git a/scripts/lib/wic/ksparser.py b/scripts/lib/wic/ksparser.py
>> index 0894e2b199a299fbbed272f2e1c95e9d692e3ab1..62c490274aa92bf82aac304d9323250e3b728d0c 100644
>> --- a/scripts/lib/wic/ksparser.py
>> +++ b/scripts/lib/wic/ksparser.py
>> @@ -113,6 +113,9 @@ def systemidtype(arg):
>> class KickStart():
>> """"Kickstart parser implementation."""
>>
>> + DEFAULT_EXTRA_SPACE = 10*1024
>> + DEFAULT_OVERHEAD_FACTOR = 1.3
>> +
>> def __init__(self, confpath):
>>
>> self.partitions = []
>> @@ -127,16 +130,24 @@ class KickStart():
>> part.add_argument('mountpoint', nargs='?')
>> part.add_argument('--active', action='store_true')
>> part.add_argument('--align', type=int)
>> - part.add_argument("--extra-space", type=sizetype, default=10*1024)
>> + part.add_argument("--extra-space", type=sizetype)
>> part.add_argument('--fsoptions', dest='fsopts')
>> part.add_argument('--fstype')
>> part.add_argument('--label')
>> part.add_argument('--no-table', action='store_true')
>> part.add_argument('--ondisk', '--ondrive', dest='disk')
>> - part.add_argument("--overhead-factor", type=overheadtype, default=1.3)
>> + part.add_argument("--overhead-factor", type=overheadtype)
>> part.add_argument('--part-type')
>> part.add_argument('--rootfs-dir')
>> - part.add_argument('--size', type=sizetype, default=0)
>> +
>> + # --size and --fixed-size cannot be specified together; options
>> + # ----extra-space and --overhead-factor should also raise a parser
>> + # --error, but since nesting mutually exclusive groups does not work,
>> + # ----extra-space/--overhead-factor are handled later
>> + sizeexcl = part.add_mutually_exclusive_group()
>> + sizeexcl.add_argument('--size', type=sizetype, default=0)
>> + sizeexcl.add_argument('--fixed-size', type=sizetype, default=0)
>> +
>> part.add_argument('--source')
>> part.add_argument('--sourceparams')
>> part.add_argument('--system-id', type=systemidtype)
>> @@ -170,11 +181,33 @@ class KickStart():
>> lineno += 1
>> if line and line[0] != '#':
>> try:
>> - parsed = parser.parse_args(shlex.split(line))
>> + line_args = shlex.split(line)
>> + parsed = parser.parse_args(line_args)
>> except ArgumentError as err:
>> raise KickStartError('%s:%d: %s' % \
>> (confpath, lineno, err))
>> if line.startswith('part'):
>> + # using ArgumentParser one cannot easily tell if option
>> + # was passed as argument, if said option has a default
>> + # value; --overhead-factor/--extra-space cannot be used
>> + # with --fixed-size, so at least detect when these were
>> + # passed with non-0 values ...
> I'd suggest to handle this using argparse mutual exclusion:
> https://docs.python.org/2/library/argparse.html#mutual-exclusion
I don't think argpare.ArgumentParser() can handle nested groups. Right
now --fixed-size and --size are in exclusive group, there's this part in
the patch:
>> + sizeexcl = part.add_mutually_exclusive_group()
>> + sizeexcl.add_argument('--size', type=sizetype, default=0)
>> + sizeexcl.add_argument('--fixed-size', type=sizetype, default=0)
The most logical way to express a conflict between options would be
using a snippet like this:
sizeexcl = part.add_mutually_exclusive_group()
sizeexcl.add_argument('--fixed-size', type=sizetype, default=0)
szg = sizeexcl.add_argument_group()
szg.add_argument('--size', type=sizetype, default=0)
szg.add_argument('--overhead-factor', type=sizetype, default=0)
szg.add_argument('--extra-space', type=sizetype, default=0)
Unfortunately, this does not work as expected with vanilla
ArgumentParser. That's why I've added this workaround, along with a
lengthy comment.
>
>> + if parsed.fixed_size:
>> + if parsed.overhead_factor or parsed.extra_space:
>> + err = "%s:%d: arguments --overhead-factor and --extra-space not "\
>> + "allowed with argument --fixed-size" \
>> + % (confpath, lineno)
>> + raise KickStartError(err)
>> + else:
>> + # ... and provide defaults if not using
>> + # --fixed-size iff given option was not used
>> + # (again, one cannot tell if option was passed but
>> + # with value equal to 0)
>> + if '--overhead-factor' not in line_args:
>> + parsed.overhead_factor = self.DEFAULT_OVERHEAD_FACTOR
>> + if '--extra-space' not in line_args:
>> + parsed.extra_space = self.DEFAULT_EXTRA_SPACE
>> +
>> self.partnum += 1
>> self.partitions.append(Partition(parsed, self.partnum))
>> elif line.startswith('include'):
>> diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
>> index 24e657592738dc7c5cdff78e3740d7c373021e9d..354d4b44c50c77baa54331e95ce0876c32d09339 100644
>> --- a/scripts/lib/wic/partition.py
>> +++ b/scripts/lib/wic/partition.py
>> @@ -54,6 +54,7 @@ class Partition():
>> self.part_type = args.part_type
>> self.rootfs_dir = args.rootfs_dir
>> self.size = args.size
>> + self.fixed_size = args.fixed_size
>> self.source = args.source
>> self.sourceparams = args.sourceparams
>> self.system_id = args.system_id
>> @@ -87,6 +88,39 @@ class Partition():
>> else:
>> return 0
>>
>> + def get_rootfs_size(self, actual_rootfs_size=0):
>> + """
>> + Calculate the required size of rootfs taking into consideration
>> + --size/--fixed-size flags as well as overhead and extra space, as
>> + specified in kickstart file. Raises an error if the
>> + `actual_rootfs_size` is larger than fixed-size rootfs.
>> +
>> + """
>> + if self.fixed_size:
>> + rootfs_size = self.fixed_size
>> + if actual_rootfs_size > rootfs_size:
>> + msger.error("Actual rootfs size (%d kB) is larger than allowed size %d kB" \
>> + %(actual_rootfs_size, rootfs_size))
>> + else:
>> + extra_blocks = self.get_extra_block_count(actual_rootfs_size)
>> + if extra_blocks < self.extra_space:
>> + extra_blocks = self.extra_space
>> +
>> + rootfs_size = actual_rootfs_size + extra_blocks
>> + rootfs_size *= self.overhead_factor
>> +
>> + msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \
>> + (extra_blocks, self.mountpoint, rootfs_size))
>> +
>> + return rootfs_size
>> +
>> + def get_size(self):
>> + """
>> + Obtain partition size taking into consideration --size/--fixed-size
>> + options.
>> + """
>> + return self.fixed_size if self.fixed_size else self.size
>> +
>> def prepare(self, creator, cr_workdir, oe_builddir, rootfs_dir,
>> bootimg_dir, kernel_dir, native_sysroot):
> Can you make self.size and self.fixed_size getters as properties(use @property decorator)?
> It should make code look more pythonic.
>
Good point. I'll incorporate this in v2.
>> """
>> @@ -97,9 +131,9 @@ class Partition():
>> self.sourceparams_dict = parse_sourceparams(self.sourceparams)
>>
>> if not self.source:
>> - if not self.size:
>> - msger.error("The %s partition has a size of zero. Please "
>> - "specify a non-zero --size for that partition." % \
>> + if not self.size and not self.fixed_size:
>> + msger.error("The %s partition has a size of zero. Please "
>> + "specify a non-zero --size/--fixed-size for that partition." % \
>> self.mountpoint)
>> if self.fstype and self.fstype == "swap":
>> self.prepare_swap_partition(cr_workdir, oe_builddir,
>> @@ -146,6 +180,10 @@ class Partition():
>> oe_builddir,
>> bootimg_dir, kernel_dir, rootfs_dir,
>> native_sysroot)
>> + if self.fixed_size and self.size > self.fixed_size:
>> + msger.error("File system image of partition %s is larger (%d kB) than its"\
>> + "allowed size %d kB" % (self.mountpoint,
>> + self.size, self.fixed_size))
>>
>> def prepare_rootfs_from_fs_image(self, cr_workdir, oe_builddir,
>> rootfs_dir):
>> @@ -211,15 +249,7 @@ class Partition():
>> out = exec_cmd(du_cmd)
>> actual_rootfs_size = int(out.split()[0])
>>
>> - extra_blocks = self.get_extra_block_count(actual_rootfs_size)
>> - if extra_blocks < self.extra_space:
>> - extra_blocks = self.extra_space
>> -
>> - rootfs_size = actual_rootfs_size + extra_blocks
>> - rootfs_size *= self.overhead_factor
>> -
>> - msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \
>> - (extra_blocks, self.mountpoint, rootfs_size))
>> + rootfs_size = self.get_rootfs_size(actual_rootfs_size)
>>
>> with open(rootfs, 'w') as sparse:
>> os.ftruncate(sparse.fileno(), rootfs_size * 1024)
>> @@ -245,15 +275,7 @@ class Partition():
>> out = exec_cmd(du_cmd)
>> actual_rootfs_size = int(out.split()[0])
>>
>> - extra_blocks = self.get_extra_block_count(actual_rootfs_size)
>> - if extra_blocks < self.extra_space:
>> - extra_blocks = self.extra_space
>> -
>> - rootfs_size = actual_rootfs_size + extra_blocks
>> - rootfs_size *= self.overhead_factor
>> -
>> - msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \
>> - (extra_blocks, self.mountpoint, rootfs_size))
>> + rootfs_size = self.get_rootfs_size(actual_rootfs_size)
>>
>> with open(rootfs, 'w') as sparse:
>> os.ftruncate(sparse.fileno(), rootfs_size * 1024)
>> @@ -275,20 +297,13 @@ class Partition():
>> out = exec_cmd(du_cmd)
>> blocks = int(out.split()[0])
>>
>> - extra_blocks = self.get_extra_block_count(blocks)
>> - if extra_blocks < self.extra_space:
>> - extra_blocks = self.extra_space
>> -
>> - blocks += extra_blocks
>> -
>> - msger.debug("Added %d extra blocks to %s to get to %d total blocks" % \
>> - (extra_blocks, self.mountpoint, blocks))
>> + rootfs_size = self.get_rootfs_size(blocks)
>>
>> label_str = "-n boot"
>> if self.label:
>> label_str = "-n %s" % self.label
>>
>> - dosfs_cmd = "mkdosfs %s -S 512 -C %s %d" % (label_str, rootfs, blocks)
>> + dosfs_cmd = "mkdosfs %s -S 512 -C %s %d" % (label_str, rootfs, rootfs_size)
>> exec_native_cmd(dosfs_cmd, native_sysroot)
>>
>> mcopy_cmd = "mcopy -i %s -s %s/* ::/" % (rootfs, rootfs_dir)
>> @@ -311,8 +326,9 @@ class Partition():
>> """
>> Prepare an empty ext2/3/4 partition.
>> """
>> + size = self.get_size()
>> with open(rootfs, 'w') as sparse:
>> - os.ftruncate(sparse.fileno(), self.size * 1024)
>> + os.ftruncate(sparse.fileno(), size * 1024)
>>
>> extra_imagecmd = "-i 8192"
>>
>> @@ -329,8 +345,9 @@ class Partition():
>> """
>> Prepare an empty btrfs partition.
>> """
>> + size = self.get_size()
>> with open(rootfs, 'w') as sparse:
>> - os.ftruncate(sparse.fileno(), self.size * 1024)
>> + os.ftruncate(sparse.fileno(), size * 1024)
>>
>> label_str = ""
>> if self.label:
>> @@ -345,7 +362,7 @@ class Partition():
>> """
>> Prepare an empty vfat partition.
>> """
>> - blocks = self.size
>> + blocks = self.get_size()
>>
>> label_str = "-n boot"
>> if self.label:
>> diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py
>> index 9e76487844eebfffc7227d053a65dc9fdab3678b..cfa5f5ce09b764c1c2a9b7a3f7bf7d677a6811c4 100644
>> --- a/scripts/lib/wic/utils/partitionedfs.py
>> +++ b/scripts/lib/wic/utils/partitionedfs.py
>> @@ -209,7 +209,7 @@ class Image():
>> msger.debug("Assigned %s to %s%d, sectors range %d-%d size %d "
>> "sectors (%d bytes)." \
>> % (part['mountpoint'], part['disk_name'], part['num'],
>> - part['start'], part['start'] + part['size'] - 1,
>> + part['start'], disk['offset'] - 1,
>> part['size'], part['size'] * self.sector_size))
>>
>> # Once all the partitions have been layed out, we can calculate the
>> --
>> 2.5.0
>>
>
> --
> --
> Regards,
> Ed
--
Maciej Borzecki
RnDity
^ permalink raw reply
* RE: [PATCH V5 3/3] ARM64 LPC: LPC driver implementation on Hip06
From: Gabriele Paoloni @ 2016-11-09 12:10 UTC (permalink / raw)
To: Arnd Bergmann, Yuanzhichang
Cc: catalin.marinas-5wv7dgnIgG8@public.gmane.org,
will.deacon-5wv7dgnIgG8@public.gmane.org,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
mark.rutland-5wv7dgnIgG8@public.gmane.org,
olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
lorenzo.pieralisi-5wv7dgnIgG8@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linuxarm,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
minyard-HInyCGIudOg@public.gmane.org,
benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org
In-Reply-To: <1555494.4IFvGxvsfe@wuerfel>
Hi Arnd
> -----Original Message-----
> From: Arnd Bergmann [mailto:arnd-r2nGTMty4D4@public.gmane.org]
> Sent: 08 November 2016 16:25
> To: Yuanzhichang
> Cc: catalin.marinas-5wv7dgnIgG8@public.gmane.org; will.deacon-5wv7dgnIgG8@public.gmane.org; robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org;
> bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org; mark.rutland-5wv7dgnIgG8@public.gmane.org; olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org; linux-arm-
> kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org; lorenzo.pieralisi-5wv7dgnIgG8@public.gmane.org; linux-
> kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; Linuxarm; devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; linux-
> pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; minyard-HInyCGIudOg@public.gmane.org;
> benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org; liviu.dudau-5wv7dgnIgG8@public.gmane.org; zourongrong-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org;
> John Garry; Gabriele Paoloni; zhichang.yuan02-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org;
> kantyzc-9Onoh4P/yGk@public.gmane.org; xuwei (O)
> Subject: Re: [PATCH V5 3/3] ARM64 LPC: LPC driver implementation on
> Hip06
>
> On Tuesday, November 8, 2016 11:47:09 AM CET zhichang.yuan wrote:
> > + /*
> > + * The first PCIBIOS_MIN_IO is reserved specifically for
> indirectIO.
> > + * It will separate indirectIO range from pci host bridge to
> > + * avoid the possible PIO conflict.
> > + * Set the indirectIO range directly here.
> > + */
> > + lpcdev->io_ops.start = 0;
> > + lpcdev->io_ops.end = PCIBIOS_MIN_IO - 1;
> > + lpcdev->io_ops.devpara = lpcdev;
> > + lpcdev->io_ops.pfin = hisilpc_comm_in;
> > + lpcdev->io_ops.pfout = hisilpc_comm_out;
> > + lpcdev->io_ops.pfins = hisilpc_comm_ins;
> > + lpcdev->io_ops.pfouts = hisilpc_comm_outs;
>
> I have to look at patch 2 in more detail again, after missing a few
> review
> rounds. I'm still a bit skeptical about hardcoding a logical I/O port
> range here, and would hope that we can just go through the same
> assignment of logical port ranges that we have for PCI buses,
> decoupling
> the bus addresses from the linux-internal ones.
The point here is that we want to avoid any conflict/overlap between
the LPC I/O space and the PCI I/O space. With the assignment above
we make sure that LPC never interfere with PCI I/O space.
Thanks
Gab
>
> Arnd
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH V5 3/3] ARM64 LPC: LPC driver implementation on Hip06
From: Gabriele Paoloni @ 2016-11-09 12:10 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1555494.4IFvGxvsfe@wuerfel>
Hi Arnd
> -----Original Message-----
> From: Arnd Bergmann [mailto:arnd at arndb.de]
> Sent: 08 November 2016 16:25
> To: Yuanzhichang
> Cc: catalin.marinas at arm.com; will.deacon at arm.com; robh+dt at kernel.org;
> bhelgaas at google.com; mark.rutland at arm.com; olof at lixom.net; linux-arm-
> kernel at lists.infradead.org; lorenzo.pieralisi at arm.com; linux-
> kernel at vger.kernel.org; Linuxarm; devicetree at vger.kernel.org; linux-
> pci at vger.kernel.org; linux-serial at vger.kernel.org; minyard at acm.org;
> benh at kernel.crashing.org; liviu.dudau at arm.com; zourongrong at gmail.com;
> John Garry; Gabriele Paoloni; zhichang.yuan02 at gmail.com;
> kantyzc at 163.com; xuwei (O)
> Subject: Re: [PATCH V5 3/3] ARM64 LPC: LPC driver implementation on
> Hip06
>
> On Tuesday, November 8, 2016 11:47:09 AM CET zhichang.yuan wrote:
> > + /*
> > + * The first PCIBIOS_MIN_IO is reserved specifically for
> indirectIO.
> > + * It will separate indirectIO range from pci host bridge to
> > + * avoid the possible PIO conflict.
> > + * Set the indirectIO range directly here.
> > + */
> > + lpcdev->io_ops.start = 0;
> > + lpcdev->io_ops.end = PCIBIOS_MIN_IO - 1;
> > + lpcdev->io_ops.devpara = lpcdev;
> > + lpcdev->io_ops.pfin = hisilpc_comm_in;
> > + lpcdev->io_ops.pfout = hisilpc_comm_out;
> > + lpcdev->io_ops.pfins = hisilpc_comm_ins;
> > + lpcdev->io_ops.pfouts = hisilpc_comm_outs;
>
> I have to look at patch 2 in more detail again, after missing a few
> review
> rounds. I'm still a bit skeptical about hardcoding a logical I/O port
> range here, and would hope that we can just go through the same
> assignment of logical port ranges that we have for PCI buses,
> decoupling
> the bus addresses from the linux-internal ones.
The point here is that we want to avoid any conflict/overlap between
the LPC I/O space and the PCI I/O space. With the assignment above
we make sure that LPC never interfere with PCI I/O space.
Thanks
Gab
>
> Arnd
^ permalink raw reply
* RE: [PATCH V5 3/3] ARM64 LPC: LPC driver implementation on Hip06
From: Gabriele Paoloni @ 2016-11-09 12:10 UTC (permalink / raw)
To: Arnd Bergmann, Yuanzhichang
Cc: catalin.marinas@arm.com, will.deacon@arm.com, robh+dt@kernel.org,
bhelgaas@google.com, mark.rutland@arm.com, olof@lixom.net,
linux-arm-kernel@lists.infradead.org, lorenzo.pieralisi@arm.com,
linux-kernel@vger.kernel.org, Linuxarm,
devicetree@vger.kernel.org, linux-pci@vger.kernel.org,
linux-serial@vger.kernel.org, minyard@acm.org,
benh@kernel.crashing.org, liviu.dudau@arm.com,
zourongrong@gmail.com, John Garry, zhichang.yuan02@gmail.com,
kantyzc@163.com, xuwei (O)
In-Reply-To: <1555494.4IFvGxvsfe@wuerfel>
Hi Arnd
> -----Original Message-----
> From: Arnd Bergmann [mailto:arnd@arndb.de]
> Sent: 08 November 2016 16:25
> To: Yuanzhichang
> Cc: catalin.marinas@arm.com; will.deacon@arm.com; robh+dt@kernel.org;
> bhelgaas@google.com; mark.rutland@arm.com; olof@lixom.net; linux-arm-
> kernel@lists.infradead.org; lorenzo.pieralisi@arm.com; linux-
> kernel@vger.kernel.org; Linuxarm; devicetree@vger.kernel.org; linux-
> pci@vger.kernel.org; linux-serial@vger.kernel.org; minyard@acm.org;
> benh@kernel.crashing.org; liviu.dudau@arm.com; zourongrong@gmail.com;
> John Garry; Gabriele Paoloni; zhichang.yuan02@gmail.com;
> kantyzc@163.com; xuwei (O)
> Subject: Re: [PATCH V5 3/3] ARM64 LPC: LPC driver implementation on
> Hip06
>
> On Tuesday, November 8, 2016 11:47:09 AM CET zhichang.yuan wrote:
> > + /*
> > + * The first PCIBIOS_MIN_IO is reserved specifically for
> indirectIO.
> > + * It will separate indirectIO range from pci host bridge to
> > + * avoid the possible PIO conflict.
> > + * Set the indirectIO range directly here.
> > + */
> > + lpcdev->io_ops.start = 0;
> > + lpcdev->io_ops.end = PCIBIOS_MIN_IO - 1;
> > + lpcdev->io_ops.devpara = lpcdev;
> > + lpcdev->io_ops.pfin = hisilpc_comm_in;
> > + lpcdev->io_ops.pfout = hisilpc_comm_out;
> > + lpcdev->io_ops.pfins = hisilpc_comm_ins;
> > + lpcdev->io_ops.pfouts = hisilpc_comm_outs;
>
> I have to look at patch 2 in more detail again, after missing a few
> review
> rounds. I'm still a bit skeptical about hardcoding a logical I/O port
> range here, and would hope that we can just go through the same
> assignment of logical port ranges that we have for PCI buses,
> decoupling
> the bus addresses from the linux-internal ones.
The point here is that we want to avoid any conflict/overlap between
the LPC I/O space and the PCI I/O space. With the assignment above
we make sure that LPC never interfere with PCI I/O space.
Thanks
Gab
>
> Arnd
^ permalink raw reply
* Re: [PATCH v3 4/4] KVM: x86: emulate FXSAVE and FXRSTOR
From: Radim Krčmář @ 2016-11-09 12:12 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: linux-kernel, kvm, Bandan Das, Nadav Amit
In-Reply-To: <cc4ad31c-b313-71a1-9087-f3abe4dc8d52@redhat.com>
2016-11-09 00:25+0100, Paolo Bonzini:
> On 08/11/2016 20:54, Radim Krčmář wrote:
>> Internal errors were reported on 16 bit fxsave and fxrstor with ipxe.
>> Old Intels don't have unrestricted_guest, so we have to emulate them.
>>
>> The patch takes advantage of the hardware implementation.
>>
>> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
>> ---
>> v3:
>> - remove fxsave64 and extra colons at the end of asm to make old GCCs
>> happy (fxsave64 could have been implemented using other nmemonics,
>> but there is no point when it won't be used + removing it makes the
>> code nicer.)
>> v2:
>> - throws #GP to the guest when reserved MXCSR are set [Nadav]
>> - returns internal emulation error if an exception is hit during
>> execution
>> - preserves XMM 8-15
>> ---
>> arch/x86/kvm/emulate.c | 113 ++++++++++++++++++++++++++++++++++++++++++++++++-
>> 1 file changed, 112 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
>> index 6af3cac6ec89..1b3fab1fb8d3 100644
>> --- a/arch/x86/kvm/emulate.c
>> +++ b/arch/x86/kvm/emulate.c
>> @@ -3883,6 +3883,115 @@ static int em_movsxd(struct x86_emulate_ctxt *ctxt)
>> return X86EMUL_CONTINUE;
>> }
>>
>> +static int check_fxsr(struct x86_emulate_ctxt *ctxt)
>> +{
>> + u32 eax = 1, ebx, ecx = 0, edx;
>> +
>> + ctxt->ops->get_cpuid(ctxt, &eax, &ebx, &ecx, &edx);
>> + if (!(edx & FFL(FXSR)))
>> + return emulate_ud(ctxt);
>> +
>> + if (ctxt->ops->get_cr(ctxt, 0) & (X86_CR0_TS | X86_CR0_EM))
>> + return emulate_nm(ctxt);
>> +
>> + /*
>> + * Don't emulate a case that should never be hit, instead of working
>> + * around a lack of fxsave64/fxrstor64 on old compilers.
>> + */
>> + if (ctxt->mode >= X86EMUL_MODE_PROT64)
>> + return X86EMUL_UNHANDLEABLE;
>> +
>> + return X86EMUL_CONTINUE;
>> +}
>> +
>> +/*
>> + * FXSAVE and FXRSTOR have 4 different formats depending on execution mode,
>> + * 1) 16 bit mode
>> + * 2) 32 bit mode
>> + * - like (1), but FIP and FDP (foo) are only 16 bit. At least Intel CPUs
>> + * preserve whole 32 bit values, though, so (1) and (2) are the same wrt.
>> + * save and restore
>> + * 3) 64-bit mode with REX.W prefix
>> + * - like (2), but XMM 8-15 are being saved and restored
>> + * 4) 64-bit mode without REX.W prefix
>> + * - like (3), but FIP and FDP are 64 bit
>> + *
>> + * Emulation uses (3) for (1) and (2) and preserves XMM 8-15 to reach the
>> + * desired result. (4) is not emulated.
>> + *
>> + * XXX: Guest and host CPUID.(EAX=07H,ECX=0H):EBX[bit 13] (deprecate FPU CS
>> + * and FPU DS) should match.
>> + */
>> +static int em_fxsave(struct x86_emulate_ctxt *ctxt)
>> +{
>> + struct fxregs_state fx_state;
>> + size_t size = 288; /* up to XMM7 */
>
> Sorry for noticing this only now; if CR4.OSFXSR is 0, XMM and MXCSR
> should not be saved.
Intel processors don't save it, but the spec allows saving even when
CR4.OSFXSR is 0:
If the OSFXSR bit in control register CR4 is not set, the FXSAVE
instruction may not save this register (these registers).
This behavior is implementation dependent.
I let "implementation dependent" behavior be the one with less code, but
haven't checked AMD spec, which doesn't seem to make it implementation
dependent ... I'll add it. (On intel, OSFXSR gets written with 0 and
XMM 0-7 isn't modified without OSFXSR, so I'll just assume that AMD
won't break with that.)
> I can apply the first three patches already if you prefer.
Yes, they would not change, thanks.
^ permalink raw reply
* [PATCH] arm64: acpi: arch_apei_get_mem_attributes() should use memblock
From: Ard Biesheuvel @ 2016-11-09 12:12 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161108102714.29931-1-james.morse@arm.com>
Hi James,
On 8 November 2016 at 10:27, James Morse <james.morse@arm.com> wrote:
> arm64's arch_apei_get_mem_attributes() tries to use
> efi_mem_attributes() to read the memory attributes from the efi
> memory map.
>
> drivers/firmware/efi/arm-init.c:efi_init() calls efi_memmap_unmap(),
> which clears the EFI_MEMMAP bit from efi.flags once efi_init() has
> finished with the memory map. This causes efi_mem_attributes() to
> return 0 meaning PROT_DEVICE_nGnRnE is the chosen memory type for
> all ACPI APEI mappings.
>
> APEI may call this from NMI context, so we can't re-map the EFI
> memory map as this may need to allocate virtual address space.
> 'ghes_ioremap_area' is APEIs cache of virtual address space to
> access the buffer once we tell it the memory attributes.
>
> Do as acpi_os_ioremap() does, and consult memblock to learn if
> the provided address is memory, or not.
>
> Signed-off-by: James Morse <james.morse@arm.com>
> Cc: Jonathan (Zhixiong) Zhang <zjzhang@codeaurora.org>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
> Fixes: 89e44b51cc0d ("arm64, acpi/apei: Implement arch_apei_get_mem_attributes()")
>
> This doesn't code even get built on mainline as HAVE_ACPI_APEI isn't
> defined, until https://lkml.org/lkml/2016/8/10/231 gets merged.
> I don't think this should go to stable.
>
> I also took the opportunity to remove some unnecessarily ifdef'd
> includes.
>
> arch/arm64/kernel/acpi.c | 28 ++++++++--------------------
> 1 file changed, 8 insertions(+), 20 deletions(-)
>
> diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
> index 252a6d9c1da5..985f721f3bdd 100644
> --- a/arch/arm64/kernel/acpi.c
> +++ b/arch/arm64/kernel/acpi.c
> @@ -18,6 +18,7 @@
> #include <linux/acpi.h>
> #include <linux/bootmem.h>
> #include <linux/cpumask.h>
> +#include <linux/efi.h>
> #include <linux/init.h>
> #include <linux/irq.h>
> #include <linux/irqdomain.h>
> @@ -28,13 +29,9 @@
>
> #include <asm/cputype.h>
> #include <asm/cpu_ops.h>
> +#include <asm/pgtable.h>
> #include <asm/smp_plat.h>
>
> -#ifdef CONFIG_ACPI_APEI
> -# include <linux/efi.h>
> -# include <asm/pgtable.h>
> -#endif
> -
> int acpi_noirq = 1; /* skip ACPI IRQ initialization */
> int acpi_disabled = 1;
> EXPORT_SYMBOL(acpi_disabled);
> @@ -241,22 +238,13 @@ void __init acpi_boot_table_init(void)
> pgprot_t arch_apei_get_mem_attribute(phys_addr_t addr)
> {
> /*
> - * According to "Table 8 Map: EFI memory types to AArch64 memory
> - * types" of UEFI 2.5 section 2.3.6.1, each EFI memory type is
> - * mapped to a corresponding MAIR attribute encoding.
> - * The EFI memory attribute advises all possible capabilities
> - * of a memory region. We use the most efficient capability.
> + * The EFI memmap isn't mapped, instead read the version exported
> + * into memblock. EFI's reserve_regions() call adds memory with the
> + * WB attribute to memblock via early_init_dt_add_memory_arch().
> */
> + if (!memblock_is_memory(addr))
> + return __pgprot(PROT_DEVICE_nGnRnE);
>
> - u64 attr;
> -
> - attr = efi_mem_attributes(addr);
> - if (attr & EFI_MEMORY_WB)
> - return PAGE_KERNEL;
> - if (attr & EFI_MEMORY_WT)
> - return __pgprot(PROT_NORMAL_WT);
> - if (attr & EFI_MEMORY_WC)
> - return __pgprot(PROT_NORMAL_NC);
> - return __pgprot(PROT_DEVICE_nGnRnE);
> + return PAGE_KERNEL;
As you know, we recently applied [0] to ensure that memory regions
that are marked by UEFI was write-through cacheable (WT) or
write-combining (WC) are not misidentified by the kernel as having
strongly ordered semantics.
This means that in this case, you may be returning PAGE_KERNEL for
regions that are lacking the EFI_MEMORY_WB attribute, which kind of
defeats the purpose of this function (AIUI), to align the kernel's
view of the region's attributes with the view of the firmware. I would
expect that, for use cases like this one, the burden is on the
firmware to ensure that only a single EFI_MEMORY_xx attribute is set
if any kind of coherency between UEFI and the kernel is expected. If
that single attribute is WT or WC, PAGE_KERNEL is most certainly
wrong.
[0] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=cb82cce7035
^ permalink raw reply
* [Qemu-devel] [PATCH 1/2] travis: trim out most clang builds
From: Alex Bennée @ 2016-11-09 12:11 UTC (permalink / raw)
To: stefanha; +Cc: qemu-devel, Daniel P. Berrange, Alex Bennée
In-Reply-To: <20161109121157.30815-1-alex.bennee@linaro.org>
From: "Daniel P. Berrange" <berrange@redhat.com>
We test with both gcc and clang in order to detect cases
where clang issues warnings that gcc misses. To achieve
this though we don't need to build QEMU in multiple
different configurations. Just a single clang-on-linux
build will be sufficient, if we have an "all enabled"
config.
This cuts the number of build jobs from 21 to 16,
reducing the load imposed on shared Travis CI infra.
This will make it practical to enable jobs for other
interesting & useful configurations without DOS'ing
Travis to much.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
.travis.yml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/.travis.yml b/.travis.yml
index 9916178..0706b9a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,7 +4,6 @@ python:
- "2.4"
compiler:
- gcc
- - clang
cache: ccache
addons:
apt:
@@ -68,6 +67,9 @@ script:
- make -j3 && ${TEST_CMD}
matrix:
include:
+ # Test with CLang for compile portability
+ - env: CONFIG=""
+ compiler: clang
# gprof/gcov are GCC features
- env: CONFIG="--enable-gprof --enable-gcov --disable-pie"
compiler: gcc
--
2.10.1
^ permalink raw reply related
* [Qemu-devel] [PATCH 0/2] Current Travis patches
From: Alex Bennée @ 2016-11-09 12:11 UTC (permalink / raw)
To: stefanha; +Cc: qemu-devel, Alex Bennée
Hi,
Not much here but since Daniel sped up the build by trimming out most
of the clang mirrors of gcc I added one additional clang build which
uses the current stable branch. Hopefully this still gives us enough
coverage.
As this speeds up testing on merges and doesn't affect QEMU code
itself I'll ask if we can merge this in the 2.8 cycle? If so I'll send
a pull request in a few days assuming no objection to the patches
themselves.
Alex Bennée (1):
travis: add Trusty with clang stable build
Daniel P. Berrange (1):
travis: trim out most clang builds
.travis.yml | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
--
2.10.1
^ permalink raw reply
* [Qemu-devel] [PATCH 2/2] travis: add Trusty with clang stable build
From: Alex Bennée @ 2016-11-09 12:11 UTC (permalink / raw)
To: stefanha; +Cc: qemu-devel, Alex Bennée
In-Reply-To: <20161109121157.30815-1-alex.bennee@linaro.org>
Although we've reduced the matrix to avoid repeating clang builds we can
still add an additional clang build to use the latest stable version of
clang which will typically be available on current distros.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
.travis.yml | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/.travis.yml b/.travis.yml
index 0706b9a..d83e2d4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -103,6 +103,26 @@ matrix:
- sudo apt-get build-dep -qq qemu
- wget -O - http://people.linaro.org/~alex.bennee/qemu-submodule-git-seed.tar.xz | tar -xvJ
- git submodule update --init --recursive
+ # Trusty build with latest stable clang
+ - env: CONFIG=""
+ sudo: required
+ addons:
+ dist: trusty
+ language: generic
+ compiler: none
+ env:
+ - COMPILER_NAME=clang CXX=clang++-3.9 CC=clang-3.9
+ - CONFIG="--cc=clang-3.9 --cxx=clang++-3.9"
+ before_install:
+ - wget -nv -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
+ - sudo apt-add-repository -y 'deb http://llvm.org/apt/trusty llvm-toolchain-trusty-3.9 main'
+ - sudo apt-get update -qq
+ - sudo apt-get install -qq -y clang-3.9
+ - sudo apt-get build-dep -qq qemu
+ - wget -O - http://people.linaro.org/~alex.bennee/qemu-submodule-git-seed.tar.xz | tar -xvJ
+ - git submodule update --init --recursive
+ before_script:
+ - ./configure ${CONFIG} || cat config.log
# Using newer GCC with sanitizers
- addons:
apt:
--
2.10.1
^ permalink raw reply related
* Re: [PATCH v4 1/3] Input: ALPS - Fix TrackStick support for SS5 hardware
From: Pali Rohár @ 2016-11-09 12:12 UTC (permalink / raw)
To: Paul Donohue; +Cc: linux-input, Ben Gamari, Michal Hocko
In-Reply-To: <20161108151430.GN2927@TopQuark.net>
On Tuesday 08 November 2016 10:14:30 Paul Donohue wrote:
> The current Alps SS5 (SS4 v2) code generates bogus TouchPad events when
> TrackStick packets are processed.
>
> This causes the xorg synaptics driver to print
> "unable to find touch point 0" and
> "BUG: triggered 'if (priv->num_active_touches > priv->num_slots)'"
> messages. It also causes unexpected TouchPad button release and reclick
> event sequences if the TrackStick is moved while holding a TouchPad
> button.
>
> This commit corrects the problem by adjusting
> alps_process_packet_ss4_v2() so that it only sends TrackStick reports
> when processing TrackStick packets.
>
> Signed-off-by: Paul Donohue <linux-kernel@PaulSD.com>
>
> diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
> index 6d7de9b..b93fe83 100644
> --- a/drivers/input/mouse/alps.c
> +++ b/drivers/input/mouse/alps.c
> @@ -1346,6 +1346,18 @@ static void alps_process_packet_ss4_v2(struct psmouse *psmouse)
>
> priv->multi_packet = 0;
>
> + /* Report trackstick */
> + if (alps_get_pkt_id_ss4_v2(packet) == SS4_PACKET_ID_STICK) {
I would propose to show warning when trackstick packet is received on
device marked as non-trackstick. It would help to debug possible
problems in future...
if (!(priv->flags & ALPS_DUALPOINT))
psmouse_warn(psmouse, "Rejected trackstick packet from non DualPoint device");
> + if (priv->flags & ALPS_DUALPOINT) {
> + input_report_key(dev2, BTN_LEFT, f->ts_left);
> + input_report_key(dev2, BTN_RIGHT, f->ts_right);
> + input_report_key(dev2, BTN_MIDDLE, f->ts_middle);
> + input_sync(dev2);
> + }
> + return;
> + }
--
Pali Rohár
pali.rohar@gmail.com
^ permalink raw reply
* Re: [Qemu-devel] [kvm-unit-tests PATCH v4 03/11] arm/arm64: smp: support more than 8 cpus
From: Andrew Jones @ 2016-11-09 12:13 UTC (permalink / raw)
To: Andre Przywara
Cc: peter.maydell, kvm, marc.zyngier, qemu-devel, eric.auger,
qemu-arm, pbonzini, alex.bennee, kvmarm, christoffer.dall
In-Reply-To: <33e2c904-cea1-6d21-4be9-b3fbd037c563@arm.com>
On Wed, Nov 09, 2016 at 12:01:42PM +0000, Andre Przywara wrote:
> Hi,
>
> On 09/11/16 11:57, Andrew Jones wrote:
> > On Wed, Nov 09, 2016 at 11:12:03AM +0000, Andre Przywara wrote:
> > [...]
> >>> diff --git a/lib/arm/setup.c b/lib/arm/setup.c
> >>> index 7e7b39f11dde..b6e2d5815e72 100644
> >>> --- a/lib/arm/setup.c
> >>> +++ b/lib/arm/setup.c
> >>> @@ -24,12 +24,22 @@ extern unsigned long stacktop;
> >>> extern void io_init(void);
> >>> extern void setup_args_progname(const char *args);
> >>>
> >>> -u32 cpus[NR_CPUS] = { [0 ... NR_CPUS-1] = (~0U) };
> >>> +u64 cpus[NR_CPUS] = { [0 ... NR_CPUS-1] = (~0U) };
> >>
> >> This should be ~0UL.
> >
> > Indeed. Thanks.
> >
> >> Also I think the type should be unsigned long to match the types used
> >> everywhere else.
> >
> > I'll change mpidr_to_cpu to return u64 instead of unsigned long.
>
> I am not sure this is the right direction. unsigned long is really the
> natural type for MPIDR, since this is a system register with exactly the
> native register size.
> I think we use it this way in the kernel.
OK, actually, considering arm32 and arm64 should both implement
mpidr_to_cpu, and the interface should be consistent, then unsigned
long is the only way.
Thanks,
drew
^ permalink raw reply
* [PATCH v3 0/2] Remove static mapping of SCU from mach-exynos
From: Pankaj Dubey @ 2016-11-09 12:15 UTC (permalink / raw)
To: linux-samsung-soc, linux-arm-kernel; +Cc: krzk, kgene, thomas.ab, Pankaj Dubey
This patch series is part of patch series [1], which adds support of SCU
device node for Cortex-A9 based Exynos4 SoC. First two patches of the same
has been accepted and hence not included them in v3.
This patch series does some cleanup for Exynos4 SoC based boards.
We are currently statically mapping SCU SFRs in mach-exynos/exynos.c
which can be avoided if map this from device node of SCU
[1]: https://www.spinics.net/lists/arm-kernel/msg540498.html
This patch series is prepared on Krzysztof's for-next
(SHA_ID: b33c7bb9d59c3f4100d4)
I have tested these patches on Exynos4210 based on Origen board for SMP boot.
Patchset v1 was tested by Marek Szyprowski on Exynos4412-based Odroid U3
for SMP boot and S2R.
To confirm concern raised by Alim, I intentionally removed SCU device node
from exynos4.dtsi and tested on Origen board, I can see code handles this
case gracefully without any crash and system boot was fine. Of-course in such
case only single core will be able to boot.
Following boot message observed on Origen in case of missing SCU node
-------------
[ 0.000864] CPU: Testing write buffer coherency: ok
[ 0.001068] CPU0: thread -1, cpu 0, socket 9, mpidr 80000900
[ 0.001456] exynos_scu_enable failed to map scu_base
[ 0.001477] Setting up static identity map for 0x40100000 - 0x40100058
[ 1.120003] CPU1: failed to come online
[ 1.120059] Brought up 1 CPUs
[ 1.120068] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[ 1.120076] CPU: All CPU(s) started in SVC mode.
-------------
Changes since v2:
- Removed unnecessary header file inclusion from pm.c.
- Move out call_firmware_op call from CORTEX-A9 check.
- Update commit log for 1/2 patch describing dependency on DTS and affect of
the patch on out-of-tree DTS
Changes since v1:
- Address review comments from Krzysztof
- Moved scu_enable from pm.c and suspend.c to single place in platsmp.c
- Added error handling during scu_enable in platsmp.c
- Added Reviewed-by tag from Alim.
Pankaj Dubey (2):
ARM: EXYNOS: Remove static mapping of SCU SFR
ARM: EXYNOS: Remove unused soc_is_exynos{4,5}
arch/arm/mach-exynos/common.h | 6 +----
arch/arm/mach-exynos/exynos.c | 22 ------------------
arch/arm/mach-exynos/include/mach/map.h | 2 --
arch/arm/mach-exynos/platsmp.c | 34 +++++++++++++++++++++-------
arch/arm/mach-exynos/pm.c | 4 +---
arch/arm/mach-exynos/suspend.c | 4 +---
arch/arm/plat-samsung/include/plat/map-s5p.h | 4 ----
7 files changed, 29 insertions(+), 47 deletions(-)
--
2.7.4
^ permalink raw reply
* [PATCH v3 1/2] ARM: EXYNOS: Remove static mapping of SCU SFR
From: Pankaj Dubey @ 2016-11-09 12:15 UTC (permalink / raw)
To: linux-samsung-soc, linux-arm-kernel; +Cc: krzk, kgene, thomas.ab, Pankaj Dubey
In-Reply-To: <1478693755-11953-1-git-send-email-pankaj.dubey@samsung.com>
Lets remove static mapping of SCU SFR mainly used in CORTEX-A9 SoC based
boards. Instead use mapping from device tree node of SCU.
NOTE: This patch has dependency on DT file of any such CORTEX-A9 SoC
based boards, in the absence of SCU device node in DTS file, only single
CPU will boot. So if you are using OUT-OF-TREE DTS file of CORTEX-A9 based
Exynos SoC make sure to add SCU device node to DTS file for SMP boot.
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
---
arch/arm/mach-exynos/common.h | 1 +
arch/arm/mach-exynos/exynos.c | 22 ------------------
arch/arm/mach-exynos/include/mach/map.h | 2 --
arch/arm/mach-exynos/platsmp.c | 34 +++++++++++++++++++++-------
arch/arm/mach-exynos/pm.c | 4 +---
arch/arm/mach-exynos/suspend.c | 4 +---
arch/arm/plat-samsung/include/plat/map-s5p.h | 4 ----
7 files changed, 29 insertions(+), 42 deletions(-)
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index 9424a8a..dd5d8e8 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -161,6 +161,7 @@ extern void exynos_cpu_restore_register(void);
extern void exynos_pm_central_suspend(void);
extern int exynos_pm_central_resume(void);
extern void exynos_enter_aftr(void);
+extern int exynos_scu_enable(void);
extern struct cpuidle_exynos_data cpuidle_coupled_exynos_data;
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index 757fc11..fa08ef9 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -28,15 +28,6 @@
#include "common.h"
-static struct map_desc exynos4_iodesc[] __initdata = {
- {
- .virtual = (unsigned long)S5P_VA_COREPERI_BASE,
- .pfn = __phys_to_pfn(EXYNOS4_PA_COREPERI),
- .length = SZ_8K,
- .type = MT_DEVICE,
- },
-};
-
static struct platform_device exynos_cpuidle = {
.name = "exynos_cpuidle",
#ifdef CONFIG_ARM_EXYNOS_CPUIDLE
@@ -99,17 +90,6 @@ static int __init exynos_fdt_map_chipid(unsigned long node, const char *uname,
return 1;
}
-/*
- * exynos_map_io
- *
- * register the standard cpu IO areas
- */
-static void __init exynos_map_io(void)
-{
- if (soc_is_exynos4())
- iotable_init(exynos4_iodesc, ARRAY_SIZE(exynos4_iodesc));
-}
-
static void __init exynos_init_io(void)
{
debug_ll_io_init();
@@ -118,8 +98,6 @@ static void __init exynos_init_io(void)
/* detect cpu id and rev. */
s5p_init_cpu(S5P_VA_CHIPID);
-
- exynos_map_io();
}
/*
diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h
index 5fb0040..0eef407 100644
--- a/arch/arm/mach-exynos/include/mach/map.h
+++ b/arch/arm/mach-exynos/include/mach/map.h
@@ -18,6 +18,4 @@
#define EXYNOS_PA_CHIPID 0x10000000
-#define EXYNOS4_PA_COREPERI 0x10500000
-
#endif /* __ASM_ARCH_MAP_H */
diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
index a5d6841..94405c7 100644
--- a/arch/arm/mach-exynos/platsmp.c
+++ b/arch/arm/mach-exynos/platsmp.c
@@ -168,6 +168,27 @@ int exynos_cluster_power_state(int cluster)
S5P_CORE_LOCAL_PWR_EN);
}
+/**
+ * exynos_scu_enable : enables SCU for Cortex-A9 based system
+ * returns 0 on success else non-zero error code
+ */
+int exynos_scu_enable(void)
+{
+ struct device_node *np;
+ void __iomem *scu_base;
+
+ np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu");
+ scu_base = of_iomap(np, 0);
+ of_node_put(np);
+ if (!scu_base) {
+ pr_err("%s failed to map scu_base\n", __func__);
+ return -ENOMEM;
+ }
+ scu_enable(scu_base);
+ iounmap(scu_base);
+ return 0;
+}
+
static void __iomem *cpu_boot_reg_base(void)
{
if (soc_is_exynos4210() && samsung_rev() == EXYNOS4210_REV_1_1)
@@ -224,11 +245,6 @@ static void write_pen_release(int val)
sync_cache_w(&pen_release);
}
-static void __iomem *scu_base_addr(void)
-{
- return (void __iomem *)(S5P_VA_SCU);
-}
-
static DEFINE_SPINLOCK(boot_lock);
static void exynos_secondary_init(unsigned int cpu)
@@ -393,9 +409,11 @@ static void __init exynos_smp_prepare_cpus(unsigned int max_cpus)
exynos_set_delayed_reset_assertion(true);
- if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9)
- scu_enable(scu_base_addr());
-
+ if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) {
+ /* if exynos_scu_enable fails, return */
+ if (exynos_scu_enable())
+ return;
+ }
/*
* Write the address of secondary startup into the
* system-wide flags register. The boot monitor waits
diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c
index 487295f..c0b46c3 100644
--- a/arch/arm/mach-exynos/pm.c
+++ b/arch/arm/mach-exynos/pm.c
@@ -26,8 +26,6 @@
#include <asm/suspend.h>
#include <asm/cacheflush.h>
-#include <mach/map.h>
-
#include "common.h"
static inline void __iomem *exynos_boot_vector_addr(void)
@@ -177,7 +175,7 @@ void exynos_enter_aftr(void)
cpu_suspend(0, exynos_aftr_finisher);
if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) {
- scu_enable(S5P_VA_SCU);
+ exynos_scu_enable();
if (call_firmware_op(resume) == -ENOSYS)
exynos_cpu_restore_register();
}
diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c
index 06332f6..73df9f3 100644
--- a/arch/arm/mach-exynos/suspend.c
+++ b/arch/arm/mach-exynos/suspend.c
@@ -34,8 +34,6 @@
#include <asm/smp_scu.h>
#include <asm/suspend.h>
-#include <mach/map.h>
-
#include <plat/pm-common.h>
#include "common.h"
@@ -462,7 +460,7 @@ static void exynos_pm_resume(void)
exynos_pm_release_retention();
if (cpuid == ARM_CPU_PART_CORTEX_A9)
- scu_enable(S5P_VA_SCU);
+ exynos_scu_enable();
if (call_firmware_op(resume) == -ENOSYS
&& cpuid == ARM_CPU_PART_CORTEX_A9)
diff --git a/arch/arm/plat-samsung/include/plat/map-s5p.h b/arch/arm/plat-samsung/include/plat/map-s5p.h
index 0fe2828..512ed1f 100644
--- a/arch/arm/plat-samsung/include/plat/map-s5p.h
+++ b/arch/arm/plat-samsung/include/plat/map-s5p.h
@@ -15,10 +15,6 @@
#define S5P_VA_CHIPID S3C_ADDR(0x02000000)
-#define S5P_VA_COREPERI_BASE S3C_ADDR(0x02800000)
-#define S5P_VA_COREPERI(x) (S5P_VA_COREPERI_BASE + (x))
-#define S5P_VA_SCU S5P_VA_COREPERI(0x0)
-
#define VA_VIC(x) (S3C_VA_IRQ + ((x) * 0x10000))
#define VA_VIC0 VA_VIC(0)
#define VA_VIC1 VA_VIC(1)
--
2.7.4
^ permalink raw reply related
* [PATCH v3 2/2] ARM: EXYNOS: Remove unused soc_is_exynos{4,5}
From: Pankaj Dubey @ 2016-11-09 12:15 UTC (permalink / raw)
To: linux-samsung-soc, linux-arm-kernel; +Cc: krzk, kgene, thomas.ab, Pankaj Dubey
In-Reply-To: <1478693755-11953-1-git-send-email-pankaj.dubey@samsung.com>
As no more user of soc_is_exynos{4,5} we can safely remove them.
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
---
arch/arm/mach-exynos/common.h | 5 -----
1 file changed, 5 deletions(-)
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index dd5d8e8..fb12d11 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -105,11 +105,6 @@ IS_SAMSUNG_CPU(exynos5800, EXYNOS5800_SOC_ID, EXYNOS5_SOC_MASK)
# define soc_is_exynos5800() 0
#endif
-#define soc_is_exynos4() (soc_is_exynos4210() || soc_is_exynos4212() || \
- soc_is_exynos4412())
-#define soc_is_exynos5() (soc_is_exynos5250() || soc_is_exynos5410() || \
- soc_is_exynos5420() || soc_is_exynos5800())
-
extern u32 cp15_save_diag;
extern u32 cp15_save_power;
--
2.7.4
^ permalink raw reply related
* Re: [PATCH] x86emul: correct direction of FPU insn emulations
From: Andrew Cooper @ 2016-11-09 12:13 UTC (permalink / raw)
To: Jan Beulich, xen-devel; +Cc: Wei Liu
In-Reply-To: <5822EB80020000780011D44C@prv-mh.provo.novell.com>
On 09/11/16 08:25, Jan Beulich wrote:
> There are two cases where this was wrong, albeit in a benign way (the
> compiler - according to my checking - didn't leverage the wrongness
> for any optimizations affecting overall outcome).
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply
* Re: [Qemu-devel] [PULL v3 00/30] Misc patches for 2016-10-31
From: Paolo Bonzini @ 2016-11-09 12:13 UTC (permalink / raw)
To: Eric Blake; +Cc: Max Reitz, qemu-devel
In-Reply-To: <f5a4c0b1-4396-fd88-6006-0ab3af397a11@redhat.com>
> but then fails the assertion, which means read_sync() is returning 0 in
> our particular test (which sort of makes sense: the test is purposefully
> truncating the server stream at various points to see how the client
> reacts). I'm trying to figure out if always treating early EOF as a
> read error would be sufficient to make things work the way we want in
> the client.
Yeah, early EOF should become ESHUTDOWN, ECONNRESET or similar.
Paolo
^ permalink raw reply
* Re: [PATCH] examples/l3fwd: force CRC stripping for i40evf
From: Ananyev, Konstantin @ 2016-11-09 12:13 UTC (permalink / raw)
To: Topel, Bjorn, dev@dpdk.org, Zhang, Helin
Cc: Xu, Qian Q, Yao, Lei A, Wu, Jingjing, thomas.monjalon@6wind.com
In-Reply-To: <b2592ded-badc-5445-526c-d0203b48f592@intel.com>
> -----Original Message-----
> From: Topel, Bjorn
> Sent: Wednesday, November 9, 2016 11:28 AM
> To: Ananyev, Konstantin <konstantin.ananyev@intel.com>; dev@dpdk.org; Zhang, Helin <helin.zhang@intel.com>
> Cc: Xu, Qian Q <qian.q.xu@intel.com>; Yao, Lei A <lei.a.yao@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> thomas.monjalon@6wind.com
> Subject: Re: [dpdk-dev] [PATCH] examples/l3fwd: force CRC stripping for i40evf
>
> >> Correct, so the broader question would be "what is the correct
> >> behavior for an example application, when a port configuration
> >> isn't supported by the hardware?".
> >>
> >> My stand, FWIW, is that igb and ixgbe should have the same
> >> semantics as i40e currently has, i.e. return an error to the user
> >> if the port is mis-configured, NOT changing the setting behind the
> >> users back.
> >>
> >
> > Fine by me, but then it means that the fix haw to include changes
> > for all apps plus ixgbe and igb PMDs, correct? :)
>
> Ugh. Correct, I guess. :-)
>
> As for ixgbe and igb - they need a patch changing from silent ignore to
> explicit error. Regarding the apps, I guess all the apps that rely on
> that disabling CRC stripping always work, need some work. Or should all
> the example applications have CRC stripping *enabled* by default? I'd
> assume that all DPDK supported NICs has support for CRC stripping
From the sources, it seems that only nfp doesn't support HW CRC stripping.
In fact, as I can see some non-Intel PMDs just ignore hw_stip_crc value
and assume that CRC strip is always on.
> and I
> guess this is the rational for having it on by default for Intel VFs.
>
> In general, for the example applications, if an application relies on a
> property for a port, that the hardware doesn't support -- what would be
> the desired behavior? Or is it implied that the example applications
> only use a common, minimal set of features that are know to be supported
> by all DPDK supported hardware?
>
> Isn't it perfectly valid that some example applications wont run for all
> hardware?
>
> Finally, why doesn't l3fwd have the CRC stripped?
I don’t know any good reason for that for l3fwd or any other sample app.
I think it is just a 'historical' reason.
Konstantin
>
>
> Björn
^ permalink raw reply
* Re: [PATCH] arm64:renesas: Introduce early console for Salvator-X board
From: Julien Grall @ 2016-11-09 12:14 UTC (permalink / raw)
To: Dirk Behme, Iurii Mykhalskyi; +Cc: Stefano Stabellini, Dirk Behme, xen-devel
In-Reply-To: <0399b362-b920-2891-b373-b7a5f6cb9b20@de.bosch.com>
Hello,
On 09/11/16 07:14, Dirk Behme wrote:
> On 08.11.2016 16:41, Iurii Mykhalskyi wrote:
>> Hello Dirk,
>>
>> I have made only single change - I recompile ATF to leave CPU in EL2
>> mode and reflash it.
>
>
> Yes, this is what I meant with 'modifying firmware' ;)
>
> You are loading Xen with U-Boot running in EL2, then?
>
> With this modification, do all other use cases still work? E.g. load and
> boot U-Boot and native Linux kernel without Xen?
Yes, when Linux is booting from EL2, it will drop to EL1 (see
el2_setup). As Andre mentioned on the previous thread, U-boot is running
at EL2 on various board (e.g pine64, juno).
Modifying the firmware was the right way to go as there is no solution
go boot at EL2 from EL1.
Regards,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply
* Re: [PATCH v4 2/3] Input: ALPS - Clean up TrackStick handling for SS5 hardware
From: Pali Rohár @ 2016-11-09 12:14 UTC (permalink / raw)
To: Paul Donohue; +Cc: linux-input, Ben Gamari, Michal Hocko
In-Reply-To: <20161108151621.GO2927@TopQuark.net>
On Tuesday 08 November 2016 10:16:21 Paul Donohue wrote:
> For consistency and clarity, the input_report_*() functions should
> be called by alps_process_packet_ss4_v2() instead of by
> alps_decode_ss4_v2().
>
> Signed-off-by: Paul Donohue <linux-kernel@PaulSD.com>
>
> diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
> index b93fe83..12376d2 100644
> --- a/drivers/input/mouse/alps.c
> +++ b/drivers/input/mouse/alps.c
> @@ -1267,18 +1267,11 @@ static int alps_decode_ss4_v2(struct alps_fields *f,
> break;
>
> case SS4_PACKET_ID_STICK:
> - if (!(priv->flags & ALPS_DUALPOINT)) {
> - psmouse_warn(psmouse,
> - "Rejected trackstick packet from non DualPoint device");
> - } else {
> - int x = (s8)(((p[0] & 1) << 7) | (p[1] & 0x7f));
> - int y = (s8)(((p[3] & 1) << 7) | (p[2] & 0x7f));
> - int pressure = (s8)(p[4] & 0x7f);
> -
> - input_report_rel(priv->dev2, REL_X, x);
> - input_report_rel(priv->dev2, REL_Y, -y);
> - input_report_abs(priv->dev2, ABS_PRESSURE, pressure);
> - }
> + f->st.x = (s8)(((p[0] & 1) << 7) | (p[1] & 0x7f));
> + f->st.y = -(s8)(((p[3] & 1) << 7) | (p[2] & 0x7f));
> + f->pressure = (s8)(p[4] & 0x7f);
This is not correct. Those fields values are used for single touch
events from touchpad -- not from trackstick.
Btw, you have access to packet also in process functions, so you can
extract x, y and pressure in process function too.
--
Pali Rohár
pali.rohar@gmail.com
^ permalink raw reply
* ✓ Fi.CI.BAT: success for drm/i915: Demote i915_gem_open() debugging from DRIVER to USER
From: Patchwork @ 2016-11-09 12:15 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
In-Reply-To: <20161109104507.21228-1-chris@chris-wilson.co.uk>
== Series Details ==
Series: drm/i915: Demote i915_gem_open() debugging from DRIVER to USER
URL : https://patchwork.freedesktop.org/series/15023/
State : success
== Summary ==
Series 15023v1 drm/i915: Demote i915_gem_open() debugging from DRIVER to USER
https://patchwork.freedesktop.org/api/1.0/series/15023/revisions/1/mbox/
fi-bdw-5557u total:244 pass:229 dwarn:0 dfail:0 fail:0 skip:15
fi-bsw-n3050 total:244 pass:204 dwarn:0 dfail:0 fail:0 skip:40
fi-bxt-t5700 total:244 pass:216 dwarn:0 dfail:0 fail:0 skip:28
fi-byt-j1900 total:244 pass:216 dwarn:0 dfail:0 fail:0 skip:28
fi-byt-n2820 total:244 pass:212 dwarn:0 dfail:0 fail:0 skip:32
fi-hsw-4770 total:244 pass:224 dwarn:0 dfail:0 fail:0 skip:20
fi-hsw-4770r total:244 pass:224 dwarn:0 dfail:0 fail:0 skip:20
fi-ilk-650 total:244 pass:191 dwarn:0 dfail:0 fail:0 skip:53
fi-ivb-3520m total:244 pass:222 dwarn:0 dfail:0 fail:0 skip:22
fi-ivb-3770 total:244 pass:222 dwarn:0 dfail:0 fail:0 skip:22
fi-kbl-7200u total:244 pass:222 dwarn:0 dfail:0 fail:0 skip:22
fi-skl-6260u total:244 pass:230 dwarn:0 dfail:0 fail:0 skip:14
fi-skl-6700hq total:244 pass:223 dwarn:0 dfail:0 fail:0 skip:21
fi-skl-6700k total:244 pass:222 dwarn:1 dfail:0 fail:0 skip:21
fi-snb-2520m total:244 pass:212 dwarn:0 dfail:0 fail:0 skip:32
fi-snb-2600 total:244 pass:211 dwarn:0 dfail:0 fail:0 skip:33
972b631c86ecf25d43d16b3617672f481a5cbd08 drm-intel-nightly: 2016y-11m-09d-10h-46m-28s UTC integration manifest
69bcd13 drm/i915: Demote i915_gem_open() debugging from DRIVER to USER
== Logs ==
For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_2941/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply
* Re: [PATCH] weston: upgrade from 1.11.1 to 1.12.0
From: Burton, Ross @ 2016-11-09 12:15 UTC (permalink / raw)
To: Fathi Boudra; +Cc: OE-core
In-Reply-To: <20161108135457.13249-1-fathi.boudra@linaro.org>
[-- Attachment #1: Type: text/plain, Size: 305 bytes --]
On 8 November 2016 at 13:54, Fathi Boudra <fathi.boudra@linaro.org> wrote:
> FILES_${PN}-xwayland = "${libdir}/${BPN}/xwayland.so"
>
Because you didn't fix this patch the weston-xwayland package is never
built, buildhistory is huge and core-image-weston with X11 enabled doesn't
build.
Ross
[-- Attachment #2: Type: text/html, Size: 714 bytes --]
^ permalink raw reply
* [PATCH v3 0/2] Remove static mapping of SCU from mach-exynos
From: Pankaj Dubey @ 2016-11-09 12:15 UTC (permalink / raw)
To: linux-arm-kernel
This patch series is part of patch series [1], which adds support of SCU
device node for Cortex-A9 based Exynos4 SoC. First two patches of the same
has been accepted and hence not included them in v3.
This patch series does some cleanup for Exynos4 SoC based boards.
We are currently statically mapping SCU SFRs in mach-exynos/exynos.c
which can be avoided if map this from device node of SCU
[1]: https://www.spinics.net/lists/arm-kernel/msg540498.html
This patch series is prepared on Krzysztof's for-next
(SHA_ID: b33c7bb9d59c3f4100d4)
I have tested these patches on Exynos4210 based on Origen board for SMP boot.
Patchset v1 was tested by Marek Szyprowski on Exynos4412-based Odroid U3
for SMP boot and S2R.
To confirm concern raised by Alim, I intentionally removed SCU device node
from exynos4.dtsi and tested on Origen board, I can see code handles this
case gracefully without any crash and system boot was fine. Of-course in such
case only single core will be able to boot.
Following boot message observed on Origen in case of missing SCU node
-------------
[ 0.000864] CPU: Testing write buffer coherency: ok
[ 0.001068] CPU0: thread -1, cpu 0, socket 9, mpidr 80000900
[ 0.001456] exynos_scu_enable failed to map scu_base
[ 0.001477] Setting up static identity map for 0x40100000 - 0x40100058
[ 1.120003] CPU1: failed to come online
[ 1.120059] Brought up 1 CPUs
[ 1.120068] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[ 1.120076] CPU: All CPU(s) started in SVC mode.
-------------
Changes since v2:
- Removed unnecessary header file inclusion from pm.c.
- Move out call_firmware_op call from CORTEX-A9 check.
- Update commit log for 1/2 patch describing dependency on DTS and affect of
the patch on out-of-tree DTS
Changes since v1:
- Address review comments from Krzysztof
- Moved scu_enable from pm.c and suspend.c to single place in platsmp.c
- Added error handling during scu_enable in platsmp.c
- Added Reviewed-by tag from Alim.
Pankaj Dubey (2):
ARM: EXYNOS: Remove static mapping of SCU SFR
ARM: EXYNOS: Remove unused soc_is_exynos{4,5}
arch/arm/mach-exynos/common.h | 6 +----
arch/arm/mach-exynos/exynos.c | 22 ------------------
arch/arm/mach-exynos/include/mach/map.h | 2 --
arch/arm/mach-exynos/platsmp.c | 34 +++++++++++++++++++++-------
arch/arm/mach-exynos/pm.c | 4 +---
arch/arm/mach-exynos/suspend.c | 4 +---
arch/arm/plat-samsung/include/plat/map-s5p.h | 4 ----
7 files changed, 29 insertions(+), 47 deletions(-)
--
2.7.4
^ permalink raw reply
* [PATCH v3 1/2] ARM: EXYNOS: Remove static mapping of SCU SFR
From: Pankaj Dubey @ 2016-11-09 12:15 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1478693755-11953-1-git-send-email-pankaj.dubey@samsung.com>
Lets remove static mapping of SCU SFR mainly used in CORTEX-A9 SoC based
boards. Instead use mapping from device tree node of SCU.
NOTE: This patch has dependency on DT file of any such CORTEX-A9 SoC
based boards, in the absence of SCU device node in DTS file, only single
CPU will boot. So if you are using OUT-OF-TREE DTS file of CORTEX-A9 based
Exynos SoC make sure to add SCU device node to DTS file for SMP boot.
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
---
arch/arm/mach-exynos/common.h | 1 +
arch/arm/mach-exynos/exynos.c | 22 ------------------
arch/arm/mach-exynos/include/mach/map.h | 2 --
arch/arm/mach-exynos/platsmp.c | 34 +++++++++++++++++++++-------
arch/arm/mach-exynos/pm.c | 4 +---
arch/arm/mach-exynos/suspend.c | 4 +---
arch/arm/plat-samsung/include/plat/map-s5p.h | 4 ----
7 files changed, 29 insertions(+), 42 deletions(-)
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index 9424a8a..dd5d8e8 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -161,6 +161,7 @@ extern void exynos_cpu_restore_register(void);
extern void exynos_pm_central_suspend(void);
extern int exynos_pm_central_resume(void);
extern void exynos_enter_aftr(void);
+extern int exynos_scu_enable(void);
extern struct cpuidle_exynos_data cpuidle_coupled_exynos_data;
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index 757fc11..fa08ef9 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -28,15 +28,6 @@
#include "common.h"
-static struct map_desc exynos4_iodesc[] __initdata = {
- {
- .virtual = (unsigned long)S5P_VA_COREPERI_BASE,
- .pfn = __phys_to_pfn(EXYNOS4_PA_COREPERI),
- .length = SZ_8K,
- .type = MT_DEVICE,
- },
-};
-
static struct platform_device exynos_cpuidle = {
.name = "exynos_cpuidle",
#ifdef CONFIG_ARM_EXYNOS_CPUIDLE
@@ -99,17 +90,6 @@ static int __init exynos_fdt_map_chipid(unsigned long node, const char *uname,
return 1;
}
-/*
- * exynos_map_io
- *
- * register the standard cpu IO areas
- */
-static void __init exynos_map_io(void)
-{
- if (soc_is_exynos4())
- iotable_init(exynos4_iodesc, ARRAY_SIZE(exynos4_iodesc));
-}
-
static void __init exynos_init_io(void)
{
debug_ll_io_init();
@@ -118,8 +98,6 @@ static void __init exynos_init_io(void)
/* detect cpu id and rev. */
s5p_init_cpu(S5P_VA_CHIPID);
-
- exynos_map_io();
}
/*
diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h
index 5fb0040..0eef407 100644
--- a/arch/arm/mach-exynos/include/mach/map.h
+++ b/arch/arm/mach-exynos/include/mach/map.h
@@ -18,6 +18,4 @@
#define EXYNOS_PA_CHIPID 0x10000000
-#define EXYNOS4_PA_COREPERI 0x10500000
-
#endif /* __ASM_ARCH_MAP_H */
diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
index a5d6841..94405c7 100644
--- a/arch/arm/mach-exynos/platsmp.c
+++ b/arch/arm/mach-exynos/platsmp.c
@@ -168,6 +168,27 @@ int exynos_cluster_power_state(int cluster)
S5P_CORE_LOCAL_PWR_EN);
}
+/**
+ * exynos_scu_enable : enables SCU for Cortex-A9 based system
+ * returns 0 on success else non-zero error code
+ */
+int exynos_scu_enable(void)
+{
+ struct device_node *np;
+ void __iomem *scu_base;
+
+ np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu");
+ scu_base = of_iomap(np, 0);
+ of_node_put(np);
+ if (!scu_base) {
+ pr_err("%s failed to map scu_base\n", __func__);
+ return -ENOMEM;
+ }
+ scu_enable(scu_base);
+ iounmap(scu_base);
+ return 0;
+}
+
static void __iomem *cpu_boot_reg_base(void)
{
if (soc_is_exynos4210() && samsung_rev() == EXYNOS4210_REV_1_1)
@@ -224,11 +245,6 @@ static void write_pen_release(int val)
sync_cache_w(&pen_release);
}
-static void __iomem *scu_base_addr(void)
-{
- return (void __iomem *)(S5P_VA_SCU);
-}
-
static DEFINE_SPINLOCK(boot_lock);
static void exynos_secondary_init(unsigned int cpu)
@@ -393,9 +409,11 @@ static void __init exynos_smp_prepare_cpus(unsigned int max_cpus)
exynos_set_delayed_reset_assertion(true);
- if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9)
- scu_enable(scu_base_addr());
-
+ if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) {
+ /* if exynos_scu_enable fails, return */
+ if (exynos_scu_enable())
+ return;
+ }
/*
* Write the address of secondary startup into the
* system-wide flags register. The boot monitor waits
diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c
index 487295f..c0b46c3 100644
--- a/arch/arm/mach-exynos/pm.c
+++ b/arch/arm/mach-exynos/pm.c
@@ -26,8 +26,6 @@
#include <asm/suspend.h>
#include <asm/cacheflush.h>
-#include <mach/map.h>
-
#include "common.h"
static inline void __iomem *exynos_boot_vector_addr(void)
@@ -177,7 +175,7 @@ void exynos_enter_aftr(void)
cpu_suspend(0, exynos_aftr_finisher);
if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) {
- scu_enable(S5P_VA_SCU);
+ exynos_scu_enable();
if (call_firmware_op(resume) == -ENOSYS)
exynos_cpu_restore_register();
}
diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c
index 06332f6..73df9f3 100644
--- a/arch/arm/mach-exynos/suspend.c
+++ b/arch/arm/mach-exynos/suspend.c
@@ -34,8 +34,6 @@
#include <asm/smp_scu.h>
#include <asm/suspend.h>
-#include <mach/map.h>
-
#include <plat/pm-common.h>
#include "common.h"
@@ -462,7 +460,7 @@ static void exynos_pm_resume(void)
exynos_pm_release_retention();
if (cpuid == ARM_CPU_PART_CORTEX_A9)
- scu_enable(S5P_VA_SCU);
+ exynos_scu_enable();
if (call_firmware_op(resume) == -ENOSYS
&& cpuid == ARM_CPU_PART_CORTEX_A9)
diff --git a/arch/arm/plat-samsung/include/plat/map-s5p.h b/arch/arm/plat-samsung/include/plat/map-s5p.h
index 0fe2828..512ed1f 100644
--- a/arch/arm/plat-samsung/include/plat/map-s5p.h
+++ b/arch/arm/plat-samsung/include/plat/map-s5p.h
@@ -15,10 +15,6 @@
#define S5P_VA_CHIPID S3C_ADDR(0x02000000)
-#define S5P_VA_COREPERI_BASE S3C_ADDR(0x02800000)
-#define S5P_VA_COREPERI(x) (S5P_VA_COREPERI_BASE + (x))
-#define S5P_VA_SCU S5P_VA_COREPERI(0x0)
-
#define VA_VIC(x) (S3C_VA_IRQ + ((x) * 0x10000))
#define VA_VIC0 VA_VIC(0)
#define VA_VIC1 VA_VIC(1)
--
2.7.4
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
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.