Skip to content

Commit 90ea15b

Browse files
committed
Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm
Pull ARM updates from Russell King: - amba bus cleanups - conversion to use reserve_initrd_mem() - remove -nostdlib from vdso link * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 9181/1: vdso: remove -nostdlib compiler flag ARM: 9175/1: Convert to reserve_initrd_mem() ARM: 9174/1: amba: Move EXPORT_SYMBOL() closer to definition ARM: 9173/1: amba: kill amba_find_match() ARM: 9172/1: amba: Cleanup amba pclk operation
2 parents 356a1ad + 9bc19d4 commit 90ea15b

5 files changed

Lines changed: 9 additions & 134 deletions

File tree

arch/arm/mm/init.c

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -164,47 +164,6 @@ phys_addr_t __init arm_memblock_steal(phys_addr_t size, phys_addr_t align)
164164
return phys;
165165
}
166166

167-
static void __init arm_initrd_init(void)
168-
{
169-
#ifdef CONFIG_BLK_DEV_INITRD
170-
phys_addr_t start;
171-
unsigned long size;
172-
173-
initrd_start = initrd_end = 0;
174-
175-
if (!phys_initrd_size)
176-
return;
177-
178-
/*
179-
* Round the memory region to page boundaries as per free_initrd_mem()
180-
* This allows us to detect whether the pages overlapping the initrd
181-
* are in use, but more importantly, reserves the entire set of pages
182-
* as we don't want these pages allocated for other purposes.
183-
*/
184-
start = round_down(phys_initrd_start, PAGE_SIZE);
185-
size = phys_initrd_size + (phys_initrd_start - start);
186-
size = round_up(size, PAGE_SIZE);
187-
188-
if (!memblock_is_region_memory(start, size)) {
189-
pr_err("INITRD: 0x%08llx+0x%08lx is not a memory region - disabling initrd\n",
190-
(u64)start, size);
191-
return;
192-
}
193-
194-
if (memblock_is_region_reserved(start, size)) {
195-
pr_err("INITRD: 0x%08llx+0x%08lx overlaps in-use memory region - disabling initrd\n",
196-
(u64)start, size);
197-
return;
198-
}
199-
200-
memblock_reserve(start, size);
201-
202-
/* Now convert initrd to virtual addresses */
203-
initrd_start = __phys_to_virt(phys_initrd_start);
204-
initrd_end = initrd_start + phys_initrd_size;
205-
#endif
206-
}
207-
208167
#ifdef CONFIG_CPU_ICACHE_MISMATCH_WORKAROUND
209168
void check_cpu_icache_size(int cpuid)
210169
{
@@ -226,7 +185,7 @@ void __init arm_memblock_init(const struct machine_desc *mdesc)
226185
/* Register the kernel text, kernel data and initrd with memblock. */
227186
memblock_reserve(__pa(KERNEL_START), KERNEL_END - KERNEL_START);
228187

229-
arm_initrd_init();
188+
reserve_initrd_mem();
230189

231190
arm_mm_memblock_reserve();
232191

arch/arm/vdso/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ccflags-y += -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO32
1818

1919
ldflags-$(CONFIG_CPU_ENDIAN_BE8) := --be8
2020
ldflags-y := -Bsymbolic --no-undefined -soname=linux-vdso.so.1 \
21-
-z max-page-size=4096 -nostdlib -shared $(ldflags-y) \
21+
-z max-page-size=4096 -shared $(ldflags-y) \
2222
--hash-style=sysv --build-id=sha1 \
2323
-T
2424

drivers/amba/bus.c

Lines changed: 5 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ int amba_driver_register(struct amba_driver *drv)
370370

371371
return driver_register(&drv->drv);
372372
}
373+
EXPORT_SYMBOL(amba_driver_register);
373374

