diff --git a/arch/arm/mach-imx/clocksource.c b/arch/arm/mach-imx/clocksource.c index 4f5895c..4e77ece 100644 --- a/arch/arm/mach-imx/clocksource.c +++ b/arch/arm/mach-imx/clocksource.c @@ -38,7 +38,7 @@ #include #define GPT(x) __REG(IMX_TIM1_BASE + (x)) -#define timer_base (IMX_TIM1_BASE) +#define timer_base IOMEM(IMX_TIM1_BASE) static uint64_t imx_clocksource_read(void) { @@ -120,15 +120,17 @@ */ void __noreturn reset_cpu (unsigned long addr) { + void __iomem *wdt = IOMEM(IMX_WDT_BASE); + /* Disable watchdog and set Time-Out field to 0 */ - writew(0x0, IMX_WDT_BASE + WDOG_WCR); + writew(0x0, wdt + WDOG_WCR); /* Write Service Sequence */ - writew(0x5555, IMX_WDT_BASE + WDOG_WSR); - writew(0xaaaa, IMX_WDT_BASE + WDOG_WSR); + writew(0x5555, wdt + WDOG_WSR); + writew(0xaaaa, wdt + WDOG_WSR); /* Enable watchdog */ - writew(WDOG_WCR_WDE, IMX_WDT_BASE + WDOG_WCR); + writew(WDOG_WCR_WDE, wdt + WDOG_WCR); while (1); /*NOTREACHED*/ diff --git a/arch/arm/mach-imx/include/mach/clock.h b/arch/arm/mach-imx/include/mach/clock.h index 1082178..060d265 100644 --- a/arch/arm/mach-imx/include/mach/clock.h +++ b/arch/arm/mach-imx/include/mach/clock.h @@ -30,6 +30,8 @@ ulong imx_get_i2cclk(void); ulong imx_get_mmcclk(void); ulong imx_get_cspiclk(void); +ulong imx_get_ipgclk(void); +ulong imx_get_usbclk(void); int imx_clko_set_div(int div); void imx_clko_set_src(int src); diff --git a/arch/arm/mach-imx/speed-imx35.c b/arch/arm/mach-imx/speed-imx35.c index 1e1c39f..2bdcc07 100644 --- a/arch/arm/mach-imx/speed-imx35.c +++ b/arch/arm/mach-imx/speed-imx35.c @@ -84,7 +84,7 @@ return fref / aad->ahb; } -static unsigned long imx_get_ipgclk(void) +unsigned long imx_get_ipgclk(void) { ulong clk = imx_get_ahbclk(); diff --git a/arch/arm/mach-imx/speed-imx51.c b/arch/arm/mach-imx/speed-imx51.c index 8d1ecf3..1c3523d 100644 --- a/arch/arm/mach-imx/speed-imx51.c +++ b/arch/arm/mach-imx/speed-imx51.c @@ -2,11 +2,12 @@ #include #include #include +#include #include static u32 ccm_readl(u32 ofs) { - return readl(MX51_CCM_BASE_ADDR + ofs); + return readl(IOMEM(MX51_CCM_BASE_ADDR) + ofs); } static unsigned long ckil_get_rate(void) @@ -142,7 +143,7 @@ return parent_rate / (prediv * podf); } -static unsigned long imx_get_ahbclk(void) +unsigned long imx_get_ahbclk(void) { u32 reg, div; diff --git a/arch/arm/mach-imx/speed-imx53.c b/arch/arm/mach-imx/speed-imx53.c index 634341e..653dae3 100644 --- a/arch/arm/mach-imx/speed-imx53.c +++ b/arch/arm/mach-imx/speed-imx53.c @@ -2,6 +2,7 @@ #include #include #include +#include #include "mach/clock-imx51_53.h" static u32 ccm_readl(u32 ofs) @@ -139,7 +140,7 @@ return parent_rate / (prediv * podf); } -static unsigned long imx_get_ahbclk(void) +unsigned long imx_get_ahbclk(void) { u32 reg, div; diff --git a/common/oftree.c b/common/oftree.c index 49758a9..677e934 100644 --- a/common/oftree.c +++ b/common/oftree.c @@ -207,7 +207,7 @@ if (nodeoff < 0) return nodeoff; - if ((!create) && (fdt_get_property(fdt, nodeoff, prop, 0) == NULL)) + if ((!create) && (fdt_get_property(fdt, nodeoff, prop, NULL) == NULL)) return 0; /* create flag not set; so exit quietly */ return fdt_setprop(fdt, nodeoff, prop, val, len); diff --git a/common/tlsf.c b/common/tlsf.c index c810e8d..9515ac7 100644 --- a/common/tlsf.c +++ b/common/tlsf.c @@ -367,7 +367,7 @@ if (!fl_map) { /* No free blocks available, memory has been exhausted. */ - return 0; + return NULL; } fl = tlsf_ffs(fl_map); @@ -563,7 +563,7 @@ static block_header_t* block_locate_free(pool_t* pool, size_t size) { int fl = 0, sl = 0; - block_header_t* block = 0; + block_header_t* block = NULL; if (size) { @@ -582,7 +582,7 @@ static void* block_prepare_used(pool_t* pool, block_header_t* block, size_t size) { - void* p = 0; + void* p = NULL; if (block) { block_trim_free(pool, block, size); @@ -737,7 +737,7 @@ ** tlsf_create, equal to the size of a pool_t plus overhead of the initial ** free block and the sentinel block. */ -size_t tlsf_overhead() +size_t tlsf_overhead(void) { const size_t pool_overhead = sizeof(pool_t) + 2 * block_header_overhead; return pool_overhead; @@ -790,7 +790,7 @@ (unsigned int)(pool_overhead + block_size_min), (unsigned int)(pool_overhead + block_size_max)); #endif - return 0; + return NULL; } /* Construct a valid pool object. */ @@ -915,7 +915,7 @@ void* tlsf_realloc(tlsf_pool tlsf, void* ptr, size_t size) { pool_t* pool = tlsf_cast(pool_t*, tlsf); - void* p = 0; + void* p = NULL; /* Zero-size requests are treated as free. */ if (ptr && size == 0) diff --git a/drivers/base/driver.c b/drivers/base/driver.c index a5c6fb9..55dbf47 100644 --- a/drivers/base/driver.c +++ b/drivers/base/driver.c @@ -241,15 +241,15 @@ return NULL; } -void __iomem *dev_get_mem_region(struct device_d *dev, int num) +void *dev_get_mem_region(struct device_d *dev, int num) { struct resource *res; res = dev_get_resource(dev, num); if (!res) - return res; + return NULL; - return (void __force __iomem *)res->start; + return (void __force *)res->start; } EXPORT_SYMBOL(dev_get_mem_region); diff --git a/drivers/mci/imx-esdhc.c b/drivers/mci/imx-esdhc.c index ae3c805..585cab9 100644 --- a/drivers/mci/imx-esdhc.c +++ b/drivers/mci/imx-esdhc.c @@ -70,7 +70,7 @@ struct fsl_esdhc_host { struct mci_host mci; - struct fsl_esdhc *regs; + struct fsl_esdhc __iomem *regs; u32 no_snoop; unsigned long cur_clock; struct device_d *dev; @@ -81,7 +81,7 @@ #define SDHCI_CMD_ABORTCMD (0xC0 << 16) /* Return the XFERTYP flags for a given command and data packet */ -u32 esdhc_xfertyp(struct mci_cmd *cmd, struct mci_data *data) +static u32 esdhc_xfertyp(struct mci_cmd *cmd, struct mci_data *data) { u32 xfertyp = 0; @@ -185,7 +185,7 @@ static int esdhc_setup_data(struct mci_host *mci, struct mci_data *data) { struct fsl_esdhc_host *host = to_fsl_esdhc(mci); - struct fsl_esdhc *regs = host->regs; + struct fsl_esdhc __iomem *regs = host->regs; #ifndef CONFIG_MCI_IMX_ESDHC_PIO u32 wml_value; @@ -237,7 +237,7 @@ u32 xfertyp, mixctrl; u32 irqstat; struct fsl_esdhc_host *host = to_fsl_esdhc(mci); - struct fsl_esdhc *regs = host->regs; + struct fsl_esdhc __iomem *regs = host->regs; int ret; esdhc_write32(®s->irqstat, -1); @@ -353,11 +353,11 @@ return 0; } -void set_sysctl(struct mci_host *mci, u32 clock) +static void set_sysctl(struct mci_host *mci, u32 clock) { int div, pre_div; struct fsl_esdhc_host *host = to_fsl_esdhc(mci); - struct fsl_esdhc *regs = host->regs; + struct fsl_esdhc __iomem *regs = host->regs; int sdhc_clk = imx_get_mmcclk(); u32 clk; @@ -400,7 +400,7 @@ static void esdhc_set_ios(struct mci_host *mci, struct mci_ios *ios) { struct fsl_esdhc_host *host = to_fsl_esdhc(mci); - struct fsl_esdhc *regs = host->regs; + struct fsl_esdhc __iomem *regs = host->regs; /* Set the clock speed */ set_sysctl(mci, ios->clock); @@ -425,7 +425,7 @@ static int esdhc_card_detect(struct fsl_esdhc_host *host) { - struct fsl_esdhc *regs = host->regs; + struct fsl_esdhc __iomem *regs = host->regs; struct esdhc_platform_data *pdata = host->dev->platform_data; int ret; @@ -451,7 +451,7 @@ static int esdhc_init(struct mci_host *mci, struct device_d *dev) { struct fsl_esdhc_host *host = to_fsl_esdhc(mci); - struct fsl_esdhc *regs = host->regs; + struct fsl_esdhc __iomem *regs = host->regs; int timeout = 1000; int ret = 0; @@ -493,7 +493,7 @@ return ret; } -static int esdhc_reset(struct fsl_esdhc *regs) +static int esdhc_reset(struct fsl_esdhc __iomem *regs) { uint64_t start; diff --git a/drivers/mtd/ubi/ubi-barebox.h b/drivers/mtd/ubi/ubi-barebox.h index d23228f..72f29a6 100644 --- a/drivers/mtd/ubi/ubi-barebox.h +++ b/drivers/mtd/ubi/ubi-barebox.h @@ -135,7 +135,6 @@ #define GFP_KERNEL 0 #define GFP_NOFS 1 -#define __user #define __init #define __exit diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c index 800c188..7dddbbc 100644 --- a/drivers/net/smc911x.c +++ b/drivers/net/smc911x.c @@ -691,7 +691,7 @@ struct smc911x_priv *priv; uint32_t val; int i; - void *base; + void __iomem *base; base = dev_request_mem_region(dev, 0); diff --git a/drivers/usb/gadget/fsl_udc.c b/drivers/usb/gadget/fsl_udc.c index 627e417..5537a0e 100644 --- a/drivers/usb/gadget/fsl_udc.c +++ b/drivers/usb/gadget/fsl_udc.c @@ -519,7 +519,7 @@ * 2 + ((windex & USB_DIR_IN) ? 1 : 0)) #define get_pipe_by_ep(EP) (ep_index(EP) * 2 + ep_is_in(EP)) -static struct usb_dr_device *dr_regs; +static struct usb_dr_device __iomem *dr_regs; static struct fsl_udc *udc_controller = NULL; static const struct usb_endpoint_descriptor diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index 05e4094..f10d827 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c @@ -415,7 +415,7 @@ /* get a transfer request */ -int sohci_submit_job(struct urb_priv *urb, struct devrequest *setup) +static int sohci_submit_job(struct urb_priv *urb, struct devrequest *setup) { struct ed *ed; int i, size = 0; @@ -498,7 +498,7 @@ static inline int sohci_return_job(struct ohci *hc, struct urb_priv *urb) { #ifdef ENBALE_PIPE_INTERRUPT - struct ohci_regs *regs = hc->regs; + struct ohci_regs __iomem *regs = hc->regs; #endif switch (usb_pipetype(urb->pipe)) { @@ -848,7 +848,7 @@ } #endif if (!len) - data = 0; + data = NULL; td->hwINFO = m32_swap(info); td->hwCBP = virt_to_phys((void *)m32_swap((unsigned long)data)); @@ -894,7 +894,7 @@ if (data_len) data = buffer; else - data = 0; + data = NULL; switch (usb_pipetype(pipe)) { case PIPE_BULK: @@ -1214,32 +1214,6 @@ writel(value, &ohci->regs->roothub.portstatus[wIndex-1]); } -/* request to virtual root hub */ - -int rh_check_port_status(struct ohci *controller) -{ - __u32 temp, ndp, i; - int res; - - res = -1; - temp = roothub_a(controller); - ndp = (temp & RH_A_NDP); -#ifdef CONFIG_AT91C_PQFP_UHPBUG - ndp = (ndp == 2) ? 1 : 0; -#endif - for (i = 0; i < ndp; i++) { - temp = roothub_portstatus(controller, i); - /* check for a device disconnect */ - if (((temp & (RH_PS_PESC | RH_PS_CSC)) == - (RH_PS_PESC | RH_PS_CSC)) && - ((temp & RH_PS_CCS) == 0)) { - res = i; - break; - } - } - return res; -} - static int ohci_submit_rh_msg(struct usb_device *dev, unsigned long pipe, void *buffer, int transfer_len, struct devrequest *cmd) { @@ -1502,7 +1476,7 @@ /* common code for handling submit messages - used for all but root hub */ /* accesses. */ -int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer, +static int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer, int transfer_len, struct devrequest *setup, int interval, int timeout) { @@ -1721,7 +1695,7 @@ static int hc_interrupt(struct ohci *ohci) { - struct ohci_regs *regs = ohci->regs; + struct ohci_regs __iomem *regs = ohci->regs; int ints; int stat = 0; @@ -1840,7 +1814,7 @@ usb_register_host(host); - ohci->regs = (void *)dev->resource[0].start; + ohci->regs = dev_request_mem_region(dev, 0); return 0; } diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h index 9132963..9c9b837 100644 --- a/drivers/usb/host/ohci.h +++ b/drivers/usb/host/ohci.h @@ -408,7 +408,7 @@ int disabled; /* e.g. got a UE, we're hung */ unsigned long flags; /* for HC bugs */ - struct ohci_regs *regs; /* OHCI controller's memory */ + struct ohci_regs __iomem *regs; /* OHCI controller's memory */ int ohci_int_load[32]; /* load of the 32 Interrupt Chains (for load balancing)*/ struct ed *ed_rm_list[2]; /* lists of all endpoints to be removed */ diff --git a/fs/fat/ff.c b/fs/fat/ff.c index 2d476ee..66db1d6 100644 --- a/fs/fat/ff.c +++ b/fs/fat/ff.c @@ -1043,7 +1043,7 @@ if (sn[NS] & NS_LOSS) { /* When LFN is out of 8.3 format, generate a numbered name */ - fn[NS] = 0; dj->lfn = 0; /* Find only SFN */ + fn[NS] = 0; dj->lfn = NULL; /* Find only SFN */ for (n = 1; n < 100; n++) { gen_numname(fn, sn, lfn, n); /* Generate a numbered name */ res = dir_find(dj); /* Check if the name collides with existing SFN */ @@ -1496,7 +1496,7 @@ if ((UINT)*path < ' ') { /* Nul path means the start directory itself */ res = dir_sdi(dj, 0); - dj->dir = 0; + dj->dir = NULL; return res; } @@ -1718,7 +1718,7 @@ DEF_NAMEBUF; - fp->fs = 0; /* Clear file object */ + fp->fs = NULL; /* Clear file object */ #ifdef CONFIG_FS_FAT_WRITE mode &= FA_READ | FA_WRITE | FA_CREATE_ALWAYS | FA_OPEN_ALWAYS | FA_CREATE_NEW; @@ -2059,7 +2059,7 @@ /* Flush cached data */ res = f_sync(fp); if (res == 0) - fp->fs = 0; /* Discard file object */ + fp->fs = NULL; /* Discard file object */ return res; #endif } @@ -2308,7 +2308,7 @@ } else { clst = fatfs->n_fatent; sect = fatfs->fatbase; - i = 0; p = 0; + i = 0; p = NULL; do { if (!i) { res = move_window(fatfs, sect++); diff --git a/include/driver.h b/include/driver.h index eacd8e6..a5e3f44 100644 --- a/include/driver.h +++ b/include/driver.h @@ -183,7 +183,7 @@ /* * get register base 'num' for a device */ -void __iomem *dev_get_mem_region(struct device_d *dev, int num); +void *dev_get_mem_region(struct device_d *dev, int num); /* * exlusively request register base 'num' for a device diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 5be3dab..cc8c4de 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -4,7 +4,7 @@ #ifndef __ASSEMBLY__ #ifdef __CHECKER__ -# define __user __attribute__((noderef, address_space(1))) +# define __user /* no user address space in barebox */ # define __kernel /* default address space */ # define __safe __attribute__((safe)) # define __force __attribute__((force)) diff --git a/include/qsort.h b/include/qsort.h index bbb2359..d279dc2 100644 --- a/include/qsort.h +++ b/include/qsort.h @@ -4,4 +4,6 @@ void qsort(void *base, size_t nel, size_t width, int (*comp)(const void *, const void *)); +int strcmp_compar(const void *p1, const void *p2); + #endif /* __QSORT_H */