All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 00/15] MIPS Malta board support
@ 2013-10-23 10:07 Paul Burton
  2013-10-23 10:07 ` [U-Boot] [PATCH 01/15] mips32: detect L1 cache sizes if they're not defined Paul Burton
                   ` (14 more replies)
  0 siblings, 15 replies; 36+ messages in thread
From: Paul Burton @ 2013-10-23 10:07 UTC (permalink / raw)
  To: u-boot

This series adds support for booting on a physical MIPS Malta board
using a coreFPGA6 core card.

The first 6 patches lay some groundwork, then the next 8 genericise
the existing qemu-malta board to also function on a physical Malta.

In the final patch I stake my claim upon, errm I mean step up to
support :), the malta(el) board(s).

Paul Burton (15):
  mips32: detect L1 cache sizes if they're not defined
  pcnet: code style cleanup
  pcnet: s/le16_to_cpu/cpu_to_le16/ in pcnet_send
  pcnet: add cache flushing & invalidation
  pcnet: enable the NOUFLO feature
  pci.h: allow inclusion in assembly source
  qemu-malta: rename to just "malta"
  malta: setup super I/O UARTs
  malta: support for coreFPGA6 boards
  malta: display "U-boot" on the LCD screen
  malta: enable CONFIG_PCNET_79C973, PCNET_HAS_PROM, CONFIG_CMD_DHCP
  malta: remove cache size definitions
  malta: disable L2 caches
  malta: add script & instructions to flash U-boot
  malta: add myself to maintainers

 arch/mips/cpu/mips32/cache.S     |  90 +++++++++++--
 arch/mips/cpu/mips32/cpu.c       |  73 +++++++++-
 arch/mips/include/asm/malta.h    |  45 ++++++-
 arch/mips/include/asm/mipsregs.h |   6 +
 arch/mips/lib/bootm.c            |  12 +-
 board/malta/Makefile             |  29 ++++
 board/malta/README               |  16 +++
 board/malta/flash-malta-boot.tcl |  40 ++++++
 board/malta/lowlevel_init.S      | 238 +++++++++++++++++++++++++++++++++
 board/malta/malta.c              | 186 ++++++++++++++++++++++++++
 board/malta/superio.c            |  63 +++++++++
 board/malta/superio.h            |  15 +++
 board/qemu-malta/Makefile        |  29 ----
 board/qemu-malta/lowlevel_init.S |  69 ----------
 board/qemu-malta/qemu-malta.c    |  47 -------
 boards.cfg                       |   4 +-
 drivers/net/pcnet.c              | 279 +++++++++++++++++++++------------------
 drivers/pci/Makefile             |   1 +
 drivers/pci/pci_msc01.c          | 126 ++++++++++++++++++
 include/configs/malta.h          | 115 ++++++++++++++++
 include/configs/qemu-malta.h     | 114 ----------------
 include/msc01.h                  | 135 +++++++++++++++++++
 include/pci.h                    |   6 +-
 include/pci_ids.h                |   3 +
 include/pci_msc01.h              |  17 +++
 25 files changed, 1340 insertions(+), 418 deletions(-)
 create mode 100644 board/malta/Makefile
 create mode 100644 board/malta/README
 create mode 100644 board/malta/flash-malta-boot.tcl
 create mode 100644 board/malta/lowlevel_init.S
 create mode 100644 board/malta/malta.c
 create mode 100644 board/malta/superio.c
 create mode 100644 board/malta/superio.h
 delete mode 100644 board/qemu-malta/Makefile
 delete mode 100644 board/qemu-malta/lowlevel_init.S
 delete mode 100644 board/qemu-malta/qemu-malta.c
 create mode 100644 drivers/pci/pci_msc01.c
 create mode 100644 include/configs/malta.h
 delete mode 100644 include/configs/qemu-malta.h
 create mode 100644 include/msc01.h
 create mode 100644 include/pci_msc01.h

-- 
1.8.4

^ permalink raw reply	[flat|nested] 36+ messages in thread
* [U-Boot] [PATCH 09/15] malta: support for coreFPGA6 boards
@ 2013-10-24 11:23 Daniel Schwierzeck
  0 siblings, 0 replies; 36+ messages in thread
From: Daniel Schwierzeck @ 2013-10-24 11:23 UTC (permalink / raw)
  To: u-boot

2013/10/24 Paul Burton <paul.burton@imgtec.com>:
>>> diff --git a/drivers/pci/pci_msc01.c b/drivers/pci/pci_msc01.c
>>> new file mode 100644
>>> index 0000000..7904378
>>> --- /dev/null
>>> +++ b/drivers/pci/pci_msc01.c
>>> @@ -0,0 +1,126 @@
>>> +/*
>>> + * Copyright (C) 2013 Imagination Technologies
>>> + * Author: Paul Burton <paul.burton@imgtec.com>
>>> + *
>>> + * SPDX-License-Identifier:    GPL-2.0+
>>> + */
>>> +
>>> +#include <common.h>
>>> +#include <msc01.h>
>>> +#include <pci.h>
>>> +#include <pci_msc01.h>
>>> +#include <asm/io.h>
>>> +
>>> +#define PCI_ACCESS_READ  0
>>> +#define PCI_ACCESS_WRITE 1
>>> +
>>> +struct msc01_pci_controller {
>>> +       struct pci_controller hose;
>>> +       void *base;
>>> +};
>>> +
>>> +static inline struct msc01_pci_controller *
>>> +hose_to_msc01(struct pci_controller *hose)
>>> +{
>>> +       return container_of(hose, struct msc01_pci_controller, hose);
>>> +}
>>> +
>>> +static int msc01_config_access(struct msc01_pci_controller *msc01,
>>> +                              unsigned char access_type, pci_dev_t bdf,
>>> +                              int where, u32 *data)
>>> +{
>>> +       const u32 aborts = MSC01_PCI_INTSTAT_MA_MSK |
>>> MSC01_PCI_INTSTAT_TA_MSK;
>>> +       void *intstat = msc01->base + MSC01_PCI_INTSTAT_OFS;
>>> +       void *cfgdata = msc01->base + MSC01_PCI_CFGDATA_OFS;
>>> +       unsigned int bus = PCI_BUS(bdf);
>>> +       unsigned int dev = PCI_DEV(bdf);
>>> +       unsigned int devfn = PCI_DEV(bdf) << 3 | PCI_FUNC(bdf);
>>> +       u32 status;
>>
>>
>> gcc-4.8 shows a warning:
>>
>> pci_msc01.c: In function 'msc01_config_access':
>> pci_msc01.c:38:6: warning: unused variable 'status' [-Wunused-variable]
>>    u32 status;
>>        ^
>
>
> Right you are.
>
>
>>
>>
>>> +
>>> +       /* clear abort status */
>>> +       __raw_writel(aborts, intstat);
>>> +
>>> +       /* setup address */
>>> +       __raw_writel((bus << MSC01_PCI_CFGADDR_BNUM_SHF) |
>>> +                    (dev << MSC01_PCI_CFGADDR_DNUM_SHF) |
>>> +                    (devfn << MSC01_PCI_CFGADDR_FNUM_SHF) |
>>> +                    ((where / 4) << MSC01_PCI_CFGADDR_RNUM_SHF),
>>> +                    msc01->base + MSC01_PCI_CFGADDR_OFS);
>>
>>
>> Contrary to the kernel U-Boot code must not use  base + offset in IO
>> primitives. Registers should be implemented with a struct.
>> For example:
>>
>> struct foobar_regs {
>>      u32 foo;
>>      u32 bar;
>> };
>>
>> struct foobar_regs *regs = (struct foobar_regs *)CKSEG1ADDR(FOOBAR_BASE);
>> u32 val = __raw_readl(&regs->foo);
>
>
> Could you point me to somewhere stating that? (and why?) I can't find
> anything in README and I can see plenty of code using base+offset already in
> U-boot. In this case the assembly in lowlevel_init.S has to access various
> registers so using the offsets in C means I don't need to duplicate the
> information in both struct & offset macro forms. I don't mind too much if
> it's a rule but I'd like to see some justification/reasoning before I change
> this.
>
> Thanks for the review,
>     Paul
>

I primarily know it form many review comments by Wolfgang Denk. Some
references I've found in ML archives:

[1] http://u-boot.10912.n7.nabble.com/U-Boot-structure-usage-for-peripheral-registers-tc37050.html#none
[2] http://u-boot.10912.n7.nabble.com/U-Boot-PATCH-v5-0-8-those-series-patches-for-add-ben-nanonote-board-tc17476.html#none

@Wolfgang, could you comment please? Also this requirement should be
documented in README or Wiki, shouldn't it?

-- 
Best regards,
Daniel

^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2013-10-24 12:14 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-23 10:07 [U-Boot] [PATCH 00/15] MIPS Malta board support Paul Burton
2013-10-23 10:07 ` [U-Boot] [PATCH 01/15] mips32: detect L1 cache sizes if they're not defined Paul Burton
2013-10-23 10:07 ` [U-Boot] [PATCH 02/15] pcnet: code style cleanup Paul Burton
2013-10-23 10:07 ` [U-Boot] [PATCH 03/15] pcnet: s/le16_to_cpu/cpu_to_le16/ in pcnet_send Paul Burton
2013-10-23 10:07 ` [U-Boot] [PATCH 04/15] pcnet: add cache flushing & invalidation Paul Burton
2013-10-23 10:07 ` [U-Boot] [PATCH 05/15] pcnet: enable the NOUFLO feature Paul Burton
2013-10-23 10:07 ` [U-Boot] [PATCH 06/15] pci.h: allow inclusion in assembly source Paul Burton
2013-10-23 10:07 ` [U-Boot] [PATCH 07/15] qemu-malta: rename to just "malta" Paul Burton
2013-10-23 22:50   ` Daniel Schwierzeck
2013-10-24  9:31     ` [U-Boot] [PATCH v2 " Paul Burton
2013-10-24 10:04       ` Gabor Juhos
2013-10-24 10:10         ` Paul Burton
2013-10-24 10:43           ` Gabor Juhos
2013-10-24 10:54             ` Paul Burton
2013-10-24 11:51               ` Daniel Schwierzeck
2013-10-24 12:06               ` Gabor Juhos
2013-10-24 10:11         ` [U-Boot] [PATCH v3 " Paul Burton
2013-10-23 10:07 ` [U-Boot] [PATCH 08/15] malta: setup super I/O UARTs Paul Burton
2013-10-24  9:32   ` [U-Boot] [PATCH v2 " Paul Burton
2013-10-23 10:07 ` [U-Boot] [PATCH 09/15] malta: support for coreFPGA6 boards Paul Burton
2013-10-23 22:53   ` Daniel Schwierzeck
2013-10-24  9:33     ` [U-Boot] [PATCH v2 " Paul Burton
2013-10-24 12:14       ` Gabor Juhos
2013-10-24  9:47     ` [U-Boot] [PATCH " Paul Burton
2013-10-23 10:08 ` [U-Boot] [PATCH 10/15] malta: display "U-boot" on the LCD screen Paul Burton
2013-10-24  9:34   ` [U-Boot] [PATCH v2 " Paul Burton
2013-10-23 10:08 ` [U-Boot] [PATCH 11/15] malta: enable CONFIG_PCNET_79C973, PCNET_HAS_PROM, CONFIG_CMD_DHCP Paul Burton
2013-10-23 10:08 ` [U-Boot] [PATCH 12/15] malta: remove cache size definitions Paul Burton
2013-10-23 10:08 ` [U-Boot] [PATCH 13/15] malta: disable L2 caches Paul Burton
2013-10-24  9:34   ` [U-Boot] [PATCH v2 " Paul Burton
2013-10-23 10:08 ` [U-Boot] [PATCH 14/15] malta: add script & instructions to flash U-boot Paul Burton
2013-10-23 22:54   ` Daniel Schwierzeck
2013-10-24  9:35     ` [U-Boot] [PATCH v2 " Paul Burton
2013-10-23 10:11 ` [U-Boot] [PATCH 15/15] malta: add myself to maintainers Paul Burton
2013-10-24  9:36   ` [U-Boot] [PATCH v2 " Paul Burton
  -- strict thread matches above, loose matches on Subject: below --
2013-10-24 11:23 [U-Boot] [PATCH 09/15] malta: support for coreFPGA6 boards Daniel Schwierzeck

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.