374375
/**
375376
* amba_driver_unregister - remove an AMBA device driver
@@ -383,7 +384,7 @@ void amba_driver_unregister(struct amba_driver *drv)
383384
{
384385
driver_unregister(&drv->drv);
385386
}
386-
387+
EXPORT_SYMBOL(amba_driver_unregister);
387388

388389
static void amba_device_release(struct device *dev)
389390
{
@@ -642,6 +643,7 @@ int amba_device_register(struct amba_device *dev, struct resource *parent)
642643

643644
return amba_device_add(dev, parent);
644645
}
646+
EXPORT_SYMBOL(amba_device_register);
645647

646648
/**
647649
* amba_device_put - put an AMBA device
@@ -668,66 +670,7 @@ void amba_device_unregister(struct amba_device *dev)
668670
{
669671
device_unregister(&dev->dev);
670672
}
671-
672-
673-
struct find_data {
674-
struct amba_device *dev;
675-
struct device *parent;
676-
const char *busid;
677-
unsigned int id;
678-
unsigned int mask;
679-
};
680-
681-
static int amba_find_match(struct device *dev, void *data)
682-
{
683-
struct find_data *d = data;
684-
struct amba_device *pcdev = to_amba_device(dev);
685-
int r;
686-
687-
r = (pcdev->periphid & d->mask) == d->id;
688-
if (d->parent)
689-
r &= d->parent == dev->parent;
690-
if (d->busid)
691-
r &= strcmp(dev_name(dev), d->busid) == 0;
692-
693-
if (r) {
694-
get_device(dev);
695-
d->dev = pcdev;
696-
}
697-
698-
return r;
699-
}
700-
701-
/**
702-
* amba_find_device - locate an AMBA device given a bus id
703-
* @busid: bus id for device (or NULL)
704-
* @parent: parent device (or NULL)
705-
* @id: peripheral ID (or 0)
706-
* @mask: peripheral ID mask (or 0)
707-
*
708-
* Return the AMBA device corresponding to the supplied parameters.
709-
* If no device matches, returns NULL.
710-
*
711-
* NOTE: When a valid device is found, its refcount is
712-
* incremented, and must be decremented before the returned
713-
* reference.
714-
*/
715-
struct amba_device *
716-
amba_find_device(const char *busid, struct device *parent, unsigned int id,
717-
unsigned int mask)
718-
{
719-
struct find_data data;
720-
721-
data.dev = NULL;
722-
data.parent = parent;
723-
data.busid = busid;
724-
data.id = id;
725-
data.mask = mask;
726-
727-
bus_for_each_dev(&amba_bustype, NULL, &data, amba_find_match);
728-
729-
return data.dev;
730-
}
673+
EXPORT_SYMBOL(amba_device_unregister);
731674

732675
/**
733676
* amba_request_regions - request all mem regions associated with device
@@ -749,6 +692,7 @@ int amba_request_regions(struct amba_device *dev, const char *name)
749692

750693
return ret;
751694
}
695+
EXPORT_SYMBOL(amba_request_regions);
752696

753697
/**
754698
* amba_release_regions - release mem regions associated with device
@@ -763,11 +707,4 @@ void amba_release_regions(struct amba_device *dev)
763707
size = resource_size(&dev->res);
764708
release_mem_region(dev->res.start, size);
765709
}
766-
767-
EXPORT_SYMBOL(amba_driver_register);
768-
EXPORT_SYMBOL(amba_driver_unregister);
769-
EXPORT_SYMBOL(amba_device_register);
770-
EXPORT_SYMBOL(amba_device_unregister);
771-
EXPORT_SYMBOL(amba_find_device);
772-
EXPORT_SYMBOL(amba_request_regions);
773710
EXPORT_SYMBOL(amba_release_regions);

drivers/dma/pl330.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2968,7 +2968,7 @@ static int __maybe_unused pl330_suspend(struct device *dev)
29682968
struct amba_device *pcdev = to_amba_device(dev);
29692969

29702970
pm_runtime_force_suspend(dev);
2971-
amba_pclk_unprepare(pcdev);
2971+
clk_unprepare(pcdev->pclk);
29722972

29732973
return 0;
29742974
}
@@ -2978,7 +2978,7 @@ static int __maybe_unused pl330_resume(struct device *dev)
29782978
struct amba_device *pcdev = to_amba_device(dev);
29792979
int ret;
29802980

2981-
ret = amba_pclk_prepare(pcdev);
2981+
ret = clk_prepare(pcdev->pclk);
29822982
if (ret)
29832983
return ret;
29842984

include/linux/amba/bus.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -117,30 +117,9 @@ void amba_device_put(struct amba_device *);
117117
int amba_device_add(struct amba_device *, struct resource *);
118118
int amba_device_register(struct amba_device *, struct resource *);
119119
void amba_device_unregister(struct amba_device *);
120-
struct amba_device *amba_find_device(const char *, struct device *, unsigned int, unsigned int);
121120
int amba_request_regions(struct amba_device *, const char *);
122121
void amba_release_regions(struct amba_device *);
123122

124-
static inline int amba_pclk_enable(struct amba_device *dev)
125-
{
126-
return clk_enable(dev->pclk);
127-
}
128-
129-
static inline void amba_pclk_disable(struct amba_device *dev)
130-
{
131-
clk_disable(dev->pclk);
132-
}
133-
134-
static inline int amba_pclk_prepare(struct amba_device *dev)
135-
{
136-
return clk_prepare(dev->pclk);
137-
}
138-
139-
static inline void amba_pclk_unprepare(struct amba_device *dev)
140-
{
141-
clk_unprepare(dev->pclk);
142-
}
143-
144123
/* Some drivers don't use the struct amba_device */
145124
#define AMBA_CONFIG_BITS(a) (((a) >> 24) & 0xff)
146125
#define AMBA_REV_BITS(a) (((a) >> 20) & 0x0f)

0 commit comments

Comments
 (0)