[PATCH v5 1/2] ARM: Make a compile firmware conditionally
From: Olof Johansson <hidden>
Date: 2012-08-27 22:05:53
Hi, On Fri, Aug 24, 2012 at 05:33:51PM +0900, Kyungmin Park wrote:
quoted hunk ↗ jump to hunk
diff --git a/arch/arm/common/Kconfig b/arch/arm/common/Kconfig index 283fa1d..5b097ca 100644 --- a/arch/arm/common/Kconfig +++ b/arch/arm/common/Kconfig@@ -21,6 +21,9 @@ config ARM_VIC_NR The maximum number of VICs available in the system, for power management. +config ARM_FIRMWARE + bool +
I don't think you need a config option for this now, it only adds 12 bytes of data to the kernel and it makes the below simpler.
quoted hunk ↗ jump to hunk
diff --git a/arch/arm/include/asm/firmware.h b/arch/arm/include/asm/firmware.h new file mode 100644 index 0000000..99c97ff --- /dev/null +++ b/arch/arm/include/asm/firmware.h@@ -0,0 +1,27 @@ +/* + * Copyright (C) 2012 Samsung Electronics. + * Kyungmin Park <kyungmin.park@samsung.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __ASM_ARM_FIRMWARE_H +#define __ASM_ARM_FIRMWARE_H + +struct firmware_ops { + int (*do_idle)(void); + void (*cpu_boot)(int cpu); +}; + +extern struct firmware_ops *firmware_ops; + +#ifdef CONFIG_ARM_FIRMWARE +#define call_firmware_op(op, ...) \ + ((firmware_ops->op) ? firmware_ops->op(__VA_ARGS__) : 0) +#else +#define call_firmware_op(op, ...) do { } while (0) +#endif
If you always include the firmware.c file, then you don't need the ifdef above either, since the default version fills in dummy versions. -Olof