Skip to content

Commit

Permalink
Use DT rather than modules params for board rev and serial
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Elwell authored and popcornmix committed Oct 11, 2016
1 parent de0f4d6 commit a71d473
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
18 changes: 9 additions & 9 deletions arch/arm/mach-bcm2708/bcm2708.c
Expand Up @@ -18,22 +18,24 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include <linux/init.h>
#include <linux/module.h>
#include <linux/of_address.h>
#include <linux/broadcom/vc_cma.h>

#include <asm/mach/arch.h>
#include <asm/system_info.h>

/* command line parameters */
static unsigned boardrev, serial;

static void __init bcm2708_init(void)
{
struct device_node *np = of_find_node_by_path("/system");
u32 val;
u64 val64;

vc_cma_early_init();

system_rev = boardrev;
system_serial_low = serial;
if (!of_property_read_u32(np, "linux,revision", &val))
system_rev = val;
if (!of_property_read_u64(np, "linux,serial", &val64))
system_serial_low = val64;
}

static void __init board_reserve(void)
Expand All @@ -53,5 +55,3 @@ DT_MACHINE_START(BCM2708, "BCM2708")
.dt_compat = bcm2708_compat,
MACHINE_END

module_param(boardrev, uint, 0644);
module_param(serial, uint, 0644);
19 changes: 9 additions & 10 deletions arch/arm/mach-bcm2709/bcm2709.c
Expand Up @@ -18,22 +18,24 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include <linux/init.h>
#include <linux/module.h>
#include <linux/of_address.h>
#include <linux/broadcom/vc_cma.h>

#include <asm/mach/arch.h>
#include <asm/system_info.h>

/* command line parameters */
static unsigned boardrev, serial;

static void __init bcm2709_init(void)
{
struct device_node *np = of_find_node_by_path("/system");
u32 val;
u64 val64;

vc_cma_early_init();

system_rev = boardrev;
system_serial_low = serial;
if (!of_property_read_u32(np, "linux,revision", &val))
system_rev = val;
if (!of_property_read_u64(np, "linux,serial", &val64))
system_serial_low = val64;
}

static void __init board_reserve(void)
Expand All @@ -52,6 +54,3 @@ DT_MACHINE_START(BCM2709, "BCM2709")
.reserve = board_reserve,
.dt_compat = bcm2709_compat,
MACHINE_END

module_param(boardrev, uint, 0644);
module_param(serial, uint, 0644);

0 comments on commit a71d473

Please sign in to comment.