1 // SPDX-License-Identifier: GPL-2.0-only
2 /* Altera TSE SGDMA and MSGDMA Linux driver
3 * Copyright (C) 2014 Altera Corporation. All rights reserved
6 #include "altera_tse.h"
7 #include "altera_utils.h"
9 void tse_set_bit(void __iomem
*ioaddr
, size_t offs
, u32 bit_mask
)
11 u32 value
= csrrd32(ioaddr
, offs
);
13 csrwr32(value
, ioaddr
, offs
);
16 void tse_clear_bit(void __iomem
*ioaddr
, size_t offs
, u32 bit_mask
)
18 u32 value
= csrrd32(ioaddr
, offs
);
20 csrwr32(value
, ioaddr
, offs
);
23 int tse_bit_is_set(void __iomem
*ioaddr
, size_t offs
, u32 bit_mask
)
25 u32 value
= csrrd32(ioaddr
, offs
);
26 return (value
& bit_mask
) ? 1 : 0;
29 int tse_bit_is_clear(void __iomem
*ioaddr
, size_t offs
, u32 bit_mask
)
31 u32 value
= csrrd32(ioaddr
, offs
);
32 return (value
& bit_mask
) ? 0 : 1;