From: Jiaxun Yang <jiaxun.yang@flygoat.com>
To: linux-mips@vger.kernel.org
Cc: paul.burton@mips.com, yasha.che3@gmail.com, aurelien@aurel32.net,
sfr@canb.auug.org.au, fancer.lancer@gmail.com,
matt.redfearn@mips.com, chenhc@lemote.com,
Jiaxun Yang <jiaxun.yang@flygoat.com>
Subject: [PATCH 2/7] MIPS: OCTEON: Drop boot_mem_map
Date: Thu, 8 Aug 2019 15:50:08 +0800 [thread overview]
Message-ID: <20190808075013.4852-3-jiaxun.yang@flygoat.com> (raw)
In-Reply-To: <20190808075013.4852-1-jiaxun.yang@flygoat.com>
Replace walk through boot_mem_map with for_each_memblock.
And remove the check of total boot_mem_map.
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
arch/mips/cavium-octeon/dma-octeon.c | 17 +++++++----------
arch/mips/cavium-octeon/setup.c | 3 +--
2 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/arch/mips/cavium-octeon/dma-octeon.c b/arch/mips/cavium-octeon/dma-octeon.c
index 11d5a4e90736..72f24a4db099 100644
--- a/arch/mips/cavium-octeon/dma-octeon.c
+++ b/arch/mips/cavium-octeon/dma-octeon.c
@@ -16,6 +16,7 @@
#include <linux/types.h>
#include <linux/init.h>
#include <linux/mm.h>
+#include <linux/memblock.h>
#include <asm/bootinfo.h>
@@ -190,7 +191,7 @@ char *octeon_swiotlb;
void __init plat_swiotlb_setup(void)
{
- int i;
+ struct memblock_region *mem;
phys_addr_t max_addr;
phys_addr_t addr_size;
size_t swiotlbsize;
@@ -199,19 +200,15 @@ void __init plat_swiotlb_setup(void)
max_addr = 0;
addr_size = 0;
- for (i = 0 ; i < boot_mem_map.nr_map; i++) {
- struct boot_mem_map_entry *e = &boot_mem_map.map[i];
- if (e->type != BOOT_MEM_RAM && e->type != BOOT_MEM_INIT_RAM)
- continue;
-
+ for_each_memblock(memory, mem) {
/* These addresses map low for PCI. */
- if (e->addr > 0x410000000ull && !OCTEON_IS_OCTEON2())
+ if (mem->base > 0x410000000ull && !OCTEON_IS_OCTEON2())
continue;
- addr_size += e->size;
+ addr_size += mem->size;
- if (max_addr < e->addr + e->size)
- max_addr = e->addr + e->size;
+ if (max_addr < mem->base + mem->size)
+ max_addr = mem->base + mem->size;
}
diff --git a/arch/mips/cavium-octeon/setup.c b/arch/mips/cavium-octeon/setup.c
index 8bf43c5a7bc7..95034bf5ca83 100644
--- a/arch/mips/cavium-octeon/setup.c
+++ b/arch/mips/cavium-octeon/setup.c
@@ -1007,8 +1007,7 @@ void __init plat_mem_setup(void)
* regions next to each other.
*/
cvmx_bootmem_lock();
- while ((boot_mem_map.nr_map < BOOT_MEM_MAP_MAX)
- && (total < max_memory)) {
+ while (total < max_memory) {
memory = cvmx_bootmem_phy_alloc(mem_alloc_size,
__pa_symbol(&_end), -1,
0x100000,
--
2.22.0
next prev parent reply other threads:[~2019-08-08 7:57 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-08 7:50 Drop boot_mem_map Jiaxun Yang
2019-08-08 7:50 ` [PATCH 1/7] MIPS: init: " Jiaxun Yang
2019-08-14 11:54 ` Serge Semin
2019-08-14 13:40 ` Jiaxun Yang
2019-08-08 7:50 ` Jiaxun Yang [this message]
2019-08-08 7:50 ` [PATCH 3/7] MIPS: fw: Record prom memory Jiaxun Yang
2019-08-14 12:03 ` Serge Semin
2019-08-14 12:50 ` Thomas Bogendoerfer
2019-08-14 13:45 ` Jiaxun Yang
2019-08-08 7:50 ` [PATCH 4/7] MIPS: malta: Drop prom_free_prom_memory Jiaxun Yang
2019-08-08 7:50 ` [PATCH 5/7] MIPS: msp: Record prom memory Jiaxun Yang
2019-08-14 12:12 ` Serge Semin
2019-08-08 7:50 ` [PATCH 6/7] MIPS: ip22: Drop addr_is_ram Jiaxun Yang
2019-08-08 7:50 ` [PATCH 7/7] MIPS: xlp: Drop boot_mem_map Jiaxun Yang
2019-08-12 4:56 ` [EXTERNAL]Drop boot_mem_map Paul Burton
2019-08-12 5:28 ` Jiaxun Yang
2019-08-13 8:39 ` Serge Semin
2019-08-13 15:09 ` Jiaxun Yang
2019-08-19 14:23 ` [PATCH v1 0/8] MIPS: Drop boot_mem_map Jiaxun Yang
2019-08-19 14:23 ` [PATCH v1 1/8] MIPS: OCTEON: " Jiaxun Yang
2019-08-19 14:23 ` [PATCH v1 2/8] MIPS: fw: Record prom memory Jiaxun Yang
2019-08-19 14:23 ` [PATCH v1 3/8] MIPS: malta: Drop prom_free_prom_memory Jiaxun Yang
2019-08-19 14:23 ` [PATCH v1 4/8] MIPS: msp: Record prom memory Jiaxun Yang
2019-08-19 14:23 ` [PATCH v1 5/8] MIPS: ip22: Drop addr_is_ram Jiaxun Yang
2019-08-19 14:23 ` [PATCH v1 6/8] MIPS: xlp: Drop boot_mem_map Jiaxun Yang
2019-08-19 14:23 ` [PATCH v1 7/8] MIPS: mm: " Jiaxun Yang
2019-08-19 14:23 ` [PATCH v1 8/8] MIPS: init: " Jiaxun Yang
2019-08-23 14:45 ` [PATCH v1 0/8] MIPS: " Paul Burton
2019-08-23 17:20 ` Jiaxun Yang
2019-08-23 17:36 ` Jiaxun Yang
2019-08-23 18:05 ` Serge Semin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190808075013.4852-3-jiaxun.yang@flygoat.com \
--to=jiaxun.yang@flygoat.com \
--cc=aurelien@aurel32.net \
--cc=chenhc@lemote.com \
--cc=fancer.lancer@gmail.com \
--cc=linux-mips@vger.kernel.org \
--cc=matt.redfearn@mips.com \
--cc=paul.burton@mips.com \
--cc=sfr@canb.auug.org.au \
--cc=yasha.che3@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).