From: Magnus Damm <magnus.damm@gmail.com>
To: kexec@lists.infradead.org
Cc: horms@verge.net.au, Magnus Damm <magnus.damm@gmail.com>
Subject: [PATCH 03/06] sh: Add virtual addresses support
Date: Tue, 26 Aug 2008 20:12:11 +0900 [thread overview]
Message-ID: <20080826111211.615.66730.sendpatchset@rx1.opensource.se> (raw)
In-Reply-To: <20080826111150.615.97501.sendpatchset@rx1.opensource.se>
From: Magnus Damm <damm@igel.co.jp>
Implement virtual-to-physical address conversion functions for SuperH.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
---
kexec/arch/sh/Makefile | 4 ++++
kexec/arch/sh/kexec-sh.c | 29 +++++++++++++++++++++++++++++
kexec/arch/sh/kexec-zImage-sh.c | 4 ++--
3 files changed, 35 insertions(+), 2 deletions(-)
--- 0001/kexec/arch/sh/Makefile
+++ work/kexec/arch/sh/Makefile 2008-08-22 11:07:45.000000000 +0900
@@ -7,6 +7,10 @@ sh_KEXEC_SRCS += kexec/arch/sh/kexec-net
sh_KEXEC_SRCS += kexec/arch/sh/kexec-elf-rel-sh.c
sh_KEXEC_SRCS += kexec/arch/sh/netbsd_booter.S
+sh_ADD_BUFFER =
+sh_ADD_SEGMENT =
+sh_VIRT_TO_PHYS =
+
dist += kexec/arch/sh/Makefile $(sh_KEXEC_SRCS) \
kexec/arch/sh/kexec-sh.h \
kexec/arch/sh/include/arch/options.h
--- 0003/kexec/arch/sh/kexec-sh.c
+++ work/kexec/arch/sh/kexec-sh.c 2008-08-22 11:10:31.000000000 +0900
@@ -168,3 +168,32 @@ int is_crashkernel_mem_reserved(void)
return 0; /* kdump is not supported on this platform (yet) */
}
+unsigned long virt_to_phys(unsigned long addr)
+{
+ unsigned long seg = addr & 0xe0000000;
+ if (seg != 0x80000000 && seg != 0xc0000000)
+ die("Virtual address %p is not in P1 or P2\n", (void *)addr);
+
+ return addr - seg;
+}
+
+/*
+ * add_segment() should convert base to a physical address on superh,
+ * while the default is just to work with base as is */
+void add_segment(struct kexec_info *info, const void *buf, size_t bufsz,
+ unsigned long base, size_t memsz)
+{
+ add_segment_phys_virt(info, buf, bufsz, base, memsz, 1);
+}
+
+/*
+ * add_buffer() should convert base to a physical address on superh,
+ * while the default is just to work with base as is */
+unsigned long add_buffer(struct kexec_info *info, const void *buf,
+ unsigned long bufsz, unsigned long memsz,
+ unsigned long buf_align, unsigned long buf_min,
+ unsigned long buf_max, int buf_end)
+{
+ return add_buffer_phys_virt(info, buf, bufsz, memsz, buf_align,
+ buf_min, buf_max, buf_end, 1);
+}
--- 0001/kexec/arch/sh/kexec-zImage-sh.c
+++ work/kexec/arch/sh/kexec-zImage-sh.c 2008-08-22 11:10:43.000000000 +0900
@@ -96,8 +96,8 @@ int zImage_sh_load(int argc, char **argv
paraml = (unsigned long *)param;
// paraml[0] = 1; // readonly flag is set as default
- add_segment(info, param, 4096, empty_zero, 4096);
- add_segment(info, buf, len, (area | 0x00210000), len);
+ add_segment(info, param, 4096, 0x80000000 | empty_zero, 4096);
+ add_segment(info, buf, len, (area | 0x80210000), len);
/* For now we don't have arguments to pass :( */
info->entry = (void *)(0x80210000 | area);
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2008-08-26 11:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-26 11:11 [PATCH 00/06] sh: Improved kexec support for SuperH Magnus Damm
2008-08-26 11:11 ` [PATCH 01/06] sh: Add support for sh4al-dsp processors Magnus Damm
2008-08-26 11:12 ` [PATCH 02/06] sh: Get system memory ranges from /proc/iomem Magnus Damm
2008-08-26 11:12 ` Magnus Damm [this message]
2008-08-26 11:12 ` [PATCH 04/06] sh: Autodetect zImage zero page address Magnus Damm
2008-08-26 11:12 ` [PATCH 05/06] sh: Use dynamic zImage load address Magnus Damm
2008-08-26 11:12 ` [PATCH 06/06] sh: Add vmlinux support Magnus Damm
2008-08-27 2:39 ` Simon Horman
2008-08-27 4:10 ` Magnus Damm
2008-08-27 5:40 ` Simon Horman
2008-08-27 6:55 ` Magnus Damm
2008-08-27 7:35 ` Simon Horman
2008-08-27 7:05 ` [PATCH 00/06] sh: Improved kexec support for SuperH Paul Mundt
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=20080826111211.615.66730.sendpatchset@rx1.opensource.se \
--to=magnus.damm@gmail.com \
--cc=horms@verge.net.au \
--cc=kexec@lists.infradead.org \
/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 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.