From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DE0DC433DB for ; Sun, 7 Feb 2021 15:12:39 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9E66F64DE3 for ; Sun, 7 Feb 2021 15:12:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9E66F64DE3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:38160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8ljp-0002jp-ET for qemu-devel@archiver.kernel.org; Sun, 07 Feb 2021 10:12:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50764) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8lj0-0002B5-MW; Sun, 07 Feb 2021 10:11:46 -0500 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:43676) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8liy-00040q-OL; Sun, 07 Feb 2021 10:11:46 -0500 Received: by mail-ed1-x52f.google.com with SMTP id s26so9441772edt.10; Sun, 07 Feb 2021 07:11:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=G6vja1e/EUSs2abvV9QEzIfbWmOFFIxRU4k0bpZasic=; b=ll9tdBvAIa1vcS1izbjZcIyE+jru99q9AQaw5By59YA/Kmm3Ri6Xk5AmcvLJP7SXWw aAARdY9QS7WgIbslthYgo6lXmjrj3Mro94G/XTZi3Xogadmmxd47/HTaFxNQE7Z8ek4L Fh4KeOJsbB3fzHy9LUvQdT2fh1d9HcZMb3XerfUHJelpsOkgofI95X7tuZesgLO+jrCS JFNkjzkxp/1Jd8O23c3eiC3G9UyDCnll3MKy+QwE7loLK+ZzAWrLkOWZZwzJ8klAct/F GRxItOR6YwAQi8roANwMOjpLlLorv52TzN9EDIgA9rjs6jSqrkByo94s7gRaDmZ1hDCR o39Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=G6vja1e/EUSs2abvV9QEzIfbWmOFFIxRU4k0bpZasic=; b=K6PuvUKLMnoQs7g2IG4RZCPlAYPp2sqtG1iaGsdnMVQ6v0Z8Z/oC158u9n++ZP2WNP FkZS9pPh1sJnfZFA1/9e5NGbZcqEbjt67rQvUnAL9yP9wjk80kbT7VzUije0jEjStud1 F6J4tKF3C3aN0KHGkSBfRIfvuU8xeXIPQ8CSgZ7GvXOV/a6ItLlCQdxM6MpIDY6I3FXu ++53SAll8v+t0UU6PJ7wrHe42iSXv84NfKO9++m0qfhK/4XsnASQGsKF6amQLKFc7SmN y3fgy29V5UyKWG6JU6RIxzqojFdYaxQUEw6x90nPwhdzH5rUTvenTmkEf22n6JdNjG+M pEmw== X-Gm-Message-State: AOAM530KCSIPONYUowlwX3DiOCR6newK3WygMoen12oFbyO2mgRzwAO7 ne4YooFnBGgmRuqxlAWSK0Q= X-Google-Smtp-Source: ABdhPJwpGoHAl7OfRPWKXTGUyxNLYIoYNiwoJmi00wCY1At0R6/Dn82z2tisD6LahSFvKkUwr8Itmg== X-Received: by 2002:a05:6402:13cd:: with SMTP id a13mr13166127edx.87.1612710702162; Sun, 07 Feb 2021 07:11:42 -0800 (PST) Received: from pek-vx-bsp2.wrs.com (ec2-44-242-66-180.us-west-2.compute.amazonaws.com. [44.242.66.180]) by smtp.gmail.com with ESMTPSA id w26sm2010399edq.46.2021.02.07.07.11.36 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Feb 2021 07:11:41 -0800 (PST) From: Bin Meng To: Simon Glass , Alexander Graf , Priyanka Jain Subject: [PATCH 00/26] ppc: qemu: Convert qemu-ppce500 to driver model Date: Sun, 7 Feb 2021 23:11:00 +0800 Message-Id: <1612710687-56493-1-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.7.4 Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=bmeng.cn@gmail.com; helo=mail-ed1-x52f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tom Rini , Heiko Schocher , qemu-devel@nongnu.org, U-Boot Mailing List , Matthias Brugger , qemu-ppc@nongnu.org, Stefan Roese , Marek Szyprowski Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" At present when building qemu-ppce500 the following warnings are seen: ===================== WARNING ====================== This board does not use CONFIG_DM. CONFIG_DM will be compulsory starting with the v2020.01 release. Failure to update may result in board removal. UPD include/generated/timestamp_autogenerated.h See doc/driver-model/migration.rst for more info. ==================================================== ===================== WARNING ====================== This board does not use CONFIG_DM_PCI Please update the board to use CONFIG_DM_PCI before the v2019.07 release. Failure to update by the deadline may result in board removal. See doc/driver-model/migration.rst for more info. ==================================================== ===================== WARNING ====================== This board does not use CONFIG_DM_ETH (Driver Model for Ethernet drivers). Please update the board to use CONFIG_DM_ETH before the v2020.07 release. Failure to update by the deadline may result in board removal. See doc/driver-model/migration.rst for more info. ==================================================== The conversion of qemu-ppce500 board to driver model is long overdue. When testing the exisitng qemu-ppce500 support, PCI was found broken. This is caused by 2 separate issues: - One issue was caused by U-Boot: Commit e002474158d1 ("pci: pci-uclass: Dynamically allocate the PCI regions") Patch #1 reverts this commit as it broken all boards that have not converted to driver model PCI. - One issue was caused by QEMU: commit e6b4e5f4795b ("PPC: e500: Move CCSR and MMIO space to upper end of address space") commit cb3778a0455a ("PPC: e500 pci host: Add support for ATMUs") Patch #3-4 fixed this issue to keep in sync with latest QEMU upstream Patch #5-8 are minor fixes and clean-ups. Starting from patch#9, these are driver model conversion patches. Patch #11-16 are mainly related to CONFIG_ADDR_MAP, a library to support targets that have non-identity virtual-physical address mappings. A new command 'addrmap' is introduced to aid debugging, and a fix to arch/powerpc/asm/include/io.h is made to correct the usage of CONFIG_ADDR_MAP as it can only be used in the post- relocation phase. Also the initialization of this library is moved a bit earlier in the post-relocation phase otherwise device drivers won't work. Patch #18-20 are 85xx PCI driver fixes. It adds support to controller register physical address beyond 32-bit, as well as support to 64-bit bus and cpu address as current upstream QEMU uses 64-bit cpu address. Patch #23 is minor fix to the 'virtio' command dependency. Patch #24 enables the VirtIO NET support as by default a VirtIO standard PCI networking device is connected as an ethernet interface at PCI address 0.1.0. Patch #25 moves the qemu-ppce500 boards codes to board/emulation as that is the place for other QEMU targets like x86, arm, riscv. Patch #26 adds a reST document to describe how to build and run U-Boot for the QEMU ppce500 machine. I hope we can make this series to U-Boot v2021.04 release. This series is available at u-boot-x86/qemu-ppc for testing. This cover letter is cc'ed to QEMU mailing list for a heads-up. A future patch will be sent to QEMU mailing list to bring its in-tree U-Boot source codes up-to-date. Bin Meng (26): Revert "pci: pci-uclass: Dynamically allocate the PCI regions" ppc: qemu: Update MAINTAINERS for correct email address common: fdt_support: Support special case of PCI address in fdt_read_prop() ppc: qemu: Support non-identity PCI bus address ppc: qemu: Fix CONFIG_SYS_PCI_MAP_END ppc: mpc85xx: Wrap LAW related codes with CONFIG_FSL_LAW ppc: qemu: Drop init_laws() and print_laws() ppc: qemu: Drop board_early_init_f() ppc: qemu: Enable OF_CONTROL ppc: qemu: Enable driver model include: Remove extern from addr_map.h lib: addr_map: Move address_map[] type to the header file cmd: Add a command to display the address map lib: kconfig: Mention CONFIG_ADDR_MAP limitation in the help ppc: io.h: Use addrmap_ translation APIs only in post-relocation phase common: Move initr_addr_map() to a bit earlier ppc: qemu: Switch over to use DM serial pci: mpc85xx: Wrap LAW programming with CONFIG_FSL_LAW pci: mpc85xx: Support controller register physical address beyond 32-bit pci: mpc85xx: Support 64-bit bus and cpu address ppc: qemu: Switch over to use DM ETH and PCI ppc: qemu: Drop CONFIG_OF_BOARD_SETUP cmd: Fix virtio command dependency ppc: qemu: Enable VirtIO NET support ppc: qemu: Move board directory from board/freescale to board/emulation doc: Add a reST document for qemu-ppce500 arch/powerpc/cpu/mpc85xx/Kconfig | 2 +- arch/powerpc/cpu/mpc85xx/cpu.c | 2 + arch/powerpc/cpu/mpc85xx/cpu_init_early.c | 2 + arch/powerpc/include/asm/io.h | 15 +- .../{freescale => emulation}/qemu-ppce500/Kconfig | 2 +- board/emulation/qemu-ppce500/MAINTAINERS | 7 + .../{freescale => emulation}/qemu-ppce500/Makefile | 0 .../qemu-ppce500/qemu-ppce500.c | 159 ++++++--------------- board/freescale/qemu-ppce500/MAINTAINERS | 6 - cmd/Kconfig | 8 ++ cmd/Makefile | 1 + cmd/addrmap.c | 35 +++++ common/board_r.c | 6 +- common/fdt_support.c | 15 +- configs/qemu-ppce500_defconfig | 14 +- doc/board/emulation/index.rst | 1 + doc/board/emulation/qemu-ppce500.rst | 73 ++++++++++ drivers/pci/pci-uclass.c | 14 +- drivers/pci/pci_mpc85xx.c | 25 ++-- include/addr_map.h | 16 ++- include/configs/qemu-ppce500.h | 25 +--- include/pci.h | 4 +- lib/Kconfig | 2 + lib/addr_map.c | 6 +- 24 files changed, 250 insertions(+), 190 deletions(-) rename board/{freescale => emulation}/qemu-ppce500/Kconfig (86%) create mode 100644 board/emulation/qemu-ppce500/MAINTAINERS rename board/{freescale => emulation}/qemu-ppce500/Makefile (100%) rename board/{freescale => emulation}/qemu-ppce500/qemu-ppce500.c (68%) delete mode 100644 board/freescale/qemu-ppce500/MAINTAINERS create mode 100644 cmd/addrmap.c create mode 100644 doc/board/emulation/qemu-ppce500.rst -- 2.7.4