summaryrefslogtreecommitdiff
path: root/cesar/hal/phy/src/resys.c
blob: bb954fdf7bcb9a37d32da0d9d6e931cd6abddcd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* Cesar project {{{
 *
 * Copyright (C) 2008 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    src/resys.c
 * \brief   RESYS memories loading.
 * \ingroup hal_phy
 */
#include "common/std.h"

#include "inc/context.h"
#include "inc/regs.h"
#include "inc/resys.h"

/** RESYS program. */
static const u16 resys_prog[] = {
#include "hal_phy_resys_prog.h"
};

/** RESYS offset table. */
static const u16 resys_offsettable[] = {
#include "hal_phy_resys_offsettable.h"
};

/**
 * Load RESYS memories.
 * \param  ctx  phy context
 */
void
phy_resys_load (phy_t *ctx)
{
    uint i;
    volatile u32 *reg;
    reg = &PHY_BASE_ADDR_RESYS_PROG;
    for (i = 0; i < COUNT (resys_prog); i++)
        reg[i] = resys_prog[i];
    reg = &PHY_BASE_ADDR_RESYS_OFFSET;
    for (i = 0; i < COUNT (resys_offsettable); i++)
        reg[i] = resys_offsettable[i];
}