Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 39c15737 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull powerpc fixes from Michael Ellerman:
 "Fixes marked for stable:
   - Set missing wakeup bit in LPCR on POWER9
   - Fix the early OPAL console wrappers
   - Fixup kernel read only mapping

  Fixes for code merged this cycle:
   - Fix missing CRCs, add more asm-prototypes.h declarations"

* tag 'powerpc-4.9-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc/mm: Fixup kernel read only mapping
  powerpc/boot: Fix the early OPAL console wrappers
  powerpc: Fix missing CRCs, add more asm-prototypes.h declarations
  powerpc: Set missing wakeup bit in LPCR on POWER9
parents 3ad0e83c 984d7a1e
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -232,8 +232,12 @@ void start(void)
		console_ops.close();

	kentry = (kernel_entry_t) vmlinux.addr;
	if (ft_addr)
	if (ft_addr) {
		if(platform_ops.kentry)
			platform_ops.kentry(ft_addr, vmlinux.addr);
		else
			kentry(ft_addr, 0, NULL);
	}
	else
		kentry((unsigned long)initrd.addr, initrd.size,
		       loader_info.promptr);
+13 −0
Original line number Diff line number Diff line
@@ -12,6 +12,19 @@

	.text

	.globl opal_kentry
opal_kentry:
	/* r3 is the fdt ptr */
	mtctr r4
	li	r4, 0
	li	r5, 0
	li	r6, 0
	li	r7, 0
	ld	r11,opal@got(r2)
	ld	r8,0(r11)
	ld	r9,8(r11)
	bctr

#define OPAL_CALL(name, token)				\
	.globl name;					\
name:							\
+11 −0
Original line number Diff line number Diff line
@@ -23,14 +23,25 @@ struct opal {

static u32 opal_con_id;

/* see opal-wrappers.S */
int64_t opal_console_write(int64_t term_number, u64 *length, const u8 *buffer);
int64_t opal_console_read(int64_t term_number, uint64_t *length, u8 *buffer);
int64_t opal_console_write_buffer_space(uint64_t term_number, uint64_t *length);
int64_t opal_console_flush(uint64_t term_number);
int64_t opal_poll_events(uint64_t *outstanding_event_mask);

void opal_kentry(unsigned long fdt_addr, void *vmlinux_addr);

static int opal_con_open(void)
{
	/*
	 * When OPAL loads the boot kernel it stashes the OPAL base and entry
	 * address in r8 and r9 so the kernel can use the OPAL console
	 * before unflattening the devicetree. While executing the wrapper will
	 * probably trash r8 and r9 so this kentry hook restores them before
	 * entering the decompressed kernel.
	 */
	platform_ops.kentry = opal_kentry;
	return 0;
}

+1 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ struct platform_ops {
	void *	(*realloc)(void *ptr, unsigned long size);
	void	(*exit)(void);
	void *	(*vmlinux_alloc)(unsigned long size);
	void  	(*kentry)(unsigned long fdt_addr, void *vmlinux_addr);
};
extern struct platform_ops platform_ops;

+12 −0
Original line number Diff line number Diff line
@@ -14,6 +14,10 @@

#include <linux/threads.h>
#include <linux/kprobes.h>
#include <asm/cacheflush.h>
#include <asm/checksum.h>
#include <asm/uaccess.h>
#include <asm/epapr_hcalls.h>

#include <uapi/asm/ucontext.h>

@@ -109,4 +113,12 @@ void early_setup_secondary(void);
/* time */
void accumulate_stolen_time(void);

/* misc runtime */
extern u64 __bswapdi2(u64);
extern s64 __lshrdi3(s64, int);
extern s64 __ashldi3(s64, int);
extern s64 __ashrdi3(s64, int);
extern int __cmpdi2(s64, s64);
extern int __ucmpdi2(u64, u64);

#endif /* _ASM_POWERPC_ASM_PROTOTYPES_H */
Loading