[Skiboot] [PATCH 3/3] external/pflash: fix build breakage on powerpc

Cyril Bur cyril.bur at au1.ibm.com
Thu Apr 16 11:10:58 AEST 2015


Because pflash is a userland tool which makes interesting use of hardware
flash accessors it needs a special version of those functions which don't
actually try to access hardware but perform various userland calls to call
into firmware to update the flash.

Sometime in the past optimisations which introduced inline functions in to the
lpc code caused it to be incompatible with the userland access functions for
powerpc.

This patch solves this by adding a special lpc header to pflash file without
these optimisations.

Signed-off-by: Cyril Bur <cyril.bur at au1.ibm.com>
---
 external/pflash/lpc.h | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 external/pflash/lpc.h

diff --git a/external/pflash/lpc.h b/external/pflash/lpc.h
new file mode 100644
index 0000000..0b16208
--- /dev/null
+++ b/external/pflash/lpc.h
@@ -0,0 +1,31 @@
+/* Copyright 2013-2014 IBM Corp.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * 	http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __PFLASH_LPC_H
+#define __PFLASH_LPC_H
+
+/* Fake routines for accessing the LPC bus from within linux used by pflash
+ * and implemented by powerpc_io.c or arm_io.c */
+
+extern int64_t lpc_fw_read32(uint32_t *val, uint32_t addr);
+
+extern int64_t lpc_fw_write32(uint32_t val, uint32_t addr);
+
+extern void lpc_outb(uint8_t data, uint32_t addr);
+
+extern uint8_t lpc_inb(uint32_t addr);
+
+#endif /* __PFLASH_LPC_H */
-- 
1.9.1



More information about the Skiboot mailing list