The paper presents a new method for quasi-static homogenization of granular microstructures and its embedding into two-scale simulations. On the coarse scale, a homogenized standard continuum is considered where the granular microstructures are locally attached at each point. These representative volumes are defined by aggregates of discrete solid particles, which may come into contact. On the micromechanical side, the interparticle contact mechanisms between particles is governed by a Coulomb-type frictional contact. In particular, elliptical-shaped plane particles are investigated. A consistent extension of classical stiff, soft and periodic boundary conditions from continuous to granular microstructures induce new classes of micro-to-macro transitions for granular aggregates. These include constraints not only for particle center displacements but also for particle rotations at a driving boundary frame. The stiff and soft constraints at the driving frame of the particle aggregate induce upper and lower bounds of the particle aggregate's stiffness. On the computational side, we outline a unified implementation of the displacement and rotational constraints by penalty methods that proves to be convenient for straightforward integration into discrete element codes. Representative numerical examples with elliptical-shaped particles are investigated, where the macroscopic stress responses for different boundary constraints are comparatively discussed. Finally, we embed the granular microstructures into a coarse graining discrete-to-finite element model, where they govern the micromechanical behavior of a two-scale simulation. Copyright (C) 2010 John Wiley & Sons, Ltd.