microblaze: Cosmetic changes in Microblaze related files

Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
This commit is contained in:
Shreenidhi Shedi 2018-07-15 02:34:35 +05:30 committed by Michal Simek
parent 8c258e6245
commit 35912528a8
3 changed files with 60 additions and 44 deletions

View File

@ -1,3 +1,4 @@
/* SPDX-License-Identifier: GPL-2.0+ */
/* /*
* include/asm-microblaze/io.h -- Misc I/O operations * include/asm-microblaze/io.h -- Misc I/O operations
* *
@ -22,15 +23,19 @@
#define readb(addr) \ #define readb(addr) \
({ unsigned char __v = (*(volatile unsigned char *)(addr)); __v; }) ({ unsigned char __v = (*(volatile unsigned char *)(addr)); __v; })
#define readw(addr) \ #define readw(addr) \
({ unsigned short __v = (*(volatile unsigned short *)(addr)); __v; }) ({ unsigned short __v = (*(volatile unsigned short *)(addr)); __v; })
#define readl(addr) \ #define readl(addr) \
({ unsigned int __v = (*(volatile unsigned int *)(addr)); __v; }) ({ unsigned int __v = (*(volatile unsigned int *)(addr)); __v; })
#define writeb(b, addr) \ #define writeb(b, addr) \
(void)((*(volatile unsigned char *)(addr)) = (b)) (void)((*(volatile unsigned char *)(addr)) = (b))
#define writew(b, addr) \ #define writew(b, addr) \
(void)((*(volatile unsigned short *)(addr)) = (b)) (void)((*(volatile unsigned short *)(addr)) = (b))
#define writel(b, addr) \ #define writel(b, addr) \
(void)((*(volatile unsigned int *)(addr)) = (b)) (void)((*(volatile unsigned int *)(addr)) = (b))
@ -54,7 +59,6 @@
#define out_be16(addr, x) outw(x, addr) #define out_be16(addr, x) outw(x, addr)
#define out_be32(addr, x) outl(x, addr) #define out_be32(addr, x) outl(x, addr)
#define inb_p(port) inb((port)) #define inb_p(port) inb((port))
#define outb_p(val, port) outb((val), (port)) #define outb_p(val, port) outb((val), (port))
#define inw_p(port) inw((port)) #define inw_p(port) inw((port))
@ -74,18 +78,23 @@
static inline void io_insb(unsigned long port, void *dst, unsigned long count) static inline void io_insb(unsigned long port, void *dst, unsigned long count)
{ {
unsigned char *p = dst; unsigned char *p = dst;
while (count--) while (count--)
*p++ = inb(port); *p++ = inb(port);
} }
static inline void io_insw(unsigned long port, void *dst, unsigned long count) static inline void io_insw(unsigned long port, void *dst, unsigned long count)
{ {
unsigned short *p = dst; unsigned short *p = dst;
while (count--) while (count--)
*p++ = inw(port); *p++ = inw(port);
} }
static inline void io_insl(unsigned long port, void *dst, unsigned long count) static inline void io_insl(unsigned long port, void *dst, unsigned long count)
{ {
unsigned long *p = dst; unsigned long *p = dst;
while (count--) while (count--)
*p++ = inl(port); *p++ = inl(port);
} }
@ -94,20 +103,25 @@ static inline void
io_outsb(unsigned long port, const void *src, unsigned long count) io_outsb(unsigned long port, const void *src, unsigned long count)
{ {
const unsigned char *p = src; const unsigned char *p = src;
while (count--) while (count--)
outb(*p++, port); outb(*p++, port);
} }
static inline void static inline void
io_outsw(unsigned long port, const void *src, unsigned long count) io_outsw(unsigned long port, const void *src, unsigned long count)
{ {
const unsigned short *p = src; const unsigned short *p = src;
while (count--) while (count--)
outw(*p++, port); outw(*p++, port);
} }
static inline void static inline void
io_outsl(unsigned long port, const void *src, unsigned long count) io_outsl(unsigned long port, const void *src, unsigned long count)
{ {
const unsigned long *p = src; const unsigned long *p = src;
while (count--) while (count--)
outl(*p++, port); outl(*p++, port);
} }

View File

@ -5,8 +5,10 @@
* Michal SIMEK <monstr@monstr.eu> * Michal SIMEK <monstr@monstr.eu>
*/ */
/* This is a board specific file. It's OK to include board specific /*
* header files */ * This is a board specific file. It's OK to include board specific
* header files
*/
#include <common.h> #include <common.h>
#include <config.h> #include <config.h>
@ -71,7 +73,7 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
hw_watchdog_disable(); hw_watchdog_disable();
#endif #endif
#endif #endif
puts ("Reseting board\n"); puts("Resetting board\n");
__asm__ __volatile__ (" mts rmsr, r0;" \ __asm__ __volatile__ (" mts rmsr, r0;" \
"bra r0"); "bra r0